Commit f4b08897 authored by Jimmy Yang's avatar Jimmy Yang

Fix Bug #55382 Assignment with SELECT expressions takes unexpected S locks

in READ COMMITTED

rb://410 Approved by Sunny Bains
parent a95441c0
...@@ -7814,16 +7814,17 @@ ha_innobase::store_lock( ...@@ -7814,16 +7814,17 @@ ha_innobase::store_lock(
&& (lock_type == TL_READ || lock_type == TL_READ_NO_INSERT) && (lock_type == TL_READ || lock_type == TL_READ_NO_INSERT)
&& (sql_command == SQLCOM_INSERT_SELECT && (sql_command == SQLCOM_INSERT_SELECT
|| sql_command == SQLCOM_UPDATE || sql_command == SQLCOM_UPDATE
|| sql_command == SQLCOM_CREATE_TABLE)) { || sql_command == SQLCOM_CREATE_TABLE
|| sql_command == SQLCOM_SET_OPTION)) {
/* If we either have innobase_locks_unsafe_for_binlog /* If we either have innobase_locks_unsafe_for_binlog
option set or this session is using READ COMMITTED option set or this session is using READ COMMITTED
isolation level and isolation level of the transaction isolation level and isolation level of the transaction
is not set to serializable and MySQL is doing is not set to serializable and MySQL is doing
INSERT INTO...SELECT or UPDATE ... = (SELECT ...) or INSERT INTO...SELECT or UPDATE ... = (SELECT ...) or
CREATE ... SELECT... without FOR UPDATE or CREATE ... SELECT... or SET ... = (SELECT ...)
IN SHARE MODE in select, then we use consistent without FOR UPDATE or IN SHARE MODE in select,
read for select. */ then we use consistent read for select. */
prebuilt->select_lock_type = LOCK_NONE; prebuilt->select_lock_type = LOCK_NONE;
prebuilt->stored_select_lock_type = LOCK_NONE; prebuilt->stored_select_lock_type = LOCK_NONE;
......
2010-08-01 The InnoDB Team
* handler/ha_innodb.cc
Fix Bug #55382 Assignment with SELECT expressions takes unexpected
S locks in READ COMMITTED
2010-07-27 The InnoDB Team 2010-07-27 The InnoDB Team
* include/mem0pool.h, mem/mem0mem.c, mem/mem0pool.c, srv/srv0start.c: * include/mem0pool.h, mem/mem0mem.c, mem/mem0pool.c, srv/srv0start.c:
......
...@@ -9235,7 +9235,8 @@ ha_innobase::store_lock( ...@@ -9235,7 +9235,8 @@ ha_innobase::store_lock(
&& (sql_command == SQLCOM_INSERT_SELECT && (sql_command == SQLCOM_INSERT_SELECT
|| sql_command == SQLCOM_REPLACE_SELECT || sql_command == SQLCOM_REPLACE_SELECT
|| sql_command == SQLCOM_UPDATE || sql_command == SQLCOM_UPDATE
|| sql_command == SQLCOM_CREATE_TABLE)) { || sql_command == SQLCOM_CREATE_TABLE
|| sql_command == SQLCOM_SET_OPTION)) {
/* If we either have innobase_locks_unsafe_for_binlog /* If we either have innobase_locks_unsafe_for_binlog
option set or this session is using READ COMMITTED option set or this session is using READ COMMITTED
...@@ -9243,9 +9244,9 @@ ha_innobase::store_lock( ...@@ -9243,9 +9244,9 @@ ha_innobase::store_lock(
is not set to serializable and MySQL is doing is not set to serializable and MySQL is doing
INSERT INTO...SELECT or REPLACE INTO...SELECT INSERT INTO...SELECT or REPLACE INTO...SELECT
or UPDATE ... = (SELECT ...) or CREATE ... or UPDATE ... = (SELECT ...) or CREATE ...
SELECT... without FOR UPDATE or IN SHARE SELECT... or SET ... = (SELECT ...) without
MODE in select, then we use consistent read FOR UPDATE or IN SHARE MODE in select,
for select. */ then we use consistent read for select. */
prebuilt->select_lock_type = LOCK_NONE; prebuilt->select_lock_type = LOCK_NONE;
prebuilt->stored_select_lock_type = LOCK_NONE; prebuilt->stored_select_lock_type = LOCK_NONE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment