1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

BUG#14548159: NUMEROUS CASES OF INCORRECT IDENTIFIER

QUOTING IN REPLICATION 

Problem: Misquoting or unquoted identifiers may lead to
incorrect statements to be logged to the binary log.

Fix: we use specialized functions to append quoted identifiers in
the statements generated by the server.
This commit is contained in:
Rohit Kalhans
2012-09-22 17:50:51 +05:30
parent f820334bbf
commit 5530c5e38d
23 changed files with 830 additions and 660 deletions

View File

@@ -3426,16 +3426,16 @@ int select_create::write_to_binlog(bool is_trans, int errcode)
if (thd->lex->create_select_in_comment)
query.append(STRING_WITH_LEN("/*! "));
if (thd->lex->ignore)
query.append(STRING_WITH_LEN("INSERT IGNORE INTO `"));
query.append(STRING_WITH_LEN("INSERT IGNORE INTO "));
else if (thd->lex->duplicates == DUP_REPLACE)
query.append(STRING_WITH_LEN("REPLACE INTO `"));
query.append(STRING_WITH_LEN("REPLACE INTO "));
else
query.append(STRING_WITH_LEN("INSERT INTO `"));
query.append(STRING_WITH_LEN("INSERT INTO "));
query.append(create_table->db, db_len);
query.append(STRING_WITH_LEN("`.`"));
query.append(create_info->alias, table_len);
query.append(STRING_WITH_LEN("` "));
append_identifier(thd, &query, create_table->db, db_len);
query.append(STRING_WITH_LEN("."));
append_identifier(thd, &query, create_info->alias, table_len );
query.append(STRING_WITH_LEN(" "));
/*
The insert items.
@@ -3447,9 +3447,8 @@ int select_create::write_to_binlog(bool is_trans, int errcode)
if (f != field)
query.append(STRING_WITH_LEN(","));
query.append(STRING_WITH_LEN("`"));
query.append((*f)->field_name, strlen((*f)->field_name));
query.append(STRING_WITH_LEN("`"));
append_identifier(thd, &query, (*f)->field_name,
strlen((*f)->field_name));
}
query.append(STRING_WITH_LEN(") "));