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

Assertion `inited==RND' failed in handler::ha_rnd_end

    XMLWordPrintable

Details

    Description

      --source include/have_partition.inc
       
      CREATE TABLE tcount (c INT UNSIGNED);
      INSERT INTO tcount VALUES (0);
       
      CREATE TABLE t (f INT) WITH SYSTEM VERSIONING PARTITION BY system_time LIMIT 1000 (PARTITION p1 HISTORY, PARTITION pn CURRENT);
      INSERT INTO t VALUES (1),(2);
      CREATE TRIGGER tr BEFORE INSERT ON t FOR EACH ROW UPDATE tcount SET c = c + 1;
       
      INSERT INTO t SELECT * FROM t;
       
      # Cleanup
      DROP TABLE tcount, t;
      

      10.3 66d93a80

      mysqld: /data/src/10.3/sql/handler.h:3066: int handler::ha_rnd_end(): Assertion `inited==RND' failed.
      220512 19:44:24 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f4e3e649662 in __GI___assert_fail (assertion=0x564fe1c0b3c1 "inited==RND", file=0x564fe1c0b31b "/data/src/10.3/sql/handler.h", line=3066, function=0x564fe1c0b3cd "int handler::ha_rnd_end()") at assert.c:101
      #8  0x0000564fe0f4c130 in handler::ha_rnd_end (this=0x7f4e2812e458) at /data/src/10.3/sql/handler.h:3066
      #9  0x0000564fe1b3aeff in ha_partition::rnd_end (this=0x7f4e2812dc08) at /data/src/10.3/sql/ha_partition.cc:5087
      #10 0x0000564fe0f4c16d in handler::ha_rnd_end (this=0x7f4e2812dc08) at /data/src/10.3/sql/handler.h:3069
      #11 0x0000564fe0fa887a in handler::ha_index_or_rnd_end (this=0x7f4e2812dc08) at /data/src/10.3/sql/handler.h:3076
      #12 0x0000564fe1056ae9 in st_join_table::cleanup (this=0x7f4e28017530) at /data/src/10.3/sql/sql_select.cc:12758
      #13 0x0000564fe1057b3c in JOIN::cleanup (this=0x7f4e28015428, full=true) at /data/src/10.3/sql/sql_select.cc:13177
      #14 0x0000564fe10577db in JOIN::join_free (this=0x7f4e28015428) at /data/src/10.3/sql/sql_select.cc:13080
      #15 0x0000564fe1068706 in do_select (join=0x7f4e28015428, procedure=0x0) at /data/src/10.3/sql/sql_select.cc:19469
      #16 0x0000564fe103f149 in JOIN::exec_inner (this=0x7f4e28015428) at /data/src/10.3/sql/sql_select.cc:4151
      #17 0x0000564fe103e50c in JOIN::exec (this=0x7f4e28015428) at /data/src/10.3/sql/sql_select.cc:3945
      #18 0x0000564fe103f835 in mysql_select (thd=0x7f4e28000d90, tables=0x7f4e28013378, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=3489925888, result=0x7f4e28015378, unit=0x7f4e28004c40, select_lex=0x7f4e280053d8) at /data/src/10.3/sql/sql_select.cc:4354
      #19 0x0000564fe1030dab in handle_select (thd=0x7f4e28000d90, lex=0x7f4e28004b80, result=0x7f4e28015378, setup_tables_done_option=1073741824) at /data/src/10.3/sql/sql_select.cc:372
      #20 0x0000564fe0ff1088 in mysql_execute_command (thd=0x7f4e28000d90) at /data/src/10.3/sql/sql_parse.cc:4620
      #21 0x0000564fe0ffc0e4 in mysql_parse (thd=0x7f4e28000d90, rawbuf=0x7f4e28012ad8 "INSERT INTO t SELECT * FROM t", length=29, parser_state=0x7f4e386705b0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7870
      #22 0x0000564fe0fe8919 in dispatch_command (command=COM_QUERY, thd=0x7f4e28000d90, packet=0x7f4e28008f31 "INSERT INTO t SELECT * FROM t", packet_length=29, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1852
      #23 0x0000564fe0fe72d7 in do_command (thd=0x7f4e28000d90) at /data/src/10.3/sql/sql_parse.cc:1398
      #24 0x0000564fe1164902 in do_handle_one_connection (connect=0x564fe4230c50) at /data/src/10.3/sql/sql_connect.cc:1403
      #25 0x0000564fe116466d in handle_one_connection (arg=0x564fe4230c50) at /data/src/10.3/sql/sql_connect.cc:1308
      #26 0x0000564fe1b146cc in pfs_spawn_thread (arg=0x564fe42d5a00) at /data/src/10.3/storage/perfschema/pfs.cc:1869
      #27 0x00007f4e3e7e2ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #28 0x00007f4e3e712def in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Reproducible with at least MyISAM and InnoDB.
      No obvious effect on a non-debug build.

      The failure started happening on 10.3 after this commit:

      commit ddc416c60698e1f8939faff0cb09c5b5af8e03a7
      Author: Aleksey Midenkov
      Date:   Mon Apr 25 13:58:41 2022 +0300
       
          MDEV-20077 Warning on full history partition is delayed until next DML statement
          
          Moved LIMIT warning from vers_set_hist_part() to new call
      

      Set to critical as a recent regression.

      Attachments

        Activity

          People

            midenok Aleksey Midenkov
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.