[MDEV-5616] Deadlock between CREATE/DROP FUNCTION and SELECT from view Created: 2014-02-05  Updated: 2014-02-13  Resolved: 2014-02-13

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.35
Fix Version/s: 5.5.36

Type: Bug Priority: Major
Reporter: Sergey Vojtovich Assignee: Sergey Vojtovich
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
PartOf
is part of MDEV-5089 possible deadlocks between rwlocks an... Closed

 Description   

2 threads required to reproduce deadlock:
thread1: CREATE/DROP FUNCTION
thread2: SELECT * FROM view having references to UDF/SP

mtr test case:

# Prepare test
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
CREATE VIEW v1 AS SELECT myfunc_int(1);
 
delimiter |;
CREATE PROCEDURE p_select(x INT)
BEGIN
  DECLARE CONTINUE HANDLER FOR 1126 BEGIN END;
  WHILE x DO
    SET x= x - 1;
    FLUSH TABLES;
    SELECT * FROM v1;
  END WHILE;
END|
delimiter ;|
 
connect(con1, localhost, root,,);
 
# Start test
connection con1;
--send CALL p_select(100)
 
connection default;
 
disable_result_log;
disable_query_log;
let $i= 100;
while ($i)
{
  FLUSH TABLES;
  --replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
  eval CREATE FUNCTION myfunc_double RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
  DROP FUNCTION myfunc_double;
  dec $i;
}
 
# Cleanup
connection con1;
reap;
connection default;
enable_query_log;
enable_result_log;
 
disconnect con1;
DROP PROCEDURE p_select;
DROP VIEW v1;
DROP FUNCTION myfunc_int;

Should not affect 10.0.



 Comments   
Comment by Sergey Vojtovich [ 2014-02-07 ]

Sergei, please review fix for this bug.

Comment by Sergei Golubchik [ 2014-02-13 ]

ok to push

Comment by Sergey Vojtovich [ 2014-02-13 ]

Fixed in 5.5.36, revno: 4066, revision-id: svoj@mariadb.org-20140213124108-tyzdv1v2u8zg2dfu

Generated at Thu Feb 08 07:05:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.