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

Assertion `0' failed in Type_handler_row::subquery_type_allows_materialization

    XMLWordPrintable

Details

    Description

      USE test;
      CREATE TEMPORARY TABLE t(a INT,b INT);
      SET SESSION in_predicate_conversion_threshold=2;
      SELECT 1 FROM t WHERE ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,1)));
      

      Leads to:

      10.5.4 8569dac1ec9f6853a0b2f3ea9bcbda67644ead24

      mysqld: /test/10.5_dbg/sql/sql_type.h:4153: virtual bool Type_handler_row::subquery_type_allows_materialization(const Item*, const Item*) const: Assertion `0' failed.
      

      10.5.4 8569dac1ec9f6853a0b2f3ea9bcbda67644ead24

      Core was generated by `/test/MD260520-mariadb-10.5.4-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      [Current thread is 1 (Thread 0x14b877a9d700 (LWP 1739556))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x00005601a6822d7a in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:518
      #2  0x00005601a5fc8385 in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:330
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #5  0x000014b8761e1801 in __GI_abort () at abort.c:79
      #6  0x000014b8761d139a in __assert_fail_base (fmt=0x14b8763587d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5601a6b5b2c4 "0", file=file@entry=0x5601a697a97f "/test/10.5_dbg/sql/sql_type.h", line=line@entry=4153, function=function@entry=0x5601a69fb860 <Type_handler_row::subquery_type_allows_materialization(Item const*, Item const*) const::__PRETTY_FUNCTION__> "virtual bool Type_handler_row::subquery_type_allows_materialization(const Item*, const Item*) const") at assert.c:92
      #7  0x000014b8761d1412 in __GI___assert_fail (assertion=assertion@entry=0x5601a6b5b2c4 "0", file=file@entry=0x5601a697a97f "/test/10.5_dbg/sql/sql_type.h", line=line@entry=4153, function=function@entry=0x5601a69fb860 <Type_handler_row::subquery_type_allows_materialization(Item const*, Item const*) const::__PRETTY_FUNCTION__> "virtual bool Type_handler_row::subquery_type_allows_materialization(const Item*, const Item*) const") at assert.c:101
      #8  0x00005601a5f07ad0 in Type_handler_row::subquery_type_allows_materialization (this=<optimized out>, inner=<optimized out>, outer=<optimized out>) at /test/10.5_dbg/sql/sql_type.h:4153
      #9  0x00005601a5f237e6 in cmp_row_types (item2=0x14b8544756b0, item1=0x14b8544752d0) at /test/10.5_dbg/sql/sql_tvc.cc:832
      #10 Item_func_in::in_predicate_to_in_subs_transformer (this=0x14b854475ba0, thd=thd@entry=0x14b854415088, arg=arg@entry=0x0) at /test/10.5_dbg/sql/sql_tvc.cc:899
      #11 0x00005601a60520fd in Item_func::transform (this=0x14b854475ba0, thd=0x14b854415088, transformer=NULL, argument=0x0) at /test/10.5_dbg/sql/item_func.cc:519
      #12 0x00005601a5f239bc in JOIN::transform_in_predicates_into_in_subq (this=this@entry=0x14b854476630, thd=0x14b854415088) at /test/10.5_dbg/sql/sql_tvc.cc:1074
      #13 0x00005601a5d95bf1 in JOIN::optimize_inner (this=this@entry=0x14b854476630) at /test/10.5_dbg/sql/sql_select.cc:1829
      #14 0x00005601a5d9996c in JOIN::optimize (this=this@entry=0x14b854476630) at /test/10.5_dbg/sql/sql_select.cc:1606
      #15 0x00005601a5d9a2f9 in mysql_select (thd=thd@entry=0x14b854415088, tables=<optimized out>, fields=..., conds=0x14b854475ba0, og_num=0, order=<optimized out>, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14b854476608, unit=0x14b8544190a0, select_lex=0x14b854474180) at /test/10.5_dbg/sql/sql_select.cc:4655
      #16 0x00005601a5d9a675 in handle_select (thd=thd@entry=0x14b854415088, lex=lex@entry=0x14b854418fd8, result=result@entry=0x14b854476608, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:417
      #17 0x00005601a5d250bf in execute_sqlcom_select (thd=thd@entry=0x14b854415088, all_tables=0x14b8544746d8) at /test/10.5_dbg/sql/sql_parse.cc:6207
      #18 0x00005601a5d1e1f4 in mysql_execute_command (thd=thd@entry=0x14b854415088) at /test/10.5_dbg/sql/sql_parse.cc:3939
      #19 0x00005601a5d2b02e in mysql_parse (thd=thd@entry=0x14b854415088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14b877a9c3d0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:7991
      #20 0x00005601a5d17b42 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14b854415088, packet=packet@entry=0x14b854467089 "SELECT 1 FROM t WHERE ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,1)))", packet_length=packet_length@entry=59, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:1874
      #21 0x00005601a5d1631c in do_command (thd=0x14b854415088) at /test/10.5_dbg/sql/sql_parse.cc:1355
      #22 0x00005601a5e7073f in do_handle_one_connection (connect=<optimized out>, connect@entry=0x14b8568453a8, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411
      #23 0x00005601a5e70e5b in handle_one_connection (arg=arg@entry=0x14b8568453a8) at /test/10.5_dbg/sql/sql_connect.cc:1313
      #24 0x00005601a62d014e in pfs_spawn_thread (arg=0x14b875445888) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #25 0x000014b876ec46db in start_thread (arg=0x14b877a9d700) at pthread_create.c:463
      #26 0x000014b8762c288f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.3.24 (dbg), 10.4.14 (dbg), 10.5.4 (dbg)

      Bug confirmed not present in:
      MariaDB: 10.1.46 (dbg), 10.1.46 (opt), 10.2.33 (dbg), 10.2.33 (opt), 10.3.24 (opt), 10.4.14 (opt), 10.5.4 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)

      Not a regression:

      10.2.33 (dbg)

      10.2.33>SET SESSION in_predicate_conversion_threshold=2;
      ERROR 1193 (HY000): Unknown system variable 'in_predicate_conversion_threshold'
      

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              Roel Roel Van de Paar
              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.