summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster.cc
diff options
context:
space:
mode:
authorunknown <stewart@flamingspork.com[stewart]>2007-06-30 18:02:38 +1000
committerunknown <stewart@flamingspork.com[stewart]>2007-06-30 18:02:38 +1000
commit60f3384c0ec394b1ce2e3e7f22a4ef10df38fcd6 (patch)
treeaa7113d9533e78438905ee20bccfb5cc8722f4a9 /sql/ha_ndbcluster.cc
parent0a65e6669fafb1b926c75dab29472a1633b38254 (diff)
downloadmariadb-git-60f3384c0ec394b1ce2e3e7f22a4ef10df38fcd6.tar.gz
[PATCH] BUG#27404 util thd mysql_parse sig11 when mysqld default multibyte charset
NDB util thread calls mysql_parse internally with plain old c strings (7bit ascii) to create tables (e.g. mysql.ndb_schema). With mysqld default charset set to a multibyte one (e.g. ucs2) mysql_parse would try to interpret the 7bit string as UCS2 and promptly explode in a heap. Solution is to set the util thread to be using utf8 charset. Index: ndb-work/sql/ha_ndbcluster.cc =================================================================== sql/ha_ndbcluster.cc: BUG#27404 util thd mysql_parse sig11 when mysqld default multibyte charset
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r--sql/ha_ndbcluster.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index edbb22c612e..bb5b84da525 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -8947,6 +8947,14 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
thd->main_security_ctx.priv_user = 0;
thd->current_stmt_binlog_row_based= TRUE; // If in mixed mode
+ CHARSET_INFO *charset_connection;
+ charset_connection= get_charset_by_csname("utf8",
+ MY_CS_PRIMARY, MYF(MY_WME));
+ thd->variables.character_set_client= charset_connection;
+ thd->variables.character_set_results= charset_connection;
+ thd->variables.collation_connection= charset_connection;
+ thd->update_charset();
+
/* Signal successful initialization */
ndb_util_thread_running= 1;
pthread_cond_signal(&COND_ndb_util_ready);