Commit 675d29fe authored by jan's avatar jan

Forward port r315 from branches/5.0:

Fix a bug #18077 InnoDB uses full explicit table locks in
stored FUNCTION.
parent 8f6fdc86
...@@ -6956,17 +6956,18 @@ ha_innobase::store_lock( ...@@ -6956,17 +6956,18 @@ ha_innobase::store_lock(
< TL_WRITE_CONCURRENT_INSERT. < TL_WRITE_CONCURRENT_INSERT.
We especially allow multiple writers if MySQL is at the We especially allow multiple writers if MySQL is at the
start of a stored procedure call (SQLCOM_CALL) start of a stored procedure call (SQLCOM_CALL) or a
(MySQL does have thd->in_lock_tables TRUE there). */ stored function call (MySQL does have thd->in_lock_tables
TRUE there). */
if ((lock_type >= TL_WRITE_CONCURRENT_INSERT if ((lock_type >= TL_WRITE_CONCURRENT_INSERT
&& lock_type <= TL_WRITE) && lock_type <= TL_WRITE)
&& (!thd->in_lock_tables && !(thd->in_lock_tables
|| thd->lex->sql_command == SQLCOM_CALL) && thd->lex->sql_command == SQLCOM_LOCK_TABLES)
&& !thd->tablespace_op && !thd->tablespace_op
&& thd->lex->sql_command != SQLCOM_TRUNCATE && thd->lex->sql_command != SQLCOM_TRUNCATE
&& thd->lex->sql_command != SQLCOM_OPTIMIZE && thd->lex->sql_command != SQLCOM_OPTIMIZE
&& thd->lex->sql_command != SQLCOM_CREATE_TABLE) { && thd->lex->sql_command != SQLCOM_CREATE_TABLE) {
lock_type = TL_WRITE_ALLOW_WRITE; lock_type = TL_WRITE_ALLOW_WRITE;
} }
......
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