mirror of
https://github.com/MariaDB/server.git
synced 2026-05-05 14:45:31 +02:00
Bug #45058 init_available_charsets uses double checked locking
A client doing multiple mysql_library_init() and mysql_library_end() calls over the lifetime of the process may experience lost character set data, potentially even a SIGSEGV. This patch reinstates the reloading of character set data when a mysql_library_init() is done after a mysql_library_end().
This commit is contained in:
parent
ca6691533a
commit
600a283689
5 changed files with 9 additions and 1 deletions
|
|
@ -427,6 +427,11 @@ static void init_available_charsets(void)
|
|||
}
|
||||
|
||||
|
||||
void free_charsets(void)
|
||||
{
|
||||
charsets_initialized= MY_PTHREAD_ONCE_INIT;
|
||||
}
|
||||
|
||||
uint get_collation_number(const char *name)
|
||||
{
|
||||
my_pthread_once(&charsets_initialized, init_available_charsets);
|
||||
|
|
|
|||
|
|
@ -165,6 +165,7 @@ void my_end(int infoflag)
|
|||
my_print_open_files();
|
||||
}
|
||||
}
|
||||
free_charsets();
|
||||
my_error_unregister_all();
|
||||
my_once_free();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue