diff options
Diffstat (limited to 'sql/wsrep_mysqld.cc')
-rw-r--r-- | sql/wsrep_mysqld.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 64fa8db26fc..b953854479d 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -2130,11 +2130,14 @@ create_view_query(THD *thd, uchar** buf, size_t* buf_len) LEX_CSTRING *name; int i; + buff.append('('); for (i= 0; (name= names++); i++) { - buff.append(i ? ", " : "("); append_identifier(thd, &buff, name); + buff.append(", ", 2); } + if (i) + buff.length(buff.length()-2); buff.append(')'); } buff.append(STRING_WITH_LEN(" AS ")); @@ -2172,25 +2175,25 @@ static int wsrep_drop_table_query(THD* thd, uchar** buf, size_t* buf_len) if (found_temp_table) { - buff.append("DROP TABLE "); + buff.append(STRING_WITH_LEN("DROP TABLE ")); if (lex->check_exists) - buff.append("IF EXISTS "); + buff.append(STRING_WITH_LEN("IF EXISTS ")); for (TABLE_LIST* table= first_table; table; table= table->next_global) { if (!thd->find_temporary_table(table->db.str, table->table_name.str)) { append_identifier(thd, &buff, table->db.str, table->db.length); - buff.append("."); + buff.append('.'); append_identifier(thd, &buff, table->table_name.str, table->table_name.length); - buff.append(","); + buff.append(','); } } /* Chop the last comma */ buff.chop(); - buff.append(" /* generated by wsrep */"); + buff.append(STRING_WITH_LEN(" /* generated by wsrep */")); WSREP_DEBUG("Rewrote '%s' as '%s'", thd->query(), buff.ptr()); |