Today I've stucked in quite a veird bug. My application was written according to
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:
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