mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
Bug#17429677:LAST ARGUMENT OF LOAD DATA ...SET ...STATEMENT
REPEATED TWICE IN BINLOG Problem: ======= If LOAD DATA ... SET ... is used the last argument of SET is repeated twice in replication binlog. Analysis: ======== LOAD DATA statements are reconstructed once again before they are written to the binary log. When SET clauses are specified as part of LOAD DATA statement, these SET clause user command strings need to be stored in order to rebuild the original user command. During parsing each column and the value in the SET command are stored in two differenet lists. All the values are stored in a string list. When SET expression has more than one value as shown in the following example: SET a = @a, b = CONCAT(@b, '| 123456789'); Parser extracts values in the following manner i.e Item name , value string, actual length of the value of the item with in the string. Item a: Value for a:"= @a, b = CONCAT(@b, '| 123456789') str_length = 4 Item b: Value for b:"= CONCAT(@b, '| 123456789') str_length = 27 During reconstructing the LOAD DATA command the above strings are retrived as it is and appended to the LOAD DATA statement. Hence it becomes as shown below. SET `a`= @a, b = CONCAT(@b, '| 123456789'), `b`= CONCAT(@b, '| 123456789') Fix: === During reconstruction of SET command, retrieve exact item value string rather than reading the entire string.
This commit is contained in:
parent
e360311e05
commit
bdb62daaf0
1 changed files with 8 additions and 0 deletions
|
@ -738,8 +738,16 @@ static bool write_execute_load_query_log_event(THD *thd, sql_exchange* ex,
|
|||
if (n++)
|
||||
pfields.append(", ");
|
||||
append_identifier(thd, &pfields, item->name, strlen(item->name));
|
||||
// Extract exact Item value
|
||||
str->copy();
|
||||
pfields.append((char *)str->ptr());
|
||||
str->free();
|
||||
}
|
||||
/*
|
||||
Clear the SET string list once the SET command is reconstructed
|
||||
as we donot require the list anymore.
|
||||
*/
|
||||
thd->lex->load_set_str_list.empty();
|
||||
}
|
||||
|
||||
p= pfields.c_ptr_safe();
|
||||
|
|
Loading…
Reference in a new issue