diff options
author | unknown <sanja@askmonty.org> | 2010-02-01 08:14:12 +0200 |
---|---|---|
committer | unknown <sanja@askmonty.org> | 2010-02-01 08:14:12 +0200 |
commit | e5099a2c85468d01d084b1071f724bc20766271d (patch) | |
tree | 50e180dfcaa058cefb382d2ab931592cddbd007d /sql/sql_insert.cc | |
parent | f83113df07d6ef8e8a6d1db8f6dc3bb90fb0652a (diff) | |
parent | e9bce6c9d4bde35306b845e22e9b5ada69c4512f (diff) | |
download | mariadb-git-e5099a2c85468d01d084b1071f724bc20766271d.tar.gz |
merge 5.1->5.2
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r-- | sql/sql_insert.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 0ab18290eda..65b99a375db 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -524,6 +524,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); |