Bug #72604 Use of mysql_init is not thread safe, but not documented as such
Submitted: 10 May 2014 0:16 Modified: 10 Jun 2014 19:59
Reporter: Jeremy Cole (Basic Quality Contributor) (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Daniel Price CPU Architecture:Any
Tags: crash, mysql_init, threads, threadsafe

[10 May 2014 0:16] Jeremy Cole
Description:
The mysql_init call implicitly calls mysql_library_init if it hasn't been already, and mysql_library_init is not thread safe. This means that mysql_init is not thread-safe (and is actually thread-hostile) if mysql_library_init has not been called. This should be documented on the page for mysql_init (and even the need to call mysql_library_init is not currently mentioned there).

How to repeat:
Read the manual.
[10 May 2014 8:15] MySQL Verification Team
Hello Jeremy,

Thank you for the report.

Thanks,
Umesh
[10 May 2014 8:16] MySQL Verification Team
// Changing category to doc
[10 Jun 2014 19:59] Daniel Price
The mysql_init documentation has been updated. The revised content should appear soon, with the next published documentation build.

http://dev.mysql.com/doc/refman/4.1/en/mysql-init.html
http://dev.mysql.com/doc/refman/5.0/en/mysql-init.html
http://dev.mysql.com/doc/refman/5.1/en/mysql-init.html
http://dev.mysql.com/doc/refman/5.5/en/mysql-init.html
http://dev.mysql.com/doc/refman/5.6/en/mysql-init.html
http://dev.mysql.com/doc/refman/5.7/en/mysql-init.html

Thank you for the bug report.