summaryrefslogtreecommitdiff
path: root/sql/sql_truncate.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@skysql.com>2014-04-08 10:36:34 -0400
committerNirbhay Choubey <nirbhay@skysql.com>2014-04-08 10:36:34 -0400
commit421326310168e2b0a83eddcf9520336e1d58ea42 (patch)
tree9ec49ac74c451cf03581a619eb92a7afae1c5eef /sql/sql_truncate.cc
parent9d2e90f379654fb65c0eab006213d772302bcff7 (diff)
parent41a2ca5c16636c12d5c2adce70ec7ddb7a2fc711 (diff)
downloadmariadb-git-421326310168e2b0a83eddcf9520336e1d58ea42.tar.gz
Merging mariadb-10.0.10.
* bzr merge -rtag:mariadb-10.0.10 maria/10.0.
Diffstat (limited to 'sql/sql_truncate.cc')
-rw-r--r--sql/sql_truncate.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc
index fd2d20c1813..c7981ae36d5 100644
--- a/sql/sql_truncate.cc
+++ b/sql/sql_truncate.cc
@@ -192,7 +192,7 @@ int Sql_cmd_truncate_table::handler_truncate(THD *thd, TABLE_LIST *table_ref,
bool is_tmp_table)
{
int error= 0;
- uint flags;
+ uint flags= 0;
DBUG_ENTER("Sql_cmd_truncate_table::handler_truncate");
/*
@@ -259,6 +259,7 @@ static bool recreate_temporary_table(THD *thd, TABLE *table)
bool error= TRUE;
TABLE_SHARE *share= table->s;
handlerton *table_type= table->s->db_type();
+ TABLE *new_table;
DBUG_ENTER("recreate_temporary_table");
table->file->info(HA_STATUS_AUTO | HA_STATUS_NO_LOCK);
@@ -269,11 +270,13 @@ static bool recreate_temporary_table(THD *thd, TABLE *table)
dd_recreate_table(thd, share->db.str, share->table_name.str,
share->normalized_path.str);
- if (open_table_uncached(thd, table_type, share->path.str, share->db.str,
- share->table_name.str, true, true))
+ if ((new_table= open_table_uncached(thd, table_type, share->path.str,
+ share->db.str,
+ share->table_name.str, true, true)))
{
error= FALSE;
thd->thread_specific_used= TRUE;
+ new_table->s->table_creation_was_logged= share->table_creation_was_logged;
}
else
rm_temporary_table(table_type, share->path.str);