Bug #12109 possible locking bug in init_available_charset
Submitted: 22 Jul 2005 13:31 Modified: 6 Aug 2005 22:34
Reporter: Alexander Barkov Email Updates:
Status: Closed Impact on me:
Category:MySQL Server Severity:S3 (Non-critical)
Version: OS:
Assigned to: Alexander Barkov CPU Architecture:Any

[22 Jul 2005 13:31] Alexander Barkov
From a user's letter:
>Reading the mysql code, I found some buggy locking code in init_available_charsets().
>The code fails to recheck the value of charset_initialized once it acquires THR_LOCK_charset,
> so it is possible for a second thread to reinitialize the charset info while a first thread is  accessing it.

How to repeat:
see code
[25 Jul 2005 16:33] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

[28 Jul 2005 3:35] Alexander Barkov
Reviewed by Sinisa.

Fixed in 4.1.14 and 5.0.11
[6 Aug 2005 22:34] Mike Hillyer
Documented in 4.1.14 and 5.0.11 changelogs:

 Two threads could potentially initialize different characters sets and overwrite each other. (Bug #12109)