Warren Young wrote:
> On May 14, 2009, at 7:12 PM, Michael wrote:
>> it seems like thread_start is not calling mysql_init implicitely, so
>> calls to mysqlpp::tgread_start result in a segfault (mysql++ 3.08 on
>> mysqlpp::Connection() to the beginning of main works as a temporary fix,
>> but I think thread_start should somehow verify that mysql_(library)_init
>> is called at least once.
> Such details are best left to the underlying C library. The right fix,
> already scheduled for v3.1, is to expose mysql_library_init() and
> mysql_library_end() through DBDriver. This will also squish the last
> spurious memory leak report from tools like valgrind when using threads.
Hmm, the underlying C library documentation states, that
mysql_library_init has to be called before any other mysql* function
call. So your solution would be making the user explicitely call it
through DBDriver? I personally feel that it would be much more user
friendly, if mysqlpp would do the bookkeeping automatically (at least
configurable), so users won't need do a C-style init/uninit procedure in
their code (in the end mysqlpp _is_ an abstraction of the plain C library).
Whatever the solution will look like, it might me good to upgrade the
documentation and point that out in the multithreading chapter of
mysqlpp. Depending on the execution path, segfaults might hitting users