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

InnoDB assert with vector index under LOCK TABLES

Details

    • Bug
    • Status: In Testing (View Workflow)
    • Critical
    • Resolution: Unresolved
    • 11.8, 12.0
    • 11.8
    • Vector search

    Description

      --source include/have_innodb.inc 
       
      CREATE TABLE t (a INT,v VECTOR (1) NOT NULL,VECTOR INDEX (v)) ENGINE=INNODB;
      LOCK TABLE t WRITE;
      INSERT INTO t VALUES (1,0x30303030);
      INSERT INTO t VALUES (1,0x31313131);
      

      Leads to

      CS 11.8.1 059d06ae0736a836acee0b5c644ebf9290343e96 (Debug) Build 19/02/2025

      mariadbd: /test/11.8_dbg/storage/innobase/lock/lock0lock.cc:1931: dberr_t lock_rec_lock(bool, unsigned int, const buf_block_t *, ulint, dict_index_t *, que_thr_t *): Assertion `(0x7 & mode) != LOCK_X || lock_table_has(trx, index->table, LOCK_IX)' failed.
      

      CS 11.8.1 059d06ae0736a836acee0b5c644ebf9290343e96 (Debug) Build 19/02/2025

      Core was generated by `/test/MD190225-mariadb-11.8.1-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
      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 (Thread 0x1467980606c0 (LWP 281394))]
      (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  0x000014679e04527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x000014679e0288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000014679e02881b in __assert_fail_base (fmt=0x14679e1d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x558b56f30869 "(0x7 & mode) != LOCK_X || lock_table_has(trx, index->table, LOCK_IX)", file=file@entry=0x558b56f2b92d "/test/11.8_dbg/storage/innobase/lock/lock0lock.cc", line=line@entry=1931, function=function@entry=0x558b56f3076b "dberr_t lock_rec_lock(bool, unsigned int, const buf_block_t *, ulint, dict_index_t *, que_thr_t *)")at ./assert/assert.c:96
      #6  0x000014679e03b517 in __assert_fail (assertion=0x558b56f30869 "(0x7 & mode) != LOCK_X || lock_table_has(trx, index->table, LOCK_IX)", file=0x558b56f2b92d "/test/11.8_dbg/storage/innobase/lock/lock0lock.cc", line=1931, function=0x558b56f3076b "dberr_t lock_rec_lock(bool, unsigned int, const buf_block_t *, ulint, dict_index_t *, que_thr_t *)") at ./assert/assert.c:105
      #7  0x0000558b566d0983 in lock_rec_lock (impl=false, mode=3, block=0x14678b802d00, heap_no=1, index=0x14673c032818, thr=0x14673c07fc00)at /test/11.8_dbg/storage/innobase/lock/lock0lock.cc:1930
      #8  0x0000558b566d1e48 in lock_sec_rec_read_check_and_lock (flags=0, block=0x14678b802d00, rec=0x14678b8f8070 "supremum", index=0x14673c032818, offsets=0x14679805baa0, mode=LOCK_X, gap_mode=0, thr=0x14673c07fc00)at /test/11.8_dbg/storage/innobase/lock/lock0lock.cc:6480
      #9  0x0000558b568665bd in sel_set_rec_lock (pcur=0x14673c07f798, rec=0x14678b8f8070 "supremum", index=0x14673c032818, offsets=0x14679805baa0, mode=3, type=0, thr=0x14673c07fc00, mtr=0x14679805c3e8) at /test/11.8_dbg/storage/innobase/row/row0sel.cc:1369
      #10 0x0000558b56860344 in row_search_mvcc (buf=0x14673c07dde0 "\376", mode=PAGE_CUR_L, prebuilt=0x14673c07f5c8, match_mode=0, direction=0)at /test/11.8_dbg/storage/innobase/row/row0sel.cc:4946
      #11 0x0000558b5661f3dd in ha_innobase::index_read (this=0x14673c07d588, buf=0x14673c07dde0 "\376", key_ptr=0x0, key_len=0, find_flag=HA_READ_BEFORE_KEY)at /test/11.8_dbg/storage/innobase/handler/ha_innodb.cc:9020
      #12 0x0000558b5661ff49 in ha_innobase::index_last (this=0x14673c07d588, buf=0x14673c07dde0 "\376")at /test/11.8_dbg/storage/innobase/handler/ha_innodb.cc:9390
      #13 0x0000558b56243673 in handler::ha_index_last (this=0x14673c07d588, buf=0x14673c07dde0 "\376") at /test/11.8_dbg/sql/handler.cc:3980
      #14 0x0000558b564226c6 in MHNSW_Share::acquire (ctx=0x14679805cb00, table=0x14673c0305f8, for_update=true)at /test/11.8_dbg/sql/vector_mhnsw.cc:725
      #15 0x0000558b5642442b in mhnsw_insert (table=0x14673c0305f8, keyinfo=0x14673c0283c0) at /test/11.8_dbg/sql/vector_mhnsw.cc:1202
      #16 0x0000558b55d7272c in TABLE::hlindexes_on_insert (this=0x14673c0305f8)at /test/11.8_dbg/sql/sql_base.cc:9950
      #17 0x0000558b5624f9a4 in handler::ha_write_row (this=0x14673c027968, buf=0x14673c0281c0 "\376\001") at /test/11.8_dbg/sql/handler.cc:8203
      #18 0x0000558b55dc73a7 in write_record (thd=0x14673c000d58, table=0x14673c0305f8, info=0x14679805d0d0, sink=0x0)at /test/11.8_dbg/sql/sql_insert.cc:2332
      #19 0x0000558b55dc389d in mysql_insert (thd=0x14673c000d58, table_list=0x14673c019e18, fields=@0x14673c005fe0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x558b579ef6f0 <end_of_list>, last = 0x14673c005fe0, elements = 0}, <No data fields>}, values_list=@0x14673c006028: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14673c01ab78, last = 0x14673c01ab78, elements = 1}, <No data fields>}, update_fields=@0x14673c006010: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x558b579ef6f0 <end_of_list>, last = 0x14673c006010, elements = 0}, <No data fields>}, update_values=@0x14673c005ff8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x558b579ef6f0 <end_of_list>, last = 0x14673c005ff8, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false, result=0x0)at /test/11.8_dbg/sql/sql_insert.cc:1159
      #20 0x0000558b55e22a82 in mysql_execute_command (thd=0x14673c000d58, is_called_from_prepared_stmt=false) at /test/11.8_dbg/sql/sql_parse.cc:4484
      #21 0x0000558b55e18784 in mysql_parse (thd=0x14673c000d58, rawbuf=0x14673c019d20 "INSERT INTO t VALUES (1,0x31313131)", length=35, parser_state=0x14679805ea20) at /test/11.8_dbg/sql/sql_parse.cc:7915
      #22 0x0000558b55e15b54 in dispatch_command (command=COM_QUERY, thd=0x14673c000d58, packet=0x14673c00b099 "INSERT INTO t VALUES (1,0x31313131)", packet_length=35, blocking=true) at /test/11.8_dbg/sql/sql_parse.cc:1902
      #23 0x0000558b55e19333 in do_command (thd=0x14673c000d58, blocking=true)at /test/11.8_dbg/sql/sql_parse.cc:1415
      #24 0x0000558b560029c9 in do_handle_one_connection (connect=0x558b713b4f48, put_in_cache=true) at /test/11.8_dbg/sql/sql_connect.cc:1415
      #25 0x0000558b5600276e in handle_one_connection (arg=0x558b713ce158)at /test/11.8_dbg/sql/sql_connect.cc:1327
      #26 0x000014679e09caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #27 0x000014679e129c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug confirmed present in:
      MariaDB: 11.8.1 (dbg), 12.0.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 11.8.1 (opt), 12.0.0 (opt)

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Roel Van de Paar made transition -
            Open Confirmed
            16h 46m 1
            Sergei Golubchik made transition -
            Confirmed In Progress
            28d 10h 55m 1
            Sergei Golubchik made transition -
            In Progress In Testing
            12m 56s 1

            People

              serg Sergei Golubchik
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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