Today I've stucked in quite a veird bug. My application was written according to
http://tangentsoft.net/mysql++/doc/html/userman/threads.html
And
mysqlpp::Connection::thread_start();
was called before grabbing connection from connection pool.
thread_start was called before mysql_init on a first call. As a result
pthread_getspecific() was called with an unallocated pthread key as an
argument. This bug is especially hard to find because thread key has 0
value by default and would recieve 0 value on first call to
pthread_key_create. So you would never notice this if you don't use
thread specific pointers anywhere else beside mysql.
But i have used libmysql which uses it too.
Similar bug is described here:
http://bugs.php.net/bug.php?id=28547
Please fix documentation.
By the way, previous version of mysql++ required to pass mysql
connection to thread_start() so t was not possible to call it without
initializing connection and calling mysql_init(). Please bet this
argument back.
Thanks.