summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
diff options
context:
space:
mode:
authorRohit Kalhans <rohit.kalhans@oracle.com>2012-09-22 18:07:04 +0530
committerRohit Kalhans <rohit.kalhans@oracle.com>2012-09-22 18:07:04 +0530
commit4802faad3f67e5950858c2eba04271d836c1edb1 (patch)
treee8c9feb9d583b378ecdda8db05f6871ea6cefdbd /sql/sql_load.cc
parent02ee112f9ab9d8451755df35a1c3edc9bb3fd75e (diff)
parent5530c5e38dbefac8e5d2c333c0f35ed9f73946a4 (diff)
downloadmariadb-git-4802faad3f67e5950858c2eba04271d836c1edb1.tar.gz
upmerge to bug#14548159
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r--sql/sql_load.cc29
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);
}
}