Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.8.x, 5.7, 5.8, 5.9
-
None
-
d25346417238b7dc0fb37359a9b56eff2908a5dc
Description
MariaDB 10.2 now ships with libmariadb instead of libmysqlclient as a client library. While the API stayed compatible, there was a behavior change regarding connection initialization.
mysql_server_init (and mysql_library_init) are now inside a pthread_once call. This means that in a threaded environment, once one thread calls mysql_server_end, a later call to mysql_server_init does nothing and connections are no longer initialized.
According to upstream (MariaDB Bug Report), mysql_server_end should only be called when the application terminates, not as it is now when the number of connections drops to 0.
An example applications exhibiting this problem is akonadi (Bug report).