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,13 +6956,14 @@ ha_innobase::store_lock(
< TL_WRITE_CONCURRENT_INSERT.
We especially allow multiple writers if MySQL is at the
start of a stored procedure call (SQLCOM_CALL)
(MySQL does have thd->in_lock_tables TRUE there). */
start of a stored procedure call (SQLCOM_CALL) or a
stored function call (MySQL does have thd->in_lock_tables
TRUE there). */
if ((lock_type >= TL_WRITE_CONCURRENT_INSERT
&& lock_type <= TL_WRITE)
&& (!thd->in_lock_tables
|| thd->lex->sql_command == SQLCOM_CALL)
&& !(thd->in_lock_tables
&& thd->lex->sql_command == SQLCOM_LOCK_TABLES)
&& !thd->tablespace_op
&& thd->lex->sql_command != SQLCOM_TRUNCATE
&& thd->lex->sql_command != SQLCOM_OPTIMIZE
......
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