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

Assertion `order' failed when using vector distance in GROUP BY after setting SQL_BUFFER_RESULT=1

Details

    • Bug
    • Status: Open (View Workflow)
    • Critical
    • Resolution: Unresolved
    • 11.7(EOL), 11.8
    • 11.8
    • Vector search
    • None

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t(v VECTOR (1) NOT NULL,VECTOR INDEX (v)) ENGINE=INNODB;
      SET SQL_BUFFER_RESULT=1;
      INSERT INTO t VALUES(0x31313131); # Optional, fails either way
      SELECT VEC_DISTANCE_EUCLIDEAN(v,0x32323232) d FROM t GROUP BY d;
      
      

      Leads to:

      CS 11.8.0 4c956fa15be059e35f8ed0de85dc72d5827cee4d (Debug)

      mariadbd: /test/11.8_dbg/sql/sql_select.cc:25223: int join_read_first(JOIN_TAB*): Assertion `order' failed.
      

      CS 11.8.0 4c956fa15be059e35f8ed0de85dc72d5827cee4d (Debug)

      Core was generated by `/test/MD270125-mariadb-11.8.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x14b3cd6b2700 (LWP 3516343))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000014b3ef300859 in __GI_abort () at abort.c:79
      #2  0x000014b3ef300729 in __assert_fail_base (fmt=0x14b3ef496588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x56004e4d3c78 "order", file=0x56004e34e490 "/test/11.8_dbg/sql/sql_select.cc", line=25223, function=<optimized out>) at assert.c:92
      #3  0x000014b3ef311fd6 in __GI___assert_fail (assertion=assertion@entry=0x56004e4d3c78 "order", file=file@entry=0x56004e34e490 "/test/11.8_dbg/sql/sql_select.cc", line=line@entry=25223, function=function@entry=0x56004e352980 "int join_read_first(JOIN_TAB*)") at assert.c:101
      #4  0x000056004d708be7 in join_read_first (tab=0x14b3a001de90) at /test/11.8_dbg/sql/sql_select.cc:25223
      #5  0x000056004d6d8f28 in sub_select (join=0x14b3a001c678, join_tab=0x14b3a001de90, end_of_records=false) at /test/11.8_dbg/sql/sql_select.cc:24112
      #6  0x000056004d710cb6 in do_select (procedure=<optimized out>, join=0x14b3a001c678) at /test/11.8_dbg/sql/sql_select.cc:23626
      #7  JOIN::exec_inner (this=this@entry=0x14b3a001c678) at /test/11.8_dbg/sql/sql_select.cc:5046
      #8  0x000056004d711226 in JOIN::exec (this=this@entry=0x14b3a001c678) at /test/11.8_dbg/sql/sql_select.cc:4829
      #9  0x000056004d70f146 in mysql_select (thd=thd@entry=0x14b3a0000d48, tables=0x14b3a001b478, fields=@0x14b3a001aef0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14b3a001b420, last = 0x14b3a001b420, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x14b3a001bcd8, having=0x0, proc_param=0x0, select_options=2164656896, result=0x14b3a001c650, unit=0x14b3a0005070, select_lex=0x14b3a001ac38) at /test/11.8_dbg/sql/sql_select.cc:5362
      #10 0x000056004d70f8e4 in handle_select (thd=thd@entry=0x14b3a0000d48, lex=lex@entry=0x14b3a0004f90, result=result@entry=0x14b3a001c650, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/11.8_dbg/sql/sql_select.cc:633
      #11 0x000056004d66f00c in execute_sqlcom_select (thd=thd@entry=0x14b3a0000d48, all_tables=0x14b3a001b478) at /test/11.8_dbg/sql/sql_parse.cc:6191
      #12 0x000056004d677a72 in mysql_execute_command (thd=thd@entry=0x14b3a0000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.8_dbg/sql/sql_parse.cc:3980
      #13 0x000056004d6687c7 in mysql_parse (thd=thd@entry=0x14b3a0000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14b3cd6b12c0) at /test/11.8_dbg/sql/sql_parse.cc:7915
      #14 0x000056004d67f862 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14b3a0000d48, packet=packet@entry=0x14b3a000b089 "", packet_length=packet_length@entry=63, blocking=blocking@entry=true) at /test/11.8_dbg/sql/sql_class.h:1655
      #15 0x000056004d682114 in do_command (thd=thd@entry=0x14b3a0000d48, blocking=blocking@entry=true) at /test/11.8_dbg/sql/sql_parse.cc:1416
      #16 0x000056004d803384 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x560051f50d58, put_in_cache=put_in_cache@entry=true) at /test/11.8_dbg/sql/sql_connect.cc:1415
      #17 0x000056004d80385d in handle_one_connection (arg=0x560051f50d58) at /test/11.8_dbg/sql/sql_connect.cc:1327
      #18 0x000014b3ef82c609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #19 0x000014b3ef3fd133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 11.8.0 (dbg), 11.8.0 (opt)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.5.28 (dbg), 10.5.28 (opt), 10.6.21 (dbg), 10.6.21 (opt), 10.11.11 (dbg), 10.11.11 (opt), 11.7.2 (dbg), 11.7.2 (opt)

      Attachments

        Activity

          There are no comments yet on this issue.

          People

            sanja Oleksandr Byelkin
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.