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

Assertion `(*tables)->reginfo.lock_type >= TL_READ' failed in lock_external upon using a mix of trigger, view, SP

    XMLWordPrintable

    Details

      Description

      CREATE TABLE t (i INT);
      CREATE VIEW v AS SELECT * FROM t;
      CREATE PROCEDURE p() CREATE VIEW v AS SELECT * FROM t;
      CREATE TRIGGER tr AFTER INSERT ON t FOR EACH ROW CALL p();
      --error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
      INSERT INTO t VALUES (1),(2);
       
      # Cleanup
      DROP PROCEDURE p;
      DROP VIEW v;
      DROP TABLE t;
      

      10.0 3d4beee1a98ce

      mysqld: /data/src/10.0/sql/lock.cc:351: int lock_external(THD*, TABLE**, uint): Assertion `(*tables)->reginfo.lock_type >= TL_READ' failed.
      180704 18:05:54 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f8052378ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x000000000091f457 in lock_external (thd=0x7f804c2a8070, tables=0x7f804a753468, count=3) at /data/src/10.0/sql/lock.cc:351
      #9  0x000000000091f20e in mysql_lock_tables (thd=0x7f804c2a8070, sql_lock=0x7f804a753410, flags=0) at /data/src/10.0/sql/lock.cc:308
      #10 0x000000000091f120 in mysql_lock_tables (thd=0x7f804c2a8070, tables=0x7f804a517b48, count=3, flags=0) at /data/src/10.0/sql/lock.cc:274
      #11 0x00000000005f1599 in lock_tables (thd=0x7f804c2a8070, tables=0x7f804a4fa170, count=3, flags=0) at /data/src/10.0/sql/sql_base.cc:5424
      #12 0x00000000005f105f in open_and_lock_tables (thd=0x7f804c2a8070, tables=0x7f804a4fa170, derived=true, flags=0, prelocking_strategy=0x7f80543fe990) at /data/src/10.0/sql/sql_base.cc:5252
      #13 0x00000000005e5331 in open_and_lock_tables (thd=0x7f804c2a8070, tables=0x7f804a4fa170, derived=true, flags=0) at /data/src/10.0/sql/sql_base.h:496
      #14 0x000000000062ee80 in mysql_insert (thd=0x7f804c2a8070, table_list=0x7f804a4fa170, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false) at /data/src/10.0/sql/sql_insert.cc:724
      #15 0x000000000064f694 in mysql_execute_command (thd=0x7f804c2a8070) at /data/src/10.0/sql/sql_parse.cc:3450
      #16 0x0000000000657dd6 in mysql_parse (thd=0x7f804c2a8070, rawbuf=0x7f804a4fa088 "INSERT INTO t VALUES (1),(2)", length=28, parser_state=0x7f80543ff640) at /data/src/10.0/sql/sql_parse.cc:6634
      #17 0x000000000064a6f6 in dispatch_command (command=COM_QUERY, thd=0x7f804c2a8070, packet=0x7f804d7e5071 "INSERT INTO t VALUES (1),(2)", packet_length=28) at /data/src/10.0/sql/sql_parse.cc:1297
      #18 0x00000000006499f6 in do_command (thd=0x7f804c2a8070) at /data/src/10.0/sql/sql_parse.cc:1000
      #19 0x000000000076a872 in do_handle_one_connection (thd_arg=0x7f804c2a8070) at /data/src/10.0/sql/sql_connect.cc:1377
      #20 0x000000000076a5e4 in handle_one_connection (arg=0x7f804c2a8070) at /data/src/10.0/sql/sql_connect.cc:1292
      #21 0x0000000000acc722 in pfs_spawn_thread (arg=0x7f804c1a25f0) at /data/src/10.0/storage/perfschema/pfs.cc:1861
      #22 0x00007f805407c494 in start_thread (arg=0x7f8054400700) at pthread_create.c:333
      #23 0x00007f805243593f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      No visible effect on non-debug builds.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serg Sergei Golubchik
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:

                  Git Integration