On Tue, Apr 12, 2011 at 5:35 PM, Warren Young <mysqlpp@stripped> wrote:
> On 4/12/2011 4:45 PM, Dan Cook (dancook) wrote:
>> What kind of workaround are you suggesting?
> Be careful, my mailer wrapped the URL in the big comment above. Fix it
> before applying the patch.
> I don't see a way to distinguish the "malloc() returned 0" case, but if
> that's happening, installing this patch will cause your program to start
> crashing under the same conditions when *its* memory allocations fail
> If that fixes your symptom, please let me know, as I haven't checked this
> into svn. It is certainly incomplete, if for no other reason than because
> it doesn't fix Query::storein_set() as well.
> I also wonder whether, given the potential circumstances for this problem
> to crop up, if Query::result_empty() should have additional checks on conn_
> and conn->driver().
What about modifying either following 3 functions to check driver_ before
result.cpp:161 UseQueryResult::fetch_lengths() const and
result.cpp:165 Row UseQueryResult::fetch_row() const
result.cpp.202 MYSQL_ROW UseQueryResult::fetch_raw_row() const
throwing from the constructor of ResultBase instead?
Checking each time that member is not null before use is going to be
inefficient but I dont know consequences of ResultBase constructor throwing.
I have not even begin to look where ResultBase is constructed - so this
could be a stupid idea