Deadlock between CREATE/DROP FUNCTION and SELECT from view

Description

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

mtr test case:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 # 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.

Environment

None

Status

Assignee

Sergey Vojtovich

Reporter

Sergey Vojtovich

Labels

None

External issue ID

None

External issue ID

None

Fix versions

Affects versions

5.5.35

Priority

Major
Configure