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

Wrong reopen of already open routine due to auto-create in SP

Details

    Description

      Assertion `mdl_request->ticket == __null' fails upon DML causing auto partition creation via function

      --source include/have_partition.inc
       
      CREATE TABLE t (a INT) WITH SYSTEM VERSIONING PARTITION BY SYSTEM_TIME INTERVAL 1 MINUTE AUTO;
      --delimiter $
      CREATE FUNCTION f() RETURNS INT BEGIN REPLACE INTO t SELECT * FROM t; RETURN 0; END $
      --delimiter ;
      SET timestamp= @@timestamp + 61;
      SELECT f();
       
      DROP TABLE t;
      DROP FUNCTION f;
      

      10.11 62bfcfd8b29cb4f2e70dd15155875494ad6a37cf

      mariadbd: /data/bld/10.11-debug/sql/mdl.cc:2063: bool MDL_context::try_acquire_lock_impl(MDL_request*, MDL_ticket**): Assertion `mdl_request->ticket == __null' failed.
      240819 15:09:18 [ERROR] mysqld got signal 6 ;
       
      #9  0x00007fb185253e32 in __GI___assert_fail (assertion=0x56545a2372e4 "mdl_request->ticket == __null", file=0x56545a236cf8 "/data/bld/10.11-debug/sql/mdl.cc", line=2063, function=0x56545a2372a0 "bool MDL_context::try_acquire_lock_impl(MDL_request*, MDL_ticket**)") at ./assert/assert.c:101
      #10 0x00005654594c65a3 in MDL_context::try_acquire_lock_impl (this=0x7fb164000f20, mdl_request=0x7fb164015c78, out_ticket=0x7fb1800fd2f8) at /data/bld/10.11-debug/sql/mdl.cc:2063
      #11 0x00005654594c6ead in MDL_context::acquire_lock (this=0x7fb164000f20, mdl_request=0x7fb164015c78, lock_wait_timeout=86400) at /data/bld/10.11-debug/sql/mdl.cc:2297
      #12 0x000056545920b916 in sp_acquire_mdl (thd=0x7fb164000dc8, rt=0x7fb164015c78, ot_ctx=0x7fb1800fd590) at /data/bld/10.11-debug/sql/sql_base.cc:3704
      #13 0x000056545920baff in open_and_process_routine (thd=0x7fb164000dc8, prelocking_ctx=0x7fb1640051a8, rt=0x7fb164015c78, prelocking_strategy=0x7fb1800fd6a8, has_prelocking_list=true, ot_ctx=0x7fb1800fd590, need_prelocking=0x7fb1800fd526, routine_modifies_data=0x7fb1800fd527) at /data/bld/10.11-debug/sql/sql_base.cc:3781
      #14 0x000056545920dbb9 in open_tables (thd=0x7fb164000dc8, options=..., start=0x7fb1800fd608, counter=0x7fb1800fd624, flags=0, prelocking_strategy=0x7fb1800fd6a8) at /data/bld/10.11-debug/sql/sql_base.cc:4709
      #15 0x000056545920fab4 in open_and_lock_tables (thd=0x7fb164000dc8, options=..., tables=0x7fb164017560, derived=true, flags=0, prelocking_strategy=0x7fb1800fd6a8) at /data/bld/10.11-debug/sql/sql_base.cc:5610
      #16 0x00005654591c244e in open_and_lock_tables (thd=0x7fb164000dc8, tables=0x0, derived=true, flags=0) at /data/bld/10.11-debug/sql/sql_base.h:516
      #17 0x00005654592cee1d in execute_sqlcom_select (thd=0x7fb164000dc8, all_tables=0x0) at /data/bld/10.11-debug/sql/sql_parse.cc:6313
      #18 0x00005654592c5fe8 in mysql_execute_command (thd=0x7fb164000dc8, is_called_from_prepared_stmt=false) at /data/bld/10.11-debug/sql/sql_parse.cc:3988
      #19 0x00005654592d431a in mysql_parse (thd=0x7fb164000dc8, rawbuf=0x7fb164015700 "SELECT f()", length=10, parser_state=0x7fb1800fe370) at /data/bld/10.11-debug/sql/sql_parse.cc:8152
      #20 0x00005654592bf8b1 in dispatch_command (command=COM_QUERY, thd=0x7fb164000dc8, packet=0x7fb16400bc69 "SELECT f()", packet_length=10, blocking=true) at /data/bld/10.11-debug/sql/sql_parse.cc:1895
      #21 0x00005654592be20a in do_command (thd=0x7fb164000dc8, blocking=true) at /data/bld/10.11-debug/sql/sql_parse.cc:1408
      #22 0x00005654594b46cc in do_handle_one_connection (connect=0x56545c9962a8, put_in_cache=true) at /data/bld/10.11-debug/sql/sql_connect.cc:1417
      #23 0x00005654594b4441 in handle_one_connection (arg=0x56545c8ca5c8) at /data/bld/10.11-debug/sql/sql_connect.cc:1319
      #24 0x00005654599f056c in pfs_spawn_thread (arg=0x56545c995e18) at /data/bld/10.11-debug/storage/perfschema/pfs.cc:2201
      #25 0x00007fb1852a8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #26 0x00007fb18532861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      No obvious immediate problem on a non-debug build.

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova created issue -
            julien.fritsch Julien Fritsch made changes -
            Field Original Value New Value
            Fix Version/s 11.5 [ 29506 ]
            midenok Aleksey Midenkov made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            midenok Aleksey Midenkov made changes -
            midenok Aleksey Midenkov made changes -
            Description {code:sql}
            --source include/have_partition.inc

            CREATE TABLE t (a INT) WITH SYSTEM VERSIONING PARTITION BY SYSTEM_TIME INTERVAL 1 MINUTE AUTO;
            --delimiter $
            CREATE FUNCTION f() RETURNS INT BEGIN REPLACE INTO t SELECT * FROM t; RETURN 0; END $
            --delimiter ;
            SET timestamp= @@timestamp + 61;
            SELECT f();

            DROP TABLE t;
            DROP FUNCTION f;
            {code}

            {noformat:title=10.11 62bfcfd8b29cb4f2e70dd15155875494ad6a37cf}
            mariadbd: /data/bld/10.11-debug/sql/mdl.cc:2063: bool MDL_context::try_acquire_lock_impl(MDL_request*, MDL_ticket**): Assertion `mdl_request->ticket == __null' failed.
            240819 15:09:18 [ERROR] mysqld got signal 6 ;

            #9 0x00007fb185253e32 in __GI___assert_fail (assertion=0x56545a2372e4 "mdl_request->ticket == __null", file=0x56545a236cf8 "/data/bld/10.11-debug/sql/mdl.cc", line=2063, function=0x56545a2372a0 "bool MDL_context::try_acquire_lock_impl(MDL_request*, MDL_ticket**)") at ./assert/assert.c:101
            #10 0x00005654594c65a3 in MDL_context::try_acquire_lock_impl (this=0x7fb164000f20, mdl_request=0x7fb164015c78, out_ticket=0x7fb1800fd2f8) at /data/bld/10.11-debug/sql/mdl.cc:2063
            #11 0x00005654594c6ead in MDL_context::acquire_lock (this=0x7fb164000f20, mdl_request=0x7fb164015c78, lock_wait_timeout=86400) at /data/bld/10.11-debug/sql/mdl.cc:2297
            #12 0x000056545920b916 in sp_acquire_mdl (thd=0x7fb164000dc8, rt=0x7fb164015c78, ot_ctx=0x7fb1800fd590) at /data/bld/10.11-debug/sql/sql_base.cc:3704
            #13 0x000056545920baff in open_and_process_routine (thd=0x7fb164000dc8, prelocking_ctx=0x7fb1640051a8, rt=0x7fb164015c78, prelocking_strategy=0x7fb1800fd6a8, has_prelocking_list=true, ot_ctx=0x7fb1800fd590, need_prelocking=0x7fb1800fd526, routine_modifies_data=0x7fb1800fd527) at /data/bld/10.11-debug/sql/sql_base.cc:3781
            #14 0x000056545920dbb9 in open_tables (thd=0x7fb164000dc8, options=..., start=0x7fb1800fd608, counter=0x7fb1800fd624, flags=0, prelocking_strategy=0x7fb1800fd6a8) at /data/bld/10.11-debug/sql/sql_base.cc:4709
            #15 0x000056545920fab4 in open_and_lock_tables (thd=0x7fb164000dc8, options=..., tables=0x7fb164017560, derived=true, flags=0, prelocking_strategy=0x7fb1800fd6a8) at /data/bld/10.11-debug/sql/sql_base.cc:5610
            #16 0x00005654591c244e in open_and_lock_tables (thd=0x7fb164000dc8, tables=0x0, derived=true, flags=0) at /data/bld/10.11-debug/sql/sql_base.h:516
            #17 0x00005654592cee1d in execute_sqlcom_select (thd=0x7fb164000dc8, all_tables=0x0) at /data/bld/10.11-debug/sql/sql_parse.cc:6313
            #18 0x00005654592c5fe8 in mysql_execute_command (thd=0x7fb164000dc8, is_called_from_prepared_stmt=false) at /data/bld/10.11-debug/sql/sql_parse.cc:3988
            #19 0x00005654592d431a in mysql_parse (thd=0x7fb164000dc8, rawbuf=0x7fb164015700 "SELECT f()", length=10, parser_state=0x7fb1800fe370) at /data/bld/10.11-debug/sql/sql_parse.cc:8152
            #20 0x00005654592bf8b1 in dispatch_command (command=COM_QUERY, thd=0x7fb164000dc8, packet=0x7fb16400bc69 "SELECT f()", packet_length=10, blocking=true) at /data/bld/10.11-debug/sql/sql_parse.cc:1895
            #21 0x00005654592be20a in do_command (thd=0x7fb164000dc8, blocking=true) at /data/bld/10.11-debug/sql/sql_parse.cc:1408
            #22 0x00005654594b46cc in do_handle_one_connection (connect=0x56545c9962a8, put_in_cache=true) at /data/bld/10.11-debug/sql/sql_connect.cc:1417
            #23 0x00005654594b4441 in handle_one_connection (arg=0x56545c8ca5c8) at /data/bld/10.11-debug/sql/sql_connect.cc:1319
            #24 0x00005654599f056c in pfs_spawn_thread (arg=0x56545c995e18) at /data/bld/10.11-debug/storage/perfschema/pfs.cc:2201
            #25 0x00007fb1852a8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
            #26 0x00007fb18532861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}

            No obvious immediate problem on a non-debug build.
            Assertion `mdl_request->ticket == __null' fails upon DML causing auto partition creation via function

            {code:sql}
            --source include/have_partition.inc

            CREATE TABLE t (a INT) WITH SYSTEM VERSIONING PARTITION BY SYSTEM_TIME INTERVAL 1 MINUTE AUTO;
            --delimiter $
            CREATE FUNCTION f() RETURNS INT BEGIN REPLACE INTO t SELECT * FROM t; RETURN 0; END $
            --delimiter ;
            SET timestamp= @@timestamp + 61;
            SELECT f();

            DROP TABLE t;
            DROP FUNCTION f;
            {code}

            {noformat:title=10.11 62bfcfd8b29cb4f2e70dd15155875494ad6a37cf}
            mariadbd: /data/bld/10.11-debug/sql/mdl.cc:2063: bool MDL_context::try_acquire_lock_impl(MDL_request*, MDL_ticket**): Assertion `mdl_request->ticket == __null' failed.
            240819 15:09:18 [ERROR] mysqld got signal 6 ;

            #9 0x00007fb185253e32 in __GI___assert_fail (assertion=0x56545a2372e4 "mdl_request->ticket == __null", file=0x56545a236cf8 "/data/bld/10.11-debug/sql/mdl.cc", line=2063, function=0x56545a2372a0 "bool MDL_context::try_acquire_lock_impl(MDL_request*, MDL_ticket**)") at ./assert/assert.c:101
            #10 0x00005654594c65a3 in MDL_context::try_acquire_lock_impl (this=0x7fb164000f20, mdl_request=0x7fb164015c78, out_ticket=0x7fb1800fd2f8) at /data/bld/10.11-debug/sql/mdl.cc:2063
            #11 0x00005654594c6ead in MDL_context::acquire_lock (this=0x7fb164000f20, mdl_request=0x7fb164015c78, lock_wait_timeout=86400) at /data/bld/10.11-debug/sql/mdl.cc:2297
            #12 0x000056545920b916 in sp_acquire_mdl (thd=0x7fb164000dc8, rt=0x7fb164015c78, ot_ctx=0x7fb1800fd590) at /data/bld/10.11-debug/sql/sql_base.cc:3704
            #13 0x000056545920baff in open_and_process_routine (thd=0x7fb164000dc8, prelocking_ctx=0x7fb1640051a8, rt=0x7fb164015c78, prelocking_strategy=0x7fb1800fd6a8, has_prelocking_list=true, ot_ctx=0x7fb1800fd590, need_prelocking=0x7fb1800fd526, routine_modifies_data=0x7fb1800fd527) at /data/bld/10.11-debug/sql/sql_base.cc:3781
            #14 0x000056545920dbb9 in open_tables (thd=0x7fb164000dc8, options=..., start=0x7fb1800fd608, counter=0x7fb1800fd624, flags=0, prelocking_strategy=0x7fb1800fd6a8) at /data/bld/10.11-debug/sql/sql_base.cc:4709
            #15 0x000056545920fab4 in open_and_lock_tables (thd=0x7fb164000dc8, options=..., tables=0x7fb164017560, derived=true, flags=0, prelocking_strategy=0x7fb1800fd6a8) at /data/bld/10.11-debug/sql/sql_base.cc:5610
            #16 0x00005654591c244e in open_and_lock_tables (thd=0x7fb164000dc8, tables=0x0, derived=true, flags=0) at /data/bld/10.11-debug/sql/sql_base.h:516
            #17 0x00005654592cee1d in execute_sqlcom_select (thd=0x7fb164000dc8, all_tables=0x0) at /data/bld/10.11-debug/sql/sql_parse.cc:6313
            #18 0x00005654592c5fe8 in mysql_execute_command (thd=0x7fb164000dc8, is_called_from_prepared_stmt=false) at /data/bld/10.11-debug/sql/sql_parse.cc:3988
            #19 0x00005654592d431a in mysql_parse (thd=0x7fb164000dc8, rawbuf=0x7fb164015700 "SELECT f()", length=10, parser_state=0x7fb1800fe370) at /data/bld/10.11-debug/sql/sql_parse.cc:8152
            #20 0x00005654592bf8b1 in dispatch_command (command=COM_QUERY, thd=0x7fb164000dc8, packet=0x7fb16400bc69 "SELECT f()", packet_length=10, blocking=true) at /data/bld/10.11-debug/sql/sql_parse.cc:1895
            #21 0x00005654592be20a in do_command (thd=0x7fb164000dc8, blocking=true) at /data/bld/10.11-debug/sql/sql_parse.cc:1408
            #22 0x00005654594b46cc in do_handle_one_connection (connect=0x56545c9962a8, put_in_cache=true) at /data/bld/10.11-debug/sql/sql_connect.cc:1417
            #23 0x00005654594b4441 in handle_one_connection (arg=0x56545c8ca5c8) at /data/bld/10.11-debug/sql/sql_connect.cc:1319
            #24 0x00005654599f056c in pfs_spawn_thread (arg=0x56545c995e18) at /data/bld/10.11-debug/storage/perfschema/pfs.cc:2201
            #25 0x00007fb1852a8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
            #26 0x00007fb18532861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}

            No obvious immediate problem on a non-debug build.
            midenok Aleksey Midenkov made changes -
            Summary Assertion `mdl_request->ticket == __null' fails upon DML causing auto partition creation via function Wrong reopen of already open routine due to auto-create in SP

            Please review bb-10.11-midenok

            midenok Aleksey Midenkov added a comment - Please review bb-10.11-midenok
            midenok Aleksey Midenkov made changes -
            Assignee Aleksey Midenkov [ midenok ] Oleksandr Byelkin [ sanja ]
            Status In Progress [ 3 ] In Review [ 10002 ]

            OK to push

            sanja Oleksandr Byelkin added a comment - OK to push
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Aleksey Midenkov [ midenok ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            midenok Aleksey Midenkov made changes -
            Labels reviewed
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 11.2(EOL) [ 28603 ]
            midenok Aleksey Midenkov made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            midenok Aleksey Midenkov made changes -
            Labels reviewed pushing
            JIraAutomate JiraAutomate made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            midenok Aleksey Midenkov made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            midenok Aleksey Midenkov made changes -
            Fix Version/s 10.11.11 [ 29954 ]
            Fix Version/s 10.11 [ 27614 ]
            Fix Version/s 11.4 [ 29301 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            JIraAutomate JiraAutomate made changes -
            Fix Version/s 11.4.5 [ 29956 ]
            Fix Version/s 11.7.2 [ 29914 ]

            People

              midenok Aleksey Midenkov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.