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

Assertion `m_comparator.cmp_type() != ROW_RESULT' failed in bool Item_func_in::compatible_types_scalar_bisection_possible()

Details

    Description

      CREATE TABLE t (a TEXT UNIQUE);
      INSERT INTO t VALUES('1');
      SELECT 1 FROM t WHERE ROW(a, (a,a)) IN ((1, (1,1)),(2, (2,1)));
      

      PS : INSERT statement is not required to reproduce the crash.

      Leads to

      CS 11.8.0 349b8a10274c88887b7b2af24b4200724617611f (Debug)

      mariadbd: /test/mtest/11.8/sql/item_cmpfunc.h:2592: bool Item_func_in::compatible_types_scalar_bisection_possible(): Assertion `m_comparator.cmp_type() != ROW_RESULT' failed.
      

      CS 11.8.0 349b8a10274c88887b7b2af24b4200724617611f (Debug)

      Core was generated by `/test/mtest/MD230125-mariadb-11.8.0-linux-x86_64-dbg/bin/mariadbd --no-defaults'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      [Current thread is 1 (Thread 0x151898f03700 (LWP 3562850))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x0000563260af89c2 in my_write_core (sig=sig@entry=6) at /test/mtest/11.8/mysys/stacktrace.c:424
      #2  0x00005632603af72e in handle_fatal_signal (sig=6) at /test/mtest/11.8/sql/signal_handler.cc:366
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x00001518b61b6859 in __GI_abort () at abort.c:79
      #6  0x00001518b61b6729 in __assert_fail_base (fmt=0x1518b634c588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x563260d29408 "m_comparator.cmp_type() != ROW_RESULT", file=0x563260d255b0 "/test/mtest/11.8/sql/item_cmpfunc.h", line=2592, function=<optimized out>) at assert.c:92
      #7  0x00001518b61c7fd6 in __GI___assert_fail (assertion=assertion@entry=0x563260d29408 "m_comparator.cmp_type() != ROW_RESULT", file=file@entry=0x563260d255b0 "/test/mtest/11.8/sql/item_cmpfunc.h", line=line@entry=2592, function=function@entry=0x563260d29430 "bool Item_func_in::compatible_types_scalar_bisection_possible()") at assert.c:101
      #8  0x000056325ff6d40e in Item_func_in::compatible_types_scalar_bisection_possible (this=0x15186c01c2f0) at /test/mtest/11.8/sql/sql_type.h:7778
      #9  Item_func_in::vcol_subst_transformer (this=0x15186c01c2f0, thd=<optimized out>, arg=0x151898f01530 "H\r") at /test/mtest/11.8/sql/opt_vcol_substitution.cc:458
      #10 0x000056326044922b in Item_func::compile (this=0x15186c01c2f0, thd=0x15186c000d48, analyzer=<optimized out>, arg_p=0x151898f014f8, transformer=&virtual table offset 1240, arg_t=0x151898f01530 "H\r") at /test/mtest/11.8/sql/item_func.cc:570
      #11 0x000056325ff39bd7 in Item::top_level_compile (this=<optimized out>, thd=<optimized out>, analyzer=<optimized out>, arg_p=<optimized out>, transformer=&virtual table offset 1240, arg_t=<optimized out>) at /test/mtest/11.8/sql/item.h:2239
      #12 0x000056325ff6cb75 in subst_vcols_in_item (ctx=ctx@entry=0x151898f01530, item=0x15186c01c2f0, location=location@entry=0x563260d587fc "WHERE") at /test/mtest/11.8/sql/opt_vcol_substitution.cc:168
      #13 0x000056325ff6ccc2 in substitute_indexed_vcols_for_join (join=join@entry=0x15186c01ce30) at /test/mtest/11.8/sql/opt_vcol_substitution.cc:211
      #14 0x0000563260109189 in JOIN::optimize_inner (this=this@entry=0x15186c01ce30) at /test/mtest/11.8/sql/sql_select.cc:2417
      #15 0x000056326010a203 in JOIN::optimize (this=this@entry=0x15186c01ce30) at /test/mtest/11.8/sql/sql_select.cc:1995
      #16 0x000056326010a323 in mysql_select (thd=thd@entry=0x15186c000d48, tables=0x15186c01af48, fields=@0x15186c01ac58: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x15186c01aef8, last = 0x15186c01aef8, elements = 1}, <No data fields>}, conds=0x15186c01c2f0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2164525824, result=0x15186c01ce08, unit=0x15186c005070, select_lex=0x15186c01a9a0) at /test/mtest/11.8/sql/sql_select.cc:5349
      #17 0x000056326010ab1d in handle_select (thd=thd@entry=0x15186c000d48, lex=lex@entry=0x15186c004f90, result=result@entry=0x15186c01ce08, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/mtest/11.8/sql/sql_select.cc:634
      #18 0x0000563260069d85 in execute_sqlcom_select (thd=thd@entry=0x15186c000d48, all_tables=0x15186c01af48) at /test/mtest/11.8/sql/sql_parse.cc:6177
      #19 0x0000563260072858 in mysql_execute_command (thd=thd@entry=0x15186c000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/mtest/11.8/sql/sql_parse.cc:3966
      #20 0x000056326006349f in mysql_parse (thd=thd@entry=0x15186c000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x151898f022b0) at /test/mtest/11.8/sql/sql_parse.cc:7901
      #21 0x000056326007a630 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x15186c000d48, packet=packet@entry=0x15186c00b0c9 "SELECT 1 FROM t WHERE ROW(a, (a,a)) IN ((1, (1,1)),(2, (2,1)))", packet_length=packet_length@entry=62, blocking=blocking@entry=true) at /test/mtest/11.8/sql/sql_class.h:1645
      #22 0x000056326007ce9b in do_command (thd=thd@entry=0x15186c000d48, blocking=blocking@entry=true) at /test/mtest/11.8/sql/sql_parse.cc:1416
      #23 0x00005632601feabd in do_handle_one_connection (connect=<optimized out>, connect@entry=0x56326453cb18, put_in_cache=put_in_cache@entry=true) at /test/mtest/11.8/sql/sql_connect.cc:1415
      #24 0x00005632601fef97 in handle_one_connection (arg=0x56326453cb18) at /test/mtest/11.8/sql/sql_connect.cc:1327
      #25 0x00001518b66e2609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #26 0x00001518b62b3133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Attachments

        Issue Links

          Activity

            The failure started happening after this commit:

            commit 1c2a83179df75b43dad16b4879681b3c1683b85d
            Author: Sergei Petrunia
            Date:   Tue Nov 26 14:50:41 2024 +0200
             
                MDEV-35616: Add basic optimizer support for virtual column
            

            elenst Elena Stepanova added a comment - The failure started happening after this commit: commit 1c2a83179df75b43dad16b4879681b3c1683b85d Author: Sergei Petrunia Date: Tue Nov 26 14:50:41 2024 +0200   MDEV-35616: Add basic optimizer support for virtual column

            People

              psergei Sergei Petrunia
              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.