diff options
author | Rohit Kalhans <rohit.kalhans@oracle.com> | 2012-09-22 18:07:04 +0530 |
---|---|---|
committer | Rohit Kalhans <rohit.kalhans@oracle.com> | 2012-09-22 18:07:04 +0530 |
commit | 4802faad3f67e5950858c2eba04271d836c1edb1 (patch) | |
tree | e8c9feb9d583b378ecdda8db05f6871ea6cefdbd /sql/ha_ndbcluster_binlog.cc | |
parent | 02ee112f9ab9d8451755df35a1c3edc9bb3fd75e (diff) | |
parent | 5530c5e38dbefac8e5d2c333c0f35ed9f73946a4 (diff) | |
download | mariadb-git-4802faad3f67e5950858c2eba04271d836c1edb1.tar.gz |
upmerge to bug#14548159
Diffstat (limited to 'sql/ha_ndbcluster_binlog.cc')
-rw-r--r-- | sql/ha_ndbcluster_binlog.cc | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index 040b5778dbd..0f037040902 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -25,6 +25,7 @@ #include "rpl_injector.h" #include "rpl_filter.h" #include "slave.h" +#include "log_event.h" #include "ha_ndbcluster_binlog.h" #include "NdbDictionary.hpp" #include "ndb_cluster_connection.hpp" @@ -1297,6 +1298,11 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share, } char tmp_buf2[FN_REFLEN]; + char quoted_table1[2 + 2 * FN_REFLEN + 1]; + char quoted_db1[2 + 2 * FN_REFLEN + 1]; + char quoted_db2[2 + 2 * FN_REFLEN + 1]; + char quoted_table2[2 + 2 * FN_REFLEN + 1]; + int id_length= 0; const char *type_str; switch (type) { @@ -1306,16 +1312,31 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share, DBUG_RETURN(0); /* redo the drop table query as is may contain several tables */ query= tmp_buf2; - query_length= (uint) (strxmov(tmp_buf2, "drop table `", - table_name, "`", NullS) - tmp_buf2); + id_length= my_strmov_quoted_identifier (thd, (char *) quoted_table1, + table_name, 0); + quoted_table1[id_length]= '\0'; + query_length= (uint) (strxmov(tmp_buf2, "drop table ", + quoted_table1, NullS) - tmp_buf2); type_str= "drop table"; break; case SOT_RENAME_TABLE: /* redo the rename table query as is may contain several tables */ query= tmp_buf2; - query_length= (uint) (strxmov(tmp_buf2, "rename table `", - db, ".", table_name, "` to `", - new_db, ".", new_table_name, "`", NullS) - tmp_buf2); + id_length= my_strmov_quoted_identifier (thd, (char *) quoted_db1, + db, 0); + quoted_db1[id_length]= '\0'; + id_length= my_strmov_quoted_identifier (thd, (char *) quoted_table1, + table_name, 0); + quoted_table1[id_length]= '\0'; + id_length= my_strmov_quoted_identifier (thd, (char *) quoted_db2, + new_db, 0); + quoted_db2[id_length]= '\0'; + id_length= my_strmov_quoted_identifier (thd, (char *) quoted_table2, + new_table_name, 0); + quoted_table2[id_length]= '\0'; + query_length= (uint) (strxmov(tmp_buf2, "rename table ", + quoted_db1, ".", quoted_table_1, " to ", + quoted_db2, ".", quoted_table2, NullS) - tmp_buf2); type_str= "rename table"; break; case SOT_CREATE_TABLE: |