segfaults in mysql driver

Paul J Stevens paul at nfg.nl
Wed Mar 19 22:08:09 CET 2008


Jan-Henrik Haukeland wrote:
> On 19. mars. 2008, at 15.40, Paul J Stevens wrote:
> 
>> Ok, I get it, I think.
>>
>> Reading the source I come to the conclusion that I should use  
>> ResetSet_readData
>> for any column wider than STRLEN chars rather than _getString or  
>> _getBlob
> 
> No, _getString and _getBlob should of course work with any column  
> length data. This looks to be a number overflow bug of some sorts in  
> ensureCapacity() according to Martin, which we of course will fix. I'm  
> just stumped we haven't seen this before, ourselves. Must be that we  
> mainly work with small data and using SQLite.

Glad to hear you guys are on it. I'm already quite seriously committed
to using zdb. I'm still single threaded, but my database code is fully
updated. I've begun putting some serious pressure on the postgres driver
which is holding out great. That means I really need to deal with any
surprises in the other drivers. But your code is a pleasure to work with
so far.

I was zooming in on ensureCapacity myself. Isn't mysql_stmt_store_result
required to determine the width of a column? R->columns[i]->length
appears to stay 0. I also can't see an obvious solution that avoids
allocating rows*max_length for each MysqlResultSet. But I don't have any
experience with the mysql_stmt api (yet).

Anyway, curious to see what Martin comes up with.

-- 
  ________________________________________________________________
  Paul Stevens                                      paul at nfg.nl
  NET FACILITIES GROUP                     GPG/PGP: 1024D/11F8CD31
  The Netherlands________________________________http://www.nfg.nl


More information about the libzdb-general mailing list