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

subselect_hash_sj_engine::exec(): Assertion `tmp_table->file->stats.records == 1' failed in subselect_hash_sj_engine::exec

    XMLWordPrintable

    Details

      Description

      USE test;
      SET SQL_MODE='';
      SET SESSION max_heap_table_size=1;
      CREATE TABLE t(a INT,b DOUBLE,c INT,KEY i(b,a)) PARTITION BY HASH(c) PARTITIONS 3;
      INSERT INTO t VALUES(0,0,0);
      INSERT INTO t(b)VALUES (REPEAT(0,0)),(REPEAT(0,0)),(REPEAT(0,0));
      SELECT a FROM t WHERE a NOT IN (SELECT a FROM t);
      

      Leads to:

      10.5.5 e1013725ce0f3f947e728491eef75d9985e8db2f

      mysqld: /test/10.5_dbg/sql/item_subselect.cc:5597: virtual int subselect_hash_sj_engine::exec(): Assertion `tmp_table->file->stats.records == 1' failed.
      

      10.5.5 e1013725ce0f3f947e728491eef75d9985e8db2f

      Core was generated by `/test/MD250620-mariadb-10.5.5-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 0x149fcb8a5700 (LWP 2556884))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x0000559c365e27d0 in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:518
      #2  0x0000559c35d9b47a 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  0x0000149fc9b3b801 in __GI_abort () at abort.c:79
      #6  0x0000149fc9b2b39a in __assert_fail_base (fmt=0x149fc9cb27d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x559c36912bc0 "tmp_table->file->stats.records == 1", file=file@entry=0x559c36911c10 "/test/10.5_dbg/sql/item_subselect.cc", line=line@entry=5597, function=function@entry=0x559c36913b80 <subselect_hash_sj_engine::exec()::__PRETTY_FUNCTION__> "virtual int subselect_hash_sj_engine::exec()") at assert.c:92
      #7  0x0000149fc9b2b412 in __GI___assert_fail (assertion=assertion@entry=0x559c36912bc0 "tmp_table->file->stats.records == 1", file=file@entry=0x559c36911c10 "/test/10.5_dbg/sql/item_subselect.cc", line=line@entry=5597, function=function@entry=0x559c36913b80 <subselect_hash_sj_engine::exec()::__PRETTY_FUNCTION__> "virtual int subselect_hash_sj_engine::exec()") at assert.c:101
      #8  0x0000559c35e94317 in subselect_hash_sj_engine::exec (this=0x149fa758e890) at /test/10.5_dbg/sql/item_subselect.cc:5597
      #9  0x0000559c35e87307 in Item_subselect::exec (this=this@entry=0x149fa7476490) at /test/10.5_dbg/sql/item_subselect.cc:782
      #10 0x0000559c35e8baca in Item_in_subselect::exec (this=0x149fa7476490) at /test/10.5_dbg/sql/item_subselect.cc:962
      #11 0x0000559c35e8623a in Item_in_subselect::val_bool (this=0x149fa7476490) at /test/10.5_dbg/sql/item_subselect.cc:1840
      #12 0x0000559c35a02b3f in Item::val_bool_result (this=<optimized out>) at /test/10.5_dbg/sql/item.h:1566
      #13 0x0000559c35def6d3 in Item_in_optimizer::val_int (this=0x149fa7477da0) at /test/10.5_dbg/sql/item_cmpfunc.cc:1639
      #14 0x0000559c35a02b0f in Item::val_int_result (this=<optimized out>) at /test/10.5_dbg/sql/item.h:1562
      #15 0x0000559c35dbaeee in Item_cache_int::cache_value (this=0x149fa7590ee8) at /test/10.5_dbg/sql/item.cc:9843
      #16 0x0000559c35dde777 in Item_cache_wrapper::cache (this=this@entry=0x149fa7590e20) at /test/10.5_dbg/sql/item.cc:8681
      #17 0x0000559c35dd19c4 in Item_cache_wrapper::val_bool (this=0x149fa7590e20) at /test/10.5_dbg/sql/item.cc:8867
      #18 0x0000559c35de4534 in Item_func_not::val_int (this=0x149fa7476710) at /test/10.5_dbg/sql/item_cmpfunc.cc:202
      #19 0x0000559c35b2ec5e in evaluate_join_record (join=join@entry=0x149fa7477108, join_tab=join_tab@entry=0x149fa74793a0, error=error@entry=0) at /test/10.5_dbg/sql/sql_select.cc:20698
      #20 0x0000559c35b361cf in sub_select (join=0x149fa7477108, join_tab=0x149fa74793a0, end_of_records=<optimized out>) at /test/10.5_dbg/sql/sql_select.cc:20600
      #21 0x0000559c35b6f150 in do_select (procedure=0x0, join=0x149fa7477108) at /test/10.5_dbg/sql/sql_select.cc:20134
      #22 JOIN::exec_inner (this=this@entry=0x149fa7477108) at /test/10.5_dbg/sql/sql_select.cc:4444
      #23 0x0000559c35b6f76b in JOIN::exec (this=this@entry=0x149fa7477108) at /test/10.5_dbg/sql/sql_select.cc:4225
      #24 0x0000559c35b6da80 in mysql_select (thd=thd@entry=0x149fa7415088, tables=<optimized out>, fields=@0x149fa74742b8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x149fa7474720, last = 0x149fa7474720, elements = 1}, <No data fields>}, conds=0x149fa7476710, og_num=0, order=<optimized out>, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x149fa74770e0, unit=0x149fa74190a0, select_lex=0x149fa7474168) at /test/10.5_dbg/sql/sql_select.cc:4649
      #25 0x0000559c35b6ddaf in handle_select (thd=thd@entry=0x149fa7415088, lex=lex@entry=0x149fa7418fd8, result=result@entry=0x149fa74770e0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:417
      #26 0x0000559c35af76c9 in execute_sqlcom_select (thd=thd@entry=0x149fa7415088, all_tables=0x149fa7474768) at /test/10.5_dbg/sql/sql_parse.cc:6211
      #27 0x0000559c35af07c2 in mysql_execute_command (thd=thd@entry=0x149fa7415088) at /test/10.5_dbg/sql/sql_parse.cc:3939
      #28 0x0000559c35afd638 in mysql_parse (thd=thd@entry=0x149fa7415088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x149fcb8a4350, 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:7995
      #29 0x0000559c35aea110 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x149fa7415088, packet=packet@entry=0x149fa7467089 "", packet_length=packet_length@entry=48, 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
      #30 0x0000559c35ae88ea in do_command (thd=0x149fa7415088) at /test/10.5_dbg/sql/sql_parse.cc:1355
      #31 0x0000559c35c4415f in do_handle_one_connection (connect=<optimized out>, connect@entry=0x149faa8d2808, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411
      #32 0x0000559c35c4487b in handle_one_connection (arg=arg@entry=0x149faa8d2808) at /test/10.5_dbg/sql/sql_connect.cc:1313
      #33 0x0000559c360a711c in pfs_spawn_thread (arg=0x149fc8446508) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #34 0x0000149fca81e6db in start_thread (arg=0x149fcb8a5700) at pthread_create.c:463
      #35 0x0000149fc9c1c88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.5.5 (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 (dbg), 10.3.24 (opt), 10.4.14 (dbg), 10.4.14 (opt), 10.5.5 (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)

        Attachments

          Activity

            People

            Assignee:
            varun Varun Gupta
            Reporter:
            Roel Roel Van de Paar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: