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

Assertion `inited == RND' failed in handler::ha_rnd_pos and handler::ha_rnd_end upon UPDATE and CHECKSUM TABLE respectively

    XMLWordPrintable

    Details

      Description

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (
          c1 int,
          c2 int,
          c3 int,
          c4 int,
          c5 int,
          key (c1),
          key (c5)
      ) ENGINE=InnoDB;
       
      INSERT INTO t1 VALUES
          (NULL, 15, NULL, 2012, NULL) ,
          (NULL, 12, 2008, 2004, 2021) ,
          (2003, 11, 2031, NULL, NULL);
       
      CREATE TABLE t2 SELECT c2 AS f FROM t1;
      UPDATE t2 SET f = 0 WHERE f NOT IN ( SELECT c2 AS c1 FROM t1 WHERE c5 IS NULL AND c1 IS NULL );
       
      # Cleanup
      DROP TABLE t1, t2;
      

      10.2 4a012ce2

      mysqld: /data/src/10.2/sql/handler.cc:2686: int handler::ha_rnd_pos(uchar*, uchar*): Assertion `inited == RND' failed.
      200103  2:52:58 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f4fe1f28f12 in __GI___assert_fail (assertion=0x55dd2d5e931b "inited == RND", file=0x55dd2d5e82d9 "/data/src/10.2/sql/handler.cc", line=2686, function=0x55dd2d5ea940 <handler::ha_rnd_pos(unsigned char*, unsigned char*)::__PRETTY_FUNCTION__> "int handler::ha_rnd_pos(uchar*, uchar*)") at assert.c:101
      #8  0x000055dd2ccfb9cb in handler::ha_rnd_pos (this=0x7f4f88186368, buf=0x7f4f8800ac70 "\377", pos=0x7f4f880355e8 "") at /data/src/10.2/sql/handler.cc:2686
      #9  0x000055dd2ce54285 in QUICK_ROR_INTERSECT_SELECT::get_next (this=0x7f4f8808c500) at /data/src/10.2/sql/opt_range.cc:11289
      #10 0x000055dd2ce65a3a in rr_quick (info=0x7f4f88017be8) at /data/src/10.2/sql/records.cc:365
      #11 0x000055dd2cae8605 in join_init_read_record (tab=0x7f4f88017b20) at /data/src/10.2/sql/sql_select.cc:19786
      #12 0x000055dd2cae63a3 in sub_select (join=0x7f4f88014af8, join_tab=0x7f4f88017b20, end_of_records=false) at /data/src/10.2/sql/sql_select.cc:18857
      #13 0x000055dd2cae598c in do_select (join=0x7f4f88014af8, procedure=0x0) at /data/src/10.2/sql/sql_select.cc:18404
      #14 0x000055dd2cabf483 in JOIN::exec_inner (this=0x7f4f88014af8) at /data/src/10.2/sql/sql_select.cc:3629
      #15 0x000055dd2cabe93e in JOIN::exec (this=0x7f4f88014af8) at /data/src/10.2/sql/sql_select.cc:3424
      #16 0x000055dd2cdc37a6 in subselect_single_select_engine::exec (this=0x7f4f88014828) at /data/src/10.2/sql/item_subselect.cc:3901
      #17 0x000055dd2cdb860f in Item_subselect::exec (this=0x7f4f88014628) at /data/src/10.2/sql/item_subselect.cc:722
      #18 0x000055dd2cdb8c28 in Item_in_subselect::exec (this=0x7f4f88014628) at /data/src/10.2/sql/item_subselect.cc:902
      #19 0x000055dd2cdbb96f in Item_in_subselect::val_bool (this=0x7f4f88014628) at /data/src/10.2/sql/item_subselect.cc:1773
      #20 0x000055dd2c9b0527 in Item::val_bool_result (this=0x7f4f88014628) at /data/src/10.2/sql/item.h:1273
      #21 0x000055dd2cd370e6 in Item_in_optimizer::val_int (this=0x7f4f88015138) at /data/src/10.2/sql/item_cmpfunc.cc:1671
      #22 0x000055dd2cd09b79 in Item::val_bool (this=0x7f4f88015138) at /data/src/10.2/sql/item.cc:112
      #23 0x000055dd2cd32d20 in Item_func_not::val_int (this=0x7f4f88014868) at /data/src/10.2/sql/item_cmpfunc.cc:307
      #24 0x000055dd2cb6cc1a in SQL_SELECT::skip_record (this=0x7f4f88037340, thd=0x7f4f88000af0) at /data/src/10.2/sql/opt_range.h:1632
      #25 0x000055dd2cb66c20 in mysql_update (thd=0x7f4f88000af0, table_list=0x7f4f880125b0, fields=..., values=..., conds=0x7f4f88014868, order_num=0, order=0x0, limit=18446744073709551615, handle_duplicates=DUP_ERROR, ignore=false, found_return=0x7f4fdc574870, updated_return=0x7f4fdc574920) at /data/src/10.2/sql/sql_update.cc:753
      #26 0x000055dd2ca76d45 in mysql_execute_command (thd=0x7f4f88000af0) at /data/src/10.2/sql/sql_parse.cc:4014
      #27 0x000055dd2ca82bb4 in mysql_parse (thd=0x7f4f88000af0, rawbuf=0x7f4f88012448 "UPDATE t2 SET f = 0 WHERE f NOT IN ( SELECT c2 AS c1 FROM t1 WHERE c5 IS NULL AND c1 IS NULL )", length=94, parser_state=0x7f4fdc575200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7740
      #28 0x000055dd2ca70ecf in dispatch_command (command=COM_QUERY, thd=0x7f4f88000af0, packet=0x7f4f88096351 "UPDATE t2 SET f = 0 WHERE f NOT IN ( SELECT c2 AS c1 FROM t1 WHERE c5 IS NULL AND c1 IS NULL )", packet_length=94, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1831
      #29 0x000055dd2ca6f823 in do_command (thd=0x7f4f88000af0) at /data/src/10.2/sql/sql_parse.cc:1384
      #30 0x000055dd2cbc5407 in do_handle_one_connection (connect=0x55dd2f614920) at /data/src/10.2/sql/sql_connect.cc:1336
      #31 0x000055dd2cbc5172 in handle_one_connection (arg=0x55dd2f614920) at /data/src/10.2/sql/sql_connect.cc:1241
      #32 0x000055dd2d3f1fa6 in pfs_spawn_thread (arg=0x55dd2f61f710) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #33 0x00007f4fe3eb14a4 in start_thread (arg=0x7f4fdc576700) at pthread_create.c:456
      #34 0x00007f4fe1fe5d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Reproducible on 10.2-10.5.
      Not reproducible on 10.1.
      Couldn't reproduce with MyISAM instead of InnoDB and otherwise the same test case.
      Couldn't reproduce with SELECT instead of UPDATE.
      No obvious problem on a non-debug build.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sanja Oleksandr Byelkin
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: