summaryrefslogtreecommitdiff
blob: 69ea2a3c139e79e5030122ebc0ae8c13b9dff35f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
This patch is for testing only, it's proposed by upstream MySQL.

MySQL-Bug-URL: http://bugs.mysql.com/bug.php?id=45058
MySQL-Bug: 45058

=== modified file 'include/my_sys.h'
--- include/my_sys.h	2009-12-12 18:11:25 +0000
+++ include/my_sys.h	2010-02-23 01:58:03 +0000
@@ -950,7 +950,7 @@ extern my_bool resolve_charset(const cha
 extern my_bool resolve_collation(const char *cl_name,
                                  CHARSET_INFO *default_cl,
                                  CHARSET_INFO **cl);
-
+extern void free_charsets(void);
 extern char *get_charsets_dir(char *buf);
 extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
 extern my_bool init_compiled_charsets(myf flags);

=== modified file 'libmysql/libmysql.c'
--- libmysql/libmysql.c	2009-12-18 18:44:24 +0000
+++ libmysql/libmysql.c	2010-02-23 01:58:23 +0000
@@ -211,6 +211,7 @@ void STDCALL mysql_server_end()
   }
   else
   {
+    free_charsets();
     mysql_thread_end();
   }
 

=== modified file 'mysys/charset.c'
--- mysys/charset.c	2009-12-15 09:48:29 +0000
+++ mysys/charset.c	2010-02-23 01:59:13 +0000
@@ -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);

=== modified file 'mysys/my_init.c'
--- mysys/my_init.c	2009-12-12 18:11:25 +0000
+++ mysys/my_init.c	2010-02-23 01:59:31 +0000
@@ -165,6 +165,7 @@ void my_end(int infoflag)
       my_print_open_files();
     }
   }
+  free_charsets();
   my_error_unregister_all();
   my_once_free();
 

=== modified file 'sql/mysqld.cc'
--- sql/mysqld.cc	2010-02-05 12:55:20 +0000
+++ sql/mysqld.cc	2010-02-23 01:59:49 +0000
@@ -1287,6 +1287,7 @@ void clean_up(bool print_message)
   lex_free();				/* Free some memory */
   item_create_cleanup();
   set_var_free();
+  free_charsets();
   if (!opt_noacl)
   {
 #ifdef HAVE_DLOPEN