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/sql_load.cc | |
parent | 02ee112f9ab9d8451755df35a1c3edc9bb3fd75e (diff) | |
parent | 5530c5e38dbefac8e5d2c333c0f35ed9f73946a4 (diff) | |
download | mariadb-git-4802faad3f67e5950858c2eba04271d836c1edb1.tar.gz |
upmerge to bug#14548159
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r-- | sql/sql_load.cc | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 1819102aa34..611c32696ea 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -38,7 +38,7 @@ #include "sql_repl.h" #include "sp_head.h" #include "sql_trigger.h" - +#include "sql_show.h" class XML_TAG { public: int level; @@ -678,23 +678,20 @@ static bool write_execute_load_query_log_event(THD *thd, sql_exchange* ex, const char *tbl= table_name_arg; const char *tdb= (thd->db != NULL ? thd->db : db_arg); String string_buf; - - if (!thd->db || strcmp(db_arg, thd->db)) + if (!thd->db || strcmp(db_arg, thd->db)) { /* - If used database differs from table's database, - prefix table name with database name so that it + If used database differs from table's database, + prefix table name with database name so that it becomes a FQ name. */ string_buf.set_charset(system_charset_info); - string_buf.append(db_arg); - string_buf.append("`"); + append_identifier(thd, &string_buf, db_arg, strlen(db_arg)); string_buf.append("."); - string_buf.append("`"); - string_buf.append(table_name_arg); - tbl= string_buf.c_ptr_safe(); } - + append_identifier(thd, &string_buf, table_name_arg, + strlen(table_name_arg)); + tbl= string_buf.c_ptr_safe(); Load_log_event lle(thd, ex, tdb, tbl, fv, is_concurrent, duplicates, ignore, transactional_table); @@ -719,11 +716,7 @@ static bool write_execute_load_query_log_event(THD *thd, sql_exchange* ex, if (n++) pfields.append(", "); if (item->type() == Item::FIELD_ITEM) - { - pfields.append("`"); - pfields.append(item->name); - pfields.append("`"); - } + append_identifier(thd, &pfields, item->name, strlen(item->name)); else item->print(&pfields, QT_ORDINARY); } @@ -743,9 +736,7 @@ static bool write_execute_load_query_log_event(THD *thd, sql_exchange* ex, val= lv++; if (n++) pfields.append(", "); - pfields.append("`"); - pfields.append(item->name); - pfields.append("`"); + append_identifier(thd, &pfields, item->name, strlen(item->name)); pfields.append(val->name); } } |