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

ASAN errors or assertion failures in row_sel_convert_mysql_key_to_innobase upon query from table with usual key on vector field

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • N/A
    • 11.7.1
    • Vector search
    • None

    Description

      Note: The issue is not limited to 1-dimensional vectors or to empty tables.

      --source include/have_innodb.inc
       
      CREATE TABLE t (v VECTOR(1), KEY(v)) ENGINE=InnoDB;
      SELECT v FROM t WHERE v = VEC_FromText('[1]');
       
      # Cleanup
      DROP TABLE t;
      

      bb-11.6-MDEV-32887-vector 1ec610ffa3bffdc25bd8cc18b48f3bdcf17e259d non-debug ASAN

      ==869203==ERROR: AddressSanitizer: use-after-poison on address 0x612000043020 at pc 0x555cfe5775a5 bp 0x7f3274e21700 sp 0x7f3274e216f8
      READ of size 8 at 0x612000043020 thread T10
          #0 0x555cfe5775a4 in row_sel_convert_mysql_key_to_innobase(dtuple_t*, unsigned char*, unsigned long, dict_index_t*, unsigned char const*, unsigned long) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/storage/innobase/row/row0sel.cc:2639
          #1 0x555cfe2e4aec in ha_innobase::records_in_range(unsigned int, st_key_range const*, st_key_range const*, st_page_range*) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/storage/innobase/handler/ha_innodb.cc:14280
          #2 0x555cfd56c5b9 in handler::multi_range_read_info_const(unsigned int, st_range_seq_if*, void*, unsigned int, unsigned int*, unsigned int*, unsigned long long, Cost_estimate*) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/multi_range_read.cc:247
          #3 0x555cfd5754ef in DsMrr_impl::dsmrr_info_const(unsigned int, st_range_seq_if*, void*, unsigned int, unsigned int*, unsigned int*, unsigned long long, Cost_estimate*) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/multi_range_read.cc:1783
          #4 0x555cfcd587fd in check_quick_select /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/opt_range.cc:12095
          #5 0x555cfcd587fd in get_key_scans_params /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/opt_range.cc:7853
          #6 0x555cfcd69de9 in SQL_SELECT::test_quick_select(THD*, Bitmap<64u>, unsigned long long, unsigned long long, bool, bool, bool, bool, Item_func::Bitmap) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/opt_range.cc:3001
          #7 0x555cfd2215f0 in get_quick_record_count /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_select.cc:5403
          #8 0x555cfd2215f0 in make_join_statistics /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_select.cc:6180
          #9 0x555cfd236d7c in JOIN::optimize_inner() /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_select.cc:2687
          #10 0x555cfd2392e4 in JOIN::optimize() /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_select.cc:1985
          #11 0x555cfd239655 in mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_select.cc:5328
          #12 0x555cfd23b306 in handle_select(THD*, LEX*, select_result*, unsigned long long) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_select.cc:624
          #13 0x555cfd04d3eb in execute_sqlcom_select /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_parse.cc:6151
          #14 0x555cfd07cbc4 in mysql_execute_command(THD*, bool) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_parse.cc:3953
          #15 0x555cfd082091 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_parse.cc:7873
          #16 0x555cfd08a38e in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_parse.cc:1892
          #17 0x555cfd08f598 in do_command(THD*, bool) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_parse.cc:1405
          #18 0x555cfd4bd6ae in do_handle_one_connection(CONNECT*, bool) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_connect.cc:1448
          #19 0x555cfd4bdfbc in handle_one_connection /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_connect.cc:1350
          #20 0x555cfe0e2b77 in pfs_spawn_thread /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/storage/perfschema/pfs.cc:2198
          #21 0x7f3283aa8043 in start_thread nptl/pthread_create.c:442
          #22 0x7f3283b2861b in clone3 ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
       
      0x612000043020 is located 224 bytes inside of 272-byte region [0x612000042f40,0x612000043050)
      allocated by thread T10 here:
          #0 0x7f32846b89cf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69
          #1 0x555cfe42e4a4 in ut_allocator<unsigned char, true>::allocate(unsigned long, unsigned char const*, unsigned int, bool, bool) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/storage/innobase/include/ut0new.h:375
          #2 0x555cfe42e4a4 in mem_heap_create_block_func(mem_block_info_t*, unsigned long, unsigned long) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/storage/innobase/mem/mem0mem.cc:277
          #3 0x555cfe2e42a5 in mem_heap_create_func /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/storage/innobase/include/mem0mem.inl:377
          #4 0x555cfe2e42a5 in ha_innobase::records_in_range(unsigned int, st_key_range const*, st_key_range const*, st_page_range*) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/storage/innobase/handler/ha_innodb.cc:14266
          #5 0x555cfd56c5b9 in handler::multi_range_read_info_const(unsigned int, st_range_seq_if*, void*, unsigned int, unsigned int*, unsigned int*, unsigned long long, Cost_estimate*) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/multi_range_read.cc:247
          #6 0x555cfd5754ef in DsMrr_impl::dsmrr_info_const(unsigned int, st_range_seq_if*, void*, unsigned int, unsigned int*, unsigned int*, unsigned long long, Cost_estimate*) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/multi_range_read.cc:1783
          #7 0x555cfcd587fd in check_quick_select /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/opt_range.cc:12095
          #8 0x555cfcd587fd in get_key_scans_params /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/opt_range.cc:7853
          #9 0x555cfcd69de9 in SQL_SELECT::test_quick_select(THD*, Bitmap<64u>, unsigned long long, unsigned long long, bool, bool, bool, bool, Item_func::Bitmap) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/opt_range.cc:3001
          #10 0x555cfd2215f0 in get_quick_record_count /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_select.cc:5403
          #11 0x555cfd2215f0 in make_join_statistics /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_select.cc:6180
          #12 0x555cfd236d7c in JOIN::optimize_inner() /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_select.cc:2687
          #13 0x555cfd2392e4 in JOIN::optimize() /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_select.cc:1985
          #14 0x555cfd239655 in mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_select.cc:5328
          #15 0x555cfd23b306 in handle_select(THD*, LEX*, select_result*, unsigned long long) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_select.cc:624
          #16 0x555cfd04d3eb in execute_sqlcom_select /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_parse.cc:6151
          #17 0x555cfd07cbc4 in mysql_execute_command(THD*, bool) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_parse.cc:3953
          #18 0x555cfd082091 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_parse.cc:7873
          #19 0x555cfd08a38e in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_parse.cc:1892
          #20 0x555cfd08f598 in do_command(THD*, bool) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_parse.cc:1405
          #21 0x555cfd4bd6ae in do_handle_one_connection(CONNECT*, bool) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_connect.cc:1448
          #22 0x555cfd4bdfbc in handle_one_connection /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/sql_connect.cc:1350
          #23 0x555cfe0e2b77 in pfs_spawn_thread /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/storage/perfschema/pfs.cc:2198
          #24 0x7f3283aa8043 in start_thread nptl/pthread_create.c:442
       
      Thread T10 created by T0 here:
          #0 0x7f3284649726 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:207
          #1 0x555cfe0e2ded in my_thread_create /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/storage/perfschema/my_thread.h:38
          #2 0x555cfe0e2ded in pfs_spawn_thread_v1 /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/storage/perfschema/pfs.cc:2249
          #3 0x555cfccf2443 in inline_mysql_thread_create /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/include/mysql/psi/mysql_thread.h:1139
          #4 0x555cfccf2443 in create_thread_to_handle_connection(CONNECT*) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/mysqld.cc:6267
          #5 0x555cfccfee25 in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/mysqld.cc:6391
          #6 0x555cfccffa77 in handle_connections_sockets() /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/mysqld.cc:6504
          #7 0x555cfcd0157c in mysqld_main(int, char**) /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/sql/mysqld.cc:6162
          #8 0x7f3283a461c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
       
      SUMMARY: AddressSanitizer: use-after-poison /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel-asan/storage/innobase/row/row0sel.cc:2639 in row_sel_convert_mysql_key_to_innobase(dtuple_t*, unsigned char*, unsigned long, dict_index_t*, unsigned char const*, unsigned long)
      Shadow bytes around the buggy address:
        0x0c24800005b0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
        0x0c24800005c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x0c24800005d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x0c24800005e0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
        0x0c24800005f0: 00 00 00 00 00 00 00 00 f7 00 00 00 00 00 00 00
      =>0x0c2480000600: 00 00 f7 f7[f7]f7 f7 f7 f7 f7 fa fa fa fa fa fa
        0x0c2480000610: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c2480000620: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c2480000630: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c2480000640: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x0c2480000650: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
      Shadow byte legend (one shadow byte represents 8 application bytes):
        Addressable:           00
        Partially addressable: 01 02 03 04 05 06 07 
        Heap left redzone:       fa
        Freed heap region:       fd
        Stack left redzone:      f1
        Stack mid redzone:       f2
        Stack right redzone:     f3
        Stack after return:      f5
        Stack use after scope:   f8
        Global redzone:          f9
        Global init order:       f6
        Poisoned by user:        f7
        Container overflow:      fc
        Array cookie:            ac
        Intra object redzone:    bb
        ASan internal:           fe
        Left alloca redzone:     ca
        Right alloca redzone:    cb
      ==869203==ABORTING
      

      debug ubsan

      2024-10-18 16:52:07 0x7f25f51f86c0  InnoDB: Assertion failure in file /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/storage/innobase/row/row0sel.cc line 2640
      InnoDB: Failing assertion: field->col->mtype == type
       
      #9  0x0000564841e06886 in ut_dbg_assertion_failed (expr=expr@entry=0x56484271dac7 "field->col->mtype == type", file=file@entry=0x56484271dff0 "/data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/storage/innobase/row/row0sel.cc", line=line@entry=2640) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/storage/innobase/ut/ut0dbg.cc:60
      #10 0x0000564841d16933 in row_sel_convert_mysql_key_to_innobase (tuple=tuple@entry=0x7f25dc016a18, buf=buf@entry=0x0, buf_len=buf_len@entry=0, index=index@entry=0x7f25dc11bf08, key_ptr=0x7f25dc06bd0d "\200?\245", key_ptr@entry=0x7f25dc06bd08 "", key_len=key_len@entry=7) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/storage/innobase/row/row0sel.cc:2640
      #11 0x0000564841964ea0 in ha_innobase::records_in_range (this=0x7f25dc101de0, keynr=<optimized out>, min_key=<optimized out>, max_key=0x7f25f51f5080, pages=0x7f25f51f4ff0) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/storage/innobase/handler/ha_innodb.cc:14280
      #12 0x000056484064c508 in handler::multi_range_read_info_const (this=this@entry=0x7f25dc101de0, keyno=keyno@entry=0, seq=seq@entry=0x7f25f51f5270, seq_init_param=seq_init_param@entry=0x7f25f51f52a0, n_ranges_arg=n_ranges_arg@entry=0, bufsz=bufsz@entry=0x7f25f51f5128, flags=0x7f25f51f512c, top_limit=18446744073709551615, cost=0x7f25f51f58f0) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/multi_range_read.cc:247
      #13 0x0000564840658335 in DsMrr_impl::dsmrr_info_const (this=this@entry=0x7f25dc102368, keyno=keyno@entry=0, seq=seq@entry=0x7f25f51f5270, seq_init_param=seq_init_param@entry=0x7f25f51f52a0, n_ranges=n_ranges@entry=0, bufsz=bufsz@entry=0x7f25f51f58ac, flags=0x7f25f51f58a8, limit=18446744073709551615, cost=0x7f25f51f58f0) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/multi_range_read.cc:1783
      #14 0x000056484194ca2c in ha_innobase::multi_range_read_info_const (this=0x7f25dc101de0, keyno=0, seq=0x7f25f51f5270, seq_init_param=0x7f25f51f52a0, n_ranges=0, bufsz=0x7f25f51f58ac, flags=0x7f25f51f58a8, limit=18446744073709551615, cost=0x7f25f51f58f0) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/storage/innobase/handler/ha_innodb.cc:20141
      #15 0x000056483fbd3e57 in check_quick_select (param=param@entry=0x7f25f51f5c90, idx=idx@entry=0, limit=limit@entry=18446744073709551615, index_only=index_only@entry=true, tree=tree@entry=0x7f25dc06bda0, update_tbl_stats=update_tbl_stats@entry=true, mrr_flags=0x7f25f51f58a8, bufsize=0x7f25f51f58ac, cost=0x7f25f51f58f0, is_ror_scan=0x7f25f51f58a7) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/opt_range.cc:12095
      #16 0x000056483fbdb9e0 in get_key_scans_params (param=param@entry=0x7f25f51f5c90, tree=tree@entry=0x7f25dc06bd18, index_read_must_be_used=index_read_must_be_used@entry=false, for_range_access=for_range_access@entry=true, read_time=read_time@entry=0.0067926050000000002, limit=limit@entry=18446744073709551615, using_table_scan=using_table_scan@entry=true) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/opt_range.cc:7853
      #17 0x000056483fbf6817 in SQL_SELECT::test_quick_select (this=this@entry=0x7f25dc1050c0, thd=thd@entry=0x7f25dc000d58, keys_to_use=..., prev_tables=prev_tables@entry=0, limit=limit@entry=18446744073709551615, force_quick_range=force_quick_range@entry=false, ordered_output=false, remove_false_parts_of_where=true, only_single_index_range_scan=false, note_unusable_keys=<optimized out>) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/opt_range.cc:3001
      #18 0x00005648400f6196 in get_quick_record_count (thd=0x7f25dc000d58, select=select@entry=0x7f25dc1050c0, table=0x7f25dc211ee8, keys=keys@entry=0x7f25dc019560, limit=18446744073709551615, quick_count=quick_count@entry=0x7f25f51f65e0) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_select.cc:5403
      #19 0x0000564840208df3 in make_join_statistics (join=join@entry=0x7f25dc0187c8, tables_list=..., keyuse_array=keyuse_array@entry=0x7f25dc018b28) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_select.cc:6180
      #20 0x00005648402106b5 in JOIN::optimize_inner (this=this@entry=0x7f25dc0187c8) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_select.cc:2687
      #21 0x0000564840211090 in JOIN::optimize (this=this@entry=0x7f25dc0187c8) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_select.cc:1985
      #22 0x0000564840211d91 in mysql_select (thd=thd@entry=0x7f25dc000d58, tables=0x7f25dc0171e8, fields=..., conds=conds@entry=0x7f25dc017bd8, og_num=og_num@entry=0, order=order@entry=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x7f25dc0187a0, unit=0x7f25dc005250, select_lex=0x7f25dc016ba8) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_select.cc:5328
      #23 0x0000564840212ab2 in handle_select (thd=thd@entry=0x7f25dc000d58, lex=lex@entry=0x7f25dc005170, result=result@entry=0x7f25dc0187a0, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_select.cc:624
      #24 0x000056483ffe8c74 in execute_sqlcom_select (thd=thd@entry=0x7f25dc000d58, all_tables=0x7f25dc0171e8) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_parse.cc:6151
      #25 0x0000564840011862 in mysql_execute_command (thd=thd@entry=0x7f25dc000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_parse.cc:3953
      #26 0x0000564840026828 in mysql_parse (thd=thd@entry=0x7f25dc000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7f25f51f7440) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_parse.cc:7873
      #27 0x000056484002d1fc in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f25dc000d58, packet=packet@entry=0x7f25dc00b3c9 "SELECT v FROM t WHERE v = VEC_FromText('[1]')", packet_length=packet_length@entry=45, blocking=blocking@entry=true) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_parse.cc:1892
      #28 0x00005648400359ed in do_command (thd=0x7f25dc000d58, blocking=blocking@entry=true) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_parse.cc:1405
      #29 0x0000564840530960 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x564848487448, put_in_cache=put_in_cache@entry=true) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_connect.cc:1448
      #30 0x0000564840531816 in handle_one_connection (arg=0x564848487448) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_connect.cc:1350
      #31 0x00005648416ff093 in pfs_spawn_thread (arg=0x56484841bca8) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/storage/perfschema/pfs.cc:2198
      #32 0x00007f260d0a8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #33 0x00007f260d12861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      or, with a slightly different test case (with a primary key in the table):

      --source include/have_innodb.inc
       
      CREATE TABLE t (pk INT PRIMARY KEY, v VECTOR(1), KEY(v)) ENGINE=InnoDB;
      SELECT v FROM t WHERE v = VEC_FromText('[1]');
       
      # Cleanup
      DROP TABLE t;
      

      debug ubsan

      2024-10-18 16:48:48 4 [Warning] InnoDB: Using a partial-field key prefix in search, index `v` of table `test`.`t`. Last data field length 4 bytes, key ptr now exceeds key end by 2 bytes. Key value in the MariaDB format:
       len 7; hex 0004000000803f; asc       ?;
      mariadbd: /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/storage/innobase/row/row0sel.cc:2770: void row_sel_convert_mysql_key_to_innobase(dtuple_t*, byte*, ulint, dict_index_t*, const byte*, ulint): Assertion `0' failed.
      241018 16:48:48 [ERROR] mysqld got signal 6 ;
       
      #10 0x00007f05bd053e32 in __GI___assert_fail (assertion=0x5601cc0b5ab9 "0", file=0x5601cc1bdff0 "/data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/storage/innobase/row/row0sel.cc", line=2770, function=0x5601cc1bf170 "void row_sel_convert_mysql_key_to_innobase(dtuple_t*, byte*, ulint, dict_index_t*, const byte*, ulint)") at ./assert/assert.c:101
      #11 0x00005601cb7b7297 in row_sel_convert_mysql_key_to_innobase (tuple=tuple@entry=0x7f058c193c68, buf=0x7f058c1028a4 "\005\177", buf@entry=0x7f058c1028a0 "%\245?\200\005\177", buf_len=buf_len@entry=4, index=index@entry=0x7f058c11c9b8, key_ptr=0x7f058c105e01 "\245\245\245\217\217\217\217", key_ptr@entry=0x7f058c105df8 "", key_len=key_len@entry=7) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/storage/innobase/row/row0sel.cc:2770
      #12 0x00005601cb404ea0 in ha_innobase::records_in_range (this=0x7f058c101de0, keynr=<optimized out>, min_key=<optimized out>, max_key=0x7f05a4beb080, pages=0x7f05a4beaff0) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/storage/innobase/handler/ha_innodb.cc:14280
      #13 0x00005601ca0ec508 in handler::multi_range_read_info_const (this=this@entry=0x7f058c101de0, keyno=keyno@entry=1, seq=seq@entry=0x7f05a4beb270, seq_init_param=seq_init_param@entry=0x7f05a4beb2a0, n_ranges_arg=n_ranges_arg@entry=0, bufsz=bufsz@entry=0x7f05a4beb128, flags=0x7f05a4beb12c, top_limit=18446744073709551615, cost=0x7f05a4beb8f0) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/multi_range_read.cc:247
      #14 0x00005601ca0f8335 in DsMrr_impl::dsmrr_info_const (this=this@entry=0x7f058c102368, keyno=keyno@entry=1, seq=seq@entry=0x7f05a4beb270, seq_init_param=seq_init_param@entry=0x7f05a4beb2a0, n_ranges=n_ranges@entry=0, bufsz=bufsz@entry=0x7f05a4beb8ac, flags=0x7f05a4beb8a8, limit=18446744073709551615, cost=0x7f05a4beb8f0) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/multi_range_read.cc:1783
      #15 0x00005601cb3eca2c in ha_innobase::multi_range_read_info_const (this=0x7f058c101de0, keyno=1, seq=0x7f05a4beb270, seq_init_param=0x7f05a4beb2a0, n_ranges=0, bufsz=0x7f05a4beb8ac, flags=0x7f05a4beb8a8, limit=18446744073709551615, cost=0x7f05a4beb8f0) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/storage/innobase/handler/ha_innodb.cc:20141
      #16 0x00005601c9673e57 in check_quick_select (param=param@entry=0x7f05a4bebc90, idx=idx@entry=0, limit=limit@entry=18446744073709551615, index_only=index_only@entry=true, tree=tree@entry=0x7f058c105ea0, update_tbl_stats=update_tbl_stats@entry=true, mrr_flags=0x7f05a4beb8a8, bufsize=0x7f05a4beb8ac, cost=0x7f05a4beb8f0, is_ror_scan=0x7f05a4beb8a7) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/opt_range.cc:12095
      #17 0x00005601c967b9e0 in get_key_scans_params (param=param@entry=0x7f05a4bebc90, tree=tree@entry=0x7f058c105e18, index_read_must_be_used=index_read_must_be_used@entry=false, for_range_access=for_range_access@entry=true, read_time=read_time@entry=0.0067926050000000002, limit=limit@entry=18446744073709551615, using_table_scan=using_table_scan@entry=true) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/opt_range.cc:7853
      #18 0x00005601c9696817 in SQL_SELECT::test_quick_select (this=this@entry=0x7f058c06bce0, thd=thd@entry=0x7f058c000d58, keys_to_use=..., prev_tables=prev_tables@entry=0, limit=limit@entry=18446744073709551615, force_quick_range=force_quick_range@entry=false, ordered_output=false, remove_false_parts_of_where=true, only_single_index_range_scan=false, note_unusable_keys=<optimized out>) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/opt_range.cc:3001
      #19 0x00005601c9b96196 in get_quick_record_count (thd=0x7f058c000d58, select=select@entry=0x7f058c06bce0, table=0x7f058c211ee8, keys=keys@entry=0x7f058c019570, limit=18446744073709551615, quick_count=quick_count@entry=0x7f05a4bec5e0) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_select.cc:5403
      #20 0x00005601c9ca8df3 in make_join_statistics (join=join@entry=0x7f058c0187d8, tables_list=..., keyuse_array=keyuse_array@entry=0x7f058c018b38) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_select.cc:6180
      #21 0x00005601c9cb06b5 in JOIN::optimize_inner (this=this@entry=0x7f058c0187d8) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_select.cc:2687
      #22 0x00005601c9cb1090 in JOIN::optimize (this=this@entry=0x7f058c0187d8) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_select.cc:1985
      #23 0x00005601c9cb1d91 in mysql_select (thd=thd@entry=0x7f058c000d58, tables=0x7f058c0171e8, fields=..., conds=conds@entry=0x7f058c017bd8, og_num=og_num@entry=0, order=order@entry=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x7f058c0187b0, unit=0x7f058c005250, select_lex=0x7f058c016ba8) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_select.cc:5328
      #24 0x00005601c9cb2ab2 in handle_select (thd=thd@entry=0x7f058c000d58, lex=lex@entry=0x7f058c005170, result=result@entry=0x7f058c0187b0, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_select.cc:624
      #25 0x00005601c9a88c74 in execute_sqlcom_select (thd=thd@entry=0x7f058c000d58, all_tables=0x7f058c0171e8) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_parse.cc:6151
      #26 0x00005601c9ab1862 in mysql_execute_command (thd=thd@entry=0x7f058c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_parse.cc:3953
      #27 0x00005601c9ac6828 in mysql_parse (thd=thd@entry=0x7f058c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7f05a4bed440) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_parse.cc:7873
      #28 0x00005601c9acd1fc in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f058c000d58, packet=packet@entry=0x7f058c00b3c9 "SELECT v FROM t WHERE v = VEC_FromText('[1]')", packet_length=packet_length@entry=45, blocking=blocking@entry=true) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_parse.cc:1892
      #29 0x00005601c9ad59ed in do_command (thd=0x7f058c000d58, blocking=blocking@entry=true) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_parse.cc:1405
      #30 0x00005601c9fd0960 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5601d032c4b8, put_in_cache=put_in_cache@entry=true) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_connect.cc:1448
      #31 0x00005601c9fd1816 in handle_one_connection (arg=0x5601d032c4b8) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/sql/sql_connect.cc:1350
      #32 0x00005601cb19f093 in pfs_spawn_thread (arg=0x5601d02be088) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-ubsan/storage/perfschema/pfs.cc:2198
      #33 0x00007f05bd0a8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #34 0x00007f05bd12861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.