Uploaded image for project: 'MariaDB Server'
  1. MDEV-5616

Deadlock between CREATE/DROP FUNCTION and SELECT from view

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects versions: 5.5.35
    • Fix versions: 5.5.36
    • Components: None
    • Labels:
      None
    • Sprint:

      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.

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                svoj Sergey Vojtovich
                Reporter:
                svoj Sergey Vojtovich
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: