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

Assertion `lock_type != TL_WRITE_DEFAULT && lock_type != TL_READ_DEFAULT' failed

    XMLWordPrintable

Details

    • Can result in hang or crash
    • Q3/2026 Server Maintenance

    Description

      CREATE TABLE t(a INT);
      LOCK TABLES t WRITE CONCURRENT,t AS y WRITE;
      ALTER TABLE t ADD b VECTOR(1) NOT NULL,ADD VECTOR INDEX(b);
      

      Leads to:

      CS 13.0.2 eb0f3282ae8d1f3762c86d682dba99c892498049 (Debug, Clang 22.1.8-20260622) Build 23/06/2026

      mariadbd: /test/13.0_dbg/sql/lock.cc:870: MYSQL_LOCK *get_lock_data(THD *, TABLE **, uint, uint): Assertion `lock_type != TL_WRITE_DEFAULT && lock_type != TL_READ_DEFAULT' failed.
      

      CS 13.0.2 eb0f3282ae8d1f3762c86d682dba99c892498049 (Debug, Clang 22.1.8-20260622) Build 23/06/2026

      Core was generated by `/test/MD230626-mariadb-13.0.2-linux-x86_64-dbg/bin/mariadbd --no-defaults --loo'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 3216968)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x0000769b4544527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x0000769b454288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x0000769b4542881b in __assert_fail_base (fmt=0x769b455d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x648caedc9028 "lock_type != TL_WRITE_DEFAULT && lock_type != TL_READ_DEFAULT", file=file@entry=0x648caedc8eac "/test/13.0_dbg/sql/lock.cc", line=line@entry=870, function=function@entry=0x648caedc9066 "MYSQL_LOCK *get_lock_data(THD *, TABLE **, uint, uint)") at ./assert/assert.c:96
      #6  0x0000769b4543b517 in __assert_fail (assertion=0x648caedc9028 "lock_type != TL_WRITE_DEFAULT && lock_type != TL_READ_DEFAULT", file=0x648caedc8eac "/test/13.0_dbg/sql/lock.cc", line=870, function=0x648caedc9066 "MYSQL_LOCK *get_lock_data(THD *, TABLE **, uint, uint)") at ./assert/assert.c:105
      #7  0x0000648cae277b6e in get_lock_data (thd=0x6e9a0c000d60, table_ptr=0x769b1cb893f0, count=2, flags=1)at /test/13.0_dbg/sql/lock.cc:870
      #8  0x0000648cae2773d2 in mysql_lock_tables (thd=0x6e9a0c000d60, tables=0x769b1cb893f0, count=2, flags=18539)at /test/13.0_dbg/sql/lock.cc:348
      #9  0x0000648cadbefa3e in Locked_tables_list::reopen_tables (this=0x6e9a0c005090, thd=0x6e9a0c000d60, need_reopen=false)at /test/13.0_dbg/sql/sql_base.cc:3043
      #10 0x0000648caddce810 in mysql_alter_table (thd=0x6e9a0c000d60, new_db=0x6e9a0c005ba0, new_name=0x6e9a0c006038, create_info=0x769b1cb8cf90, table_list=0x6e9a0c01a510, recreate_info=0x769b1cb8c6a8, alter_info=0x769b1cb8ce18, order_num=0, order=0x0, ignore=false, if_exists=false)at /test/13.0_dbg/sql/sql_table.cc:12269
      #11 0x0000648cade8c7bc in Sql_cmd_alter_table::execute (this=0x6e9a0c01ae80, thd=0x6e9a0c000d60) at /test/13.0_dbg/sql/sql_alter.cc:697
      #12 0x0000648cadcbecf6 in mysql_execute_command (thd=0x6e9a0c000d60, is_called_from_prepared_stmt=false) at /test/13.0_dbg/sql/sql_parse.cc:5905
      #13 0x0000648cadcafe08 in mysql_parse (thd=0x6e9a0c000d60, rawbuf=0x6e9a0c01a3c0 "ALTER TABLE t ADD b VECTOR(1) NOT NULL,ADD VECTOR INDEX(b)", length=58, parser_state=0x769b1cb8e9f0)at /test/13.0_dbg/sql/sql_parse.cc:7945
      #14 0x0000648cadcad55e in dispatch_command (command=COM_QUERY, thd=0x6e9a0c000d60, packet=0x6e9a0c00b5f1 "", packet_length=58, blocking=true) at /test/13.0_dbg/sql/sql_parse.cc:1903
      #15 0x0000648cadcb088a in do_command (thd=0x6e9a0c000d60, blocking=true)at /test/13.0_dbg/sql/sql_parse.cc:1437
      #16 0x0000648cade81d4e in do_handle_one_connection (connect=0x648cc83da800, put_in_cache=true) at /test/13.0_dbg/sql/sql_connect.cc:1503
      #17 0x0000648cade81b31 in handle_one_connection (arg=0x648cc83b9160)at /test/13.0_dbg/sql/sql_connect.cc:1415
      #18 0x0000769b4549caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #19 0x0000769b45529c6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed             
      CS  10.6   dbg  230626  8eda90189340c31f7dfbae9ed870bfd8c0ad1776  No bug found                  
      CS  10.6   opt  220626  8eda90189340c31f7dfbae9ed870bfd8c0ad1776  No bug found                  
      CS  10.11  dbg  230626  d051e8663a8600cb899094498718859199a3ff0a  No bug found                  
      CS  10.11  opt  220626  d051e8663a8600cb899094498718859199a3ff0a  No bug found                  
      CS  11.4   dbg  230626  bbd558c38616ce24bd2973486763c2a7c4db0969  No bug found                  
      CS  11.4   opt  220626  bbd558c38616ce24bd2973486763c2a7c4db0969  No bug found                  
      CS  11.8   dbg  230626  eccdef627382b7b1f5338450ba328d16216c4fa2  lock_type != TL_WRITE_DEFAULT && lock_type != TL_READ_DEFAULT|SIGABRT|get_lock_data|mysql_lock_tables|Locked_tables_list::reopen_tables|mysql_alter_table
      CS  11.8   opt  220626  eccdef627382b7b1f5338450ba328d16216c4fa2  No bug found                  
      CS  12.3   dbg  230626  c46441bc5f19f6b10dc1c3a2513d963c496e6578  lock_type != TL_WRITE_DEFAULT && lock_type != TL_READ_DEFAULT|SIGABRT|get_lock_data|mysql_lock_tables|Locked_tables_list::reopen_tables|mysql_alter_table
      CS  12.3   dbg  250626  c46441bc5f19f6b10dc1c3a2513d963c496e6578  No bug found                  
      CS  12.3   opt  220626  c46441bc5f19f6b10dc1c3a2513d963c496e6578  No bug found                  
      CS  12.3   opt  250626  c46441bc5f19f6b10dc1c3a2513d963c496e6578  No bug found                  
      CS  13.0   dbg  230626  eb0f3282ae8d1f3762c86d682dba99c892498049  lock_type != TL_WRITE_DEFAULT && lock_type != TL_READ_DEFAULT|SIGABRT|get_lock_data|mysql_lock_tables|Locked_tables_list::reopen_tables|mysql_alter_table
      CS  13.0   opt  220626  eb0f3282ae8d1f3762c86d682dba99c892498049  No bug found                  
      ES  10.6   dbg  230626  e05a2b2ddaa1032a24924a6e1a12acd467abf4da  No bug found                  
      ES  10.6   opt  220626  e05a2b2ddaa1032a24924a6e1a12acd467abf4da  No bug found                  
      ES  11.4   dbg  230626  5b6db6d09008ba92cfc5a2ef980ab86badf70d12  lock_type != TL_WRITE_DEFAULT && lock_type != TL_READ_DEFAULT|SIGABRT|get_lock_data|mysql_lock_tables|Locked_tables_list::reopen_tables|mysql_alter_table
      ES  11.4   opt  220626  5b6db6d09008ba92cfc5a2ef980ab86badf70d12  No bug found                  
      ES  11.8   dbg  230626  cc48b2b61be04be37daa2badcf254d96a26d2ba7  lock_type != TL_WRITE_DEFAULT && lock_type != TL_READ_DEFAULT|SIGABRT|get_lock_data|mysql_lock_tables|Locked_tables_list::reopen_tables|mysql_alter_table
      ES  11.8   opt  220626  cc48b2b61be04be37daa2badcf254d96a26d2ba7  No bug found                  
      ES  12.3   dbg  230626  a1d3628ea75207c85664946574ff803cbfc7c511  lock_type != TL_WRITE_DEFAULT && lock_type != TL_READ_DEFAULT|SIGABRT|get_lock_data|mysql_lock_tables|Locked_tables_list::reopen_tables|mysql_alter_table
      ES  12.3   opt  220626  a1d3628ea75207c85664946574ff803cbfc7c511  No bug found                  
      

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              saahil Saahil Alam
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 2d 2h 40m Original Estimate - 2d 2h 40m
                  2d 2h 40m
                  Remaining:
                  Time Spent - 1.5h Remaining Estimate - 2d 2h 40m
                  2d 2h 40m
                  Logged:
                  Time Spent - 1.5h Remaining Estimate - 2d 2h 40m
                  1.5h

                  Git Integration

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