summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-01-15 17:27:55 +0200
committerMichael Widenius <monty@askmonty.org>2010-01-15 17:27:55 +0200
commitd8ecbbe63471f958aa70443545b63d88d2db0230 (patch)
tree32a6f432080d9125b3619f8935eb5b1de00e861d /sql/sql_insert.cc
parentd121e6630519a66eec7c953ee0eae623f592ce87 (diff)
parent6d69089845ed4c50df0ca8136a2cdacb8f2e1380 (diff)
downloadmariadb-git-d8ecbbe63471f958aa70443545b63d88d2db0230.tar.gz
Merge with MySQL 5.1.42
- Marked a couple of tests with --big - Fixed xtradb/handler/ha_innodb.cc to call explain_filename() storage/xtradb/handler/ha_innodb.cc: Call explain_filename() to get proper names for partitioned tables
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 8b78114716a..dfef1364a3f 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -521,6 +521,22 @@ bool open_and_lock_for_insert_delayed(THD *thd, TABLE_LIST *table_list)
DBUG_ENTER("open_and_lock_for_insert_delayed");
#ifndef EMBEDDED_LIBRARY
+ if (thd->locked_tables && thd->global_read_lock)
+ {
+ /*
+ If this connection has the global read lock, the handler thread
+ will not be able to lock the table. It will wait for the global
+ read lock to go away, but this will never happen since the
+ connection thread will be stuck waiting for the handler thread
+ to open and lock the table.
+ If we are not in locked tables mode, INSERT will seek protection
+ against the global read lock (and fail), thus we will only get
+ to this point in locked tables mode.
+ */
+ my_error(ER_CANT_UPDATE_WITH_READLOCK, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+
if (delayed_get_table(thd, table_list))
DBUG_RETURN(TRUE);