summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r--sql/sql_prepare.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index ecf01824755..1dc46aef4da 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -897,8 +897,12 @@ static int mysql_test_insert(Prepared_statement *stmt,
/*
open temporary memory pool for temporary data allocated by derived
tables & preparation procedure
+ Note that this is done without locks (should not be needed as we will not
+ access any data here)
+ If we would use locks, then we have to ensure we are not using
+ TL_WRITE_DELAYED as having two such locks can cause table corruption.
*/
- if (open_and_lock_tables(thd, table_list))
+ if (open_normal_and_derived_tables(thd, table_list))
{
DBUG_RETURN(-1);
}