summaryrefslogtreecommitdiff
path: root/sql/sql_truncate.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-05-04 22:00:24 +0200
committerSergei Golubchik <serg@mariadb.org>2015-05-04 22:00:24 +0200
commit49c853fb948aeaeb5c7e3f02da3f14da51ee4100 (patch)
tree8c3d487a02209cc0c6f126144f1340fc5897d527 /sql/sql_truncate.cc
parentae18a28500974351cf42fa3cac67c83e0647d510 (diff)
parent4c87f727734955f9e4a0ffde25aae4d43ec0b2a5 (diff)
downloadmariadb-git-49c853fb948aeaeb5c7e3f02da3f14da51ee4100.tar.gz
Merge branch '5.5' into 10.0
Diffstat (limited to 'sql/sql_truncate.cc')
-rw-r--r--sql/sql_truncate.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc
index fe2ea02a8e2..05869b70c8f 100644
--- a/sql/sql_truncate.cc
+++ b/sql/sql_truncate.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2010, 2014, Oracle and/or its affiliates.
- Copyright (c) 2013, 2014, SkySQL Ab.
+/* Copyright (c) 2010, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -283,6 +283,12 @@ static bool recreate_temporary_table(THD *thd, TABLE *table)
table->file->info(HA_STATUS_AUTO | HA_STATUS_NO_LOCK);
+ /*
+ If LOCK TABLES list is not empty and contains this table
+ then unlock the table and remove it from this list.
+ */
+ mysql_lock_remove(thd, thd->lock, table);
+
/* Don't free share. */
close_temporary_table(thd, table, FALSE, FALSE);