mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Manual merge from mysql-trunk-merge.
Conflicts: - extra/comp_err.c - mysql-test/collections/default.experimental - mysql-test/r/archive.result - mysql-test/r/select.result - mysql-test/suite/binlog/r/binlog_unsafe.result - mysql-test/suite/binlog/t/binlog_unsafe.test - mysql-test/suite/rpl/t/disabled.def - mysql-test/t/archive.test - mysql-test/t/select.test - sql/item.cc - sql/item.h - sql/item_timefunc.cc - sql/sql_base.cc - sql/sql_delete.cc - sql/sql_load.cc - sql/sql_partition.cc - sql/sql_table.cc - storage/innobase/handler/ha_innodb.cc - vio/vio.c
This commit is contained in:
@ -518,6 +518,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);
|
||||
|
||||
|
Reference in New Issue
Block a user