diff options
author | unknown <heikki@hundin.mysql.fi> | 2003-01-21 00:44:49 +0200 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2003-01-21 00:44:49 +0200 |
commit | 71651eb6089c3a6b9c75dbe8f18f5e46bb45ce42 (patch) | |
tree | 84af559fc47937c885fbc105cc231958c543e002 /sql | |
parent | 3da6bfe954e595a1836a10982b194c759a786dbe (diff) | |
download | mariadb-git-71651eb6089c3a6b9c75dbe8f18f5e46bb45ce42.tar.gz |
ha_innobase.cc:
Backport from 4.0: convert TL_READ_NO_INSERT to TL_READ to allow concurrent inserts to the table in INSERT INTO ... SELECT ... FROM table
sql/ha_innobase.cc:
Backport from 4.0: convert TL_READ_NO_INSERT to TL_READ to allow concurrent inserts to the table in INSERT INTO ... SELECT ... FROM table
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_innobase.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc index 19ec6a9bb06..7045e5c31d5 100644 --- a/sql/ha_innobase.cc +++ b/sql/ha_innobase.cc @@ -3718,6 +3718,16 @@ ha_innobase::store_lock( lock_type = TL_WRITE_ALLOW_WRITE; } + /* In queries of type INSERT INTO t1 SELECT ... FROM t2 ... + MySQL would use the lock TL_READ_NO_INSERT on t2, and that + would conflict with TL_WRITE_ALLOW_WRITE, blocking all inserts + to t2. Convert the lock to a normal read lock to allow + concurrent inserts to t2. */ + + if (lock_type == TL_READ_NO_INSERT && !thd->in_lock_tables) { + lock_type = TL_READ; + } + lock.type=lock_type; } |