mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
BUG#49479: Slave stops with syntax error: LOAD DATA event without
escaped field names When in mixed or statement mode, the master logs LOAD DATA queries by resorting to an Execute_load_query_log_event. This event does not contain the original query, but a rewritten version of it, which includes the table field names. However, the rewrite does not escape the field names. If these names match a reserved keyword, then the slave will stop with a syntax error when executing the event. We fix this by escaping the fields names as it happens already for the table name.
This commit is contained in:
@@ -640,7 +640,11 @@ static bool write_execute_load_query_log_event(THD *thd, sql_exchange* ex,
|
||||
if (n++)
|
||||
pfields.append(", ");
|
||||
if (item->name)
|
||||
{
|
||||
pfields.append("`");
|
||||
pfields.append(item->name);
|
||||
pfields.append("`");
|
||||
}
|
||||
else
|
||||
item->print(&pfields, QT_ORDINARY);
|
||||
}
|
||||
@@ -660,7 +664,9 @@ 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("`");
|
||||
pfields.append("=");
|
||||
val->print(&pfields, QT_ORDINARY);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user