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

Assertion `file->trn == trn' failed in ha_maria::start_stmt upon DML under concurrent locks

    XMLWordPrintable

    Details

      Description

      CREATE TABLE t1 (a INT) ENGINE=Aria;
      CREATE VIEW v1 AS SELECT * FROM t1;
      CREATE TABLE t2 (b INT) ENGINE=Aria;
      CREATE TABLE t3 (c INT);
      LOCK TABLES t1 WRITE CONCURRENT, v1 WRITE, t3 WRITE CONCURRENT;
      --error ER_BAD_FIELD_ERROR
      ALTER TABLE t1 CHANGE x xx INT;
       
      --connect (con1,localhost,root,,test)
      REPLACE INTO t2 VALUES (NULL);
       
      --connection default
      --error ER_TABLE_NOT_LOCKED_FOR_WRITE
      FLUSH TABLES;
      DELETE FROM t1;
       
      # Cleanup
      UNLOCK TABLES;
      --disconnect con1
      DROP VIEW v1;
      DROP TABLE t1, t2, t3;
      

      10.2 93dc3e26

      mysqld: /data/src/10.2/storage/maria/ha_maria.cc:2824: virtual int ha_maria::start_stmt(THD*, thr_lock_type): Assertion `file->trn == trn' failed.
      200217 21:19:38 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f5615d48f12 in __GI___assert_fail (assertion=0x5595e05ff56f "file->trn == trn", file=0x5595e05feb20 "/data/src/10.2/storage/maria/ha_maria.cc", line=2824, function=0x5595e05fffe0 <ha_maria::start_stmt(THD*, thr_lock_type)::__PRETTY_FUNCTION__> "virtual int ha_maria::start_stmt(THD*, thr_lock_type)") at assert.c:101
      #8  0x00005595e011c8e8 in ha_maria::start_stmt (this=0x7f56000463e8, thd=0x7f5600000af0, lock_type=TL_WRITE) at /data/src/10.2/storage/maria/ha_maria.cc:2824
      #9  0x00005595df89b40e in check_lock_and_start_stmt (thd=0x7f5600000af0, prelocking_ctx=0x7f5600004630, table_list=0x7f5600012510) at /data/src/10.2/sql/sql_base.cc:4568
      #10 0x00005595df89c735 in lock_tables (thd=0x7f5600000af0, tables=0x7f5600012510, count=1, flags=0) at /data/src/10.2/sql/sql_base.cc:5094
      #11 0x00005595df89bc11 in open_and_lock_tables (thd=0x7f5600000af0, options=..., tables=0x7f5600012510, derived=true, flags=0, prelocking_strategy=0x7f561007ad78) at /data/src/10.2/sql/sql_base.cc:4802
      #12 0x00005595df862989 in open_and_lock_tables (thd=0x7f5600000af0, tables=0x7f5600012510, derived=true, flags=0) at /data/src/10.2/sql/sql_base.h:509
      #13 0x00005595dfd11503 in mysql_delete (thd=0x7f5600000af0, table_list=0x7f5600012510, conds=0x0, order_list=0x7f5600005088, limit=18446744073709551615, options=0, result=0x0) at /data/src/10.2/sql/sql_delete.cc:252
      #14 0x00005595df90b002 in mysql_execute_command (thd=0x7f5600000af0) at /data/src/10.2/sql/sql_parse.cc:4369
      #15 0x00005595df915bea in mysql_parse (thd=0x7f5600000af0, rawbuf=0x7f5600012448 "DELETE FROM t1", length=14, parser_state=0x7f561007c200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7739
      #16 0x00005595df903f43 in dispatch_command (command=COM_QUERY, thd=0x7f5600000af0, packet=0x7f560008c761 "DELETE FROM t1", packet_length=14, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1831
      #17 0x00005595df902897 in do_command (thd=0x7f5600000af0) at /data/src/10.2/sql/sql_parse.cc:1384
      #18 0x00005595dfa578d3 in do_handle_one_connection (connect=0x5595e1e4cb30) at /data/src/10.2/sql/sql_connect.cc:1336
      #19 0x00005595dfa5763e in handle_one_connection (arg=0x5595e1e4cb30) at /data/src/10.2/sql/sql_connect.cc:1241
      #20 0x00005595e02736de in pfs_spawn_thread (arg=0x5595e1ee7d30) at /data/src/10.2/storage/perfschema/pfs.cc:1869
      #21 0x00007f5617cd14a4 in start_thread (arg=0x7f561007d700) at pthread_create.c:456
      #22 0x00007f5615e05d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Reproducible on 10.2, 10.3.
      Not reproducible on 10.1, 10.4.
      No obvious problem on a non-debug build.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              vlad.lesin Vladislav Lesin
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: