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

Assertion `inited == RND' failed in handler::ha_rnd_next on SELECT

    XMLWordPrintable

Details

    Description

      Looks like almost same crash location as MDEV-21415, though there are differences. May be related.

      USE test;
      SET tmp_table_size=1024;
      SET tmp_disk_table_size=1024;
      CREATE TABLE t1 (x INT(11), row_start BIGINT(20) UNSIGNED GENERATED ALWAYS AS ROW START INVISIBLE, row_end BIGINT(20) UNSIGNED GENERATED ALWAYS AS ROW END INVISIBLE, PERIOD FOR SYSTEM_TIME (row_start, row_end)) WITH SYSTEM VERSIONING;
      INSERT INTO t1 VALUES(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1),(1);
      SELECT * FROM t1 INTERSECT ALL SELECT * FROM t1 INTERSECT ALL SELECT * FROM t1;
      

      Leads to:

      10.5.5 30e7a0a866dce530d8328c6d614e48d39a264f9b (Debug)

      mysqld: /test/10.5_dbg/sql/handler.cc:3052: int handler::ha_rnd_next(uchar*): Assertion `inited == RND' failed.
      

      10.5.5 30e7a0a866dce530d8328c6d614e48d39a264f9b (Debug)

      Core was generated by `/test/MD140720-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 0x14e4d3393700 (LWP 352640))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x00005602357df4d7 in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:518
      #2  0x0000560234f999ba 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  0x000014e4d16298b1 in __GI_abort () at abort.c:79
      #6  0x000014e4d161942a in __assert_fail_base (fmt=0x14e4d17a0a38 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x560235af128d "inited == RND", file=file@entry=0x560235af0c42 "/test/10.5_dbg/sql/handler.cc", line=line@entry=3052, function=function@entry=0x560235af5320 <handler::ha_rnd_next(unsigned char*)::__PRETTY_FUNCTION__> "int handler::ha_rnd_next(uchar*)") at assert.c:92
      #7  0x000014e4d16194a2 in __GI___assert_fail (assertion=assertion@entry=0x560235af128d "inited == RND", file=file@entry=0x560235af0c42 "/test/10.5_dbg/sql/handler.cc", line=line@entry=3052, function=function@entry=0x560235af5320 <handler::ha_rnd_next(unsigned char*)::__PRETTY_FUNCTION__> "int handler::ha_rnd_next(uchar*)") at assert.c:101
      #8  0x0000560234fa1556 in handler::ha_rnd_next (this=0x14e4af08e4a0, buf=0x14e4af05c328 "\377\376") at /test/10.5_dbg/sql/handler.cc:3052
      #9  0x0000560234dd6396 in select_unit_ext::send_eof (this=0x14e4af0775e0) at /test/10.5_dbg/sql/sql_union.cc:832
      #10 0x0000560234d6d6cb in do_select (procedure=<optimized out>, join=0x14e4af079160) at /test/10.5_dbg/sql/sql_select.cc:20230
      #11 JOIN::exec_inner (this=this@entry=0x14e4af079160) at /test/10.5_dbg/sql/sql_select.cc:4450
      #12 0x0000560234d6d8fd in JOIN::exec (this=0x14e4af079160) at /test/10.5_dbg/sql/sql_select.cc:4231
      #13 0x0000560234dd8729 in st_select_lex_unit::exec (this=this@entry=0x14e4af0190a0) at /test/10.5_dbg/sql/sql_union.cc:2196
      #14 0x0000560234ddd379 in mysql_union (thd=thd@entry=0x14e4af015088, lex=lex@entry=0x14e4af018fd8, result=result@entry=0x14e4af0775b8, unit=unit@entry=0x14e4af0190a0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_union.cc:41
      #15 0x0000560234d6be66 in handle_select (thd=thd@entry=0x14e4af015088, lex=lex@entry=0x14e4af018fd8, result=result@entry=0x14e4af0775b8, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:407
      #16 0x0000560234cf47e2 in execute_sqlcom_select (thd=thd@entry=0x14e4af015088, all_tables=0x14e4af074798) at /test/10.5_dbg/sql/sql_parse.cc:6209
      #17 0x0000560234ced8b6 in mysql_execute_command (thd=thd@entry=0x14e4af015088) at /test/10.5_dbg/sql/sql_parse.cc:3931
      #18 0x0000560234cfa752 in mysql_parse (thd=thd@entry=0x14e4af015088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14e4d3392350, 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:7993
      #19 0x0000560234ce7204 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14e4af015088, packet=packet@entry=0x14e4af067089 "SELECT * FROM t1 INTERSECT ALL SELECT * FROM t1 INTERSECT ALL SELECT * FROM t1", packet_length=packet_length@entry=78, 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:1866
      #20 0x0000560234ce59de in do_command (thd=0x14e4af015088) at /test/10.5_dbg/sql/sql_parse.cc:1347
      #21 0x0000560234e41c3b in do_handle_one_connection (connect=<optimized out>, connect@entry=0x14e4b24c7808, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411
      #22 0x0000560234e42357 in handle_one_connection (arg=arg@entry=0x14e4b24c7808) at /test/10.5_dbg/sql/sql_connect.cc:1313
      #23 0x00005602352a5ca8 in pfs_spawn_thread (arg=0x14e4d0046508) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #24 0x000014e4d230c6db in start_thread (arg=0x14e4d3393700) at pthread_create.c:463
      #25 0x000014e4d170aa3f 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

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              Roel Roel Van de Paar
              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.