summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2012-08-24 12:32:46 +0200
committerunknown <knielsen@knielsen-hq.org>2012-08-24 12:32:46 +0200
commit96703a63da2211cefcc480fa4f135acd94743622 (patch)
treea95df690fd2ca5cf82947213f2da5ad653fc26c1 /sql/sql_table.cc
parent60561ae6133cf40f4fc445e1d6e8f395a20b2573 (diff)
parentcdeabcfd436c65e0a97e74b1722d0259ba907541 (diff)
downloadmariadb-git-96703a63da2211cefcc480fa4f135acd94743622.tar.gz
Merge from 5.1.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc21
1 files changed, 11 insertions, 10 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 2563f923730..6b709915283 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1939,6 +1939,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
for (table= tables; table; table= table->next_local)
{
char *db=table->db;
+ size_t db_length= table->db_length;
handlerton *table_type;
enum legacy_db_type frm_db_type= DB_TYPE_UNKNOWN;
@@ -1961,14 +1962,14 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
built_tmp_query.append("DROP TEMPORARY TABLE IF EXISTS ");
}
- built_tmp_query.append("`");
if (thd->db == NULL || strcmp(db,thd->db) != 0)
{
- built_tmp_query.append(db);
- built_tmp_query.append("`.`");
+ append_identifier(thd, &built_tmp_query, db, db_length);
+ built_tmp_query.append(".");
}
- built_tmp_query.append(table->table_name);
- built_tmp_query.append("`,");
+ append_identifier(thd, &built_tmp_query, table->table_name,
+ table->table_name_length);
+ built_tmp_query.append(",");
}
continue;
@@ -1994,15 +1995,15 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
Don't write the database name if it is the current one (or if
thd->db is NULL).
*/
- built_query.append("`");
if (thd->db == NULL || strcmp(db,thd->db) != 0)
{
- built_query.append(db);
- built_query.append("`.`");
+ append_identifier(thd, &built_query, db, db_length);
+ built_query.append(".");
}
- built_query.append(table->table_name);
- built_query.append("`,");
+ append_identifier(thd, &built_query, table->table_name,
+ table->table_name_length);
+ built_query.append(",");
}
if (!drop_temporary)