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

Server crash or assertion failure in join_read_first upon using vector distance in group by

    XMLWordPrintable

Details

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

    Description

      create or replace table t (a int, v vector(1) not null, primary key (a), vector(v));
      insert into t values (1,vec_fromtext('[-1]')),(2,vec_fromtext('[1]')),(3,vec_fromtext('[2]'));
       
      select vec_distance_euclidean(v,vec_fromtext('[0]')) d, count(*) from t group by d order by d limit 2;
       
      # Cleanup
      drop table t;
      

      3e03a45aa4c69e5aa76c9396547797a895a98edc debug

      mariadbd: /data/bld/preview-vector-ubsan-bb-11.6-MDEV-32887-vector/sql/sql_select.cc:25151: int join_read_first(JOIN_TAB*): Assertion `tab->join->order' failed.
      241104 13:46:47 [ERROR] mysqld got signal 6 ;
       
      #10 0x00007f3588e53e32 in __GI___assert_fail (assertion=0x562ceefec09a "tab->join->order", file=0x562ceefecc20 "/data/bld/preview-vector-ubsan-bb-11.6-MDEV-32887-vector/sql/sql_select.cc", line=25151, function=0x562ceefefc40 "int join_read_first(JOIN_TAB*)") at ./assert/assert.c:101
      #11 0x0000562cecd360ee in join_read_first (tab=0x7f357021e410) at /data/bld/preview-vector-ubsan-bb-11.6-MDEV-32887-vector/sql/sql_select.cc:25151
      #12 0x0000562cecc9f37e in sub_select (join=0x7f3570018b58, join_tab=0x7f357021e410, end_of_records=false) at /data/bld/preview-vector-ubsan-bb-11.6-MDEV-32887-vector/sql/sql_select.cc:24041
      #13 0x0000562cecd0706c in do_select (join=join@entry=0x7f3570018b58, procedure=<optimized out>) at /data/bld/preview-vector-ubsan-bb-11.6-MDEV-32887-vector/sql/sql_select.cc:23555
      #14 0x0000562cecd88e1c in JOIN::exec_inner (this=this@entry=0x7f3570018b58) at /data/bld/preview-vector-ubsan-bb-11.6-MDEV-32887-vector/sql/sql_select.cc:5035
      #15 0x0000562cecd892a6 in JOIN::exec (this=this@entry=0x7f3570018b58) at /data/bld/preview-vector-ubsan-bb-11.6-MDEV-32887-vector/sql/sql_select.cc:4818
      #16 0x0000562cecd8311f in mysql_select (thd=thd@entry=0x7f3570000d58, tables=0x7f3570017778, fields=..., conds=conds@entry=0x0, og_num=og_num@entry=2, order=order@entry=0x7f35700189d0, group=0x7f3570017fd8, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x7f3570018b30, unit=0x7f3570005278, select_lex=0x7f3570016c68) at /data/bld/preview-vector-ubsan-bb-11.6-MDEV-32887-vector/sql/sql_select.cc:5351
      #17 0x0000562cecd83cc4 in handle_select (thd=thd@entry=0x7f3570000d58, lex=lex@entry=0x7f3570005198, result=result@entry=0x7f3570018b30, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/bld/preview-vector-ubsan-bb-11.6-MDEV-32887-vector/sql/sql_select.cc:633
      #18 0x0000562cecb570e2 in execute_sqlcom_select (thd=thd@entry=0x7f3570000d58, all_tables=0x7f3570017778) at /data/bld/preview-vector-ubsan-bb-11.6-MDEV-32887-vector/sql/sql_parse.cc:6166
      #19 0x0000562cecb804e6 in mysql_execute_command (thd=thd@entry=0x7f3570000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/bld/preview-vector-ubsan-bb-11.6-MDEV-32887-vector/sql/sql_parse.cc:3955
      #20 0x0000562cecb95415 in mysql_parse (thd=thd@entry=0x7f3570000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7f3581203420) at /data/bld/preview-vector-ubsan-bb-11.6-MDEV-32887-vector/sql/sql_parse.cc:7888
      #21 0x0000562cecb9bde9 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f3570000d58, packet=packet@entry=0x7f357000b419 "", packet_length=packet_length@entry=101, blocking=blocking@entry=true) at /data/bld/preview-vector-ubsan-bb-11.6-MDEV-32887-vector/sql/sql_parse.cc:1892
      #22 0x0000562cecba45da in do_command (thd=0x7f3570000d58, blocking=blocking@entry=true) at /data/bld/preview-vector-ubsan-bb-11.6-MDEV-32887-vector/sql/sql_parse.cc:1405
      #23 0x0000562ced0a4dad in do_handle_one_connection (connect=<optimized out>, connect@entry=0x562cf43e7fe8, put_in_cache=put_in_cache@entry=true) at /data/bld/preview-vector-ubsan-bb-11.6-MDEV-32887-vector/sql/sql_connect.cc:1448
      #24 0x0000562ced0a5c69 in handle_one_connection (arg=0x562cf43e7fe8) at /data/bld/preview-vector-ubsan-bb-11.6-MDEV-32887-vector/sql/sql_connect.cc:1350
      #25 0x0000562cee28a985 in pfs_spawn_thread (arg=0x562cf4379ec8) at /data/bld/preview-vector-ubsan-bb-11.6-MDEV-32887-vector/storage/perfschema/pfs.cc:2198
      #26 0x00007f3588ea8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #27 0x00007f3588f2861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      3e03a45aa4c69e5aa76c9396547797a895a98edc non-debug

      #2  <signal handler called>
      #3  0x000055d8e6367d16 in join_read_first (tab=0x7f6c841a8210) at /data/bld/preview-vector-rel-bb-11.6-MDEV-32887-vector/sql/sql_select.cc:25154
      #4  0x000055d8e63576b1 in sub_select (join=0x7f6c84014e78, join_tab=0x7f6c841a8210, end_of_records=<optimized out>) at /data/bld/preview-vector-rel-bb-11.6-MDEV-32887-vector/sql/sql_select.cc:24041
      #5  0x000055d8e638ad76 in do_select (procedure=<optimized out>, join=0x7f6c84014e78) at /data/bld/preview-vector-rel-bb-11.6-MDEV-32887-vector/sql/sql_select.cc:23555
      #6  JOIN::exec_inner (this=this@entry=0x7f6c84014e78) at /data/bld/preview-vector-rel-bb-11.6-MDEV-32887-vector/sql/sql_select.cc:5035
      #7  0x000055d8e638b165 in JOIN::exec (this=this@entry=0x7f6c84014e78) at /data/bld/preview-vector-rel-bb-11.6-MDEV-32887-vector/sql/sql_select.cc:4818
      #8  0x000055d8e63891a8 in mysql_select (thd=thd@entry=0x7f6c84000c68, tables=<optimized out>, fields=..., conds=<optimized out>, og_num=<optimized out>, order=<optimized out>, group=<optimized out>, having=<optimized out>, proc_param=<optimized out>, select_options=<optimized out>, result=<optimized out>, unit=<optimized out>, select_lex=<optimized out>) at /data/bld/preview-vector-rel-bb-11.6-MDEV-32887-vector/sql/sql_select.cc:5351
      #9  0x000055d8e6389974 in handle_select (thd=thd@entry=0x7f6c84000c68, lex=lex@entry=0x7f6c84004ee0, result=result@entry=0x7f6c84014e50, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/bld/preview-vector-rel-bb-11.6-MDEV-32887-vector/sql/sql_select.cc:633
      #10 0x000055d8e62f8fa0 in execute_sqlcom_select (thd=thd@entry=0x7f6c84000c68, all_tables=0x7f6c84013a98) at /data/bld/preview-vector-rel-bb-11.6-MDEV-32887-vector/sql/sql_parse.cc:6166
      #11 0x000055d8e6308b28 in mysql_execute_command (thd=thd@entry=0x7f6c84000c68, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/bld/preview-vector-rel-bb-11.6-MDEV-32887-vector/sql/sql_parse.cc:3955
      #12 0x000055d8e630a1a6 in mysql_parse (thd=0x7f6c84000c68, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /data/bld/preview-vector-rel-bb-11.6-MDEV-32887-vector/sql/sql_parse.cc:7888
      #13 0x000055d8e630ca3d in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f6c84000c68, packet=packet@entry=0x7f6c840088b9 "", packet_length=packet_length@entry=101, blocking=blocking@entry=true) at /data/bld/preview-vector-rel-bb-11.6-MDEV-32887-vector/sql/sql_parse.cc:1991
      #14 0x000055d8e630e97f in do_command (thd=0x7f6c84000c68, blocking=blocking@entry=true) at /data/bld/preview-vector-rel-bb-11.6-MDEV-32887-vector/sql/sql_parse.cc:1405
      #15 0x000055d8e6440e27 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55d8e9a8f578, put_in_cache=put_in_cache@entry=true) at /data/bld/preview-vector-rel-bb-11.6-MDEV-32887-vector/sql/sql_connect.cc:1448
      #16 0x000055d8e64411ad in handle_one_connection (arg=arg@entry=0x55d8e9a8f578) at /data/bld/preview-vector-rel-bb-11.6-MDEV-32887-vector/sql/sql_connect.cc:1350
      #17 0x000055d8e67fca2c in pfs_spawn_thread (arg=0x55d8e9a47f98) at /data/bld/preview-vector-rel-bb-11.6-MDEV-32887-vector/storage/perfschema/pfs.cc:2198
      #18 0x00007f6ca58a8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #19 0x00007f6ca592861c 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.