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

Assertion `table->no_keyread || !table->covering_keys.is_set(tab->index) || table->file->keyread == tab->index' failed in join_read_first after upgrade from 10.1

    XMLWordPrintable

Details

    Description

      10.5 debug 6be56dd1

      mysqld: /data/src/10.5/sql/sql_select.cc:21601: int join_read_first(JOIN_TAB*): Assertion `table->no_keyread || !table->covering_keys.is_set(tab->index) || table->file->keyread == tab->index' failed.
      200330  2:53:04 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f7ee5c84f12 in __GI___assert_fail (assertion=0x55d1672aea60 "table->no_keyread || !table->covering_keys.is_set(tab->index) || table->file->keyread == tab->index", file=0x55d1672ac238 "/data/src/10.5/sql/sql_select.cc", line=21601, function=0x55d1672b2450 <join_read_first(st_join_table*)::__PRETTY_FUNCTION__> "int join_read_first(JOIN_TAB*)") at assert.c:101
      #8  0x000055d166577843 in join_read_first (tab=0x7f7ea00152e8) at /data/src/10.5/sql/sql_select.cc:21599
      #9  0x000055d166575062 in sub_select (join=0x7f7ea0013e50, join_tab=0x7f7ea00152e8, end_of_records=false) at /data/src/10.5/sql/sql_select.cc:20597
      #10 0x000055d166574523 in do_select (join=0x7f7ea0013e50, procedure=0x0) at /data/src/10.5/sql/sql_select.cc:20134
      #11 0x000055d166548399 in JOIN::exec_inner (this=0x7f7ea0013e50) at /data/src/10.5/sql/sql_select.cc:4459
      #12 0x000055d1665474c5 in JOIN::exec (this=0x7f7ea0013e50) at /data/src/10.5/sql/sql_select.cc:4240
      #13 0x000055d166548bf6 in mysql_select (thd=0x7f7ea0000b18, tables=0x7f7ea0012be8, fields=..., conds=0x0, og_num=1, order=0x7f7ea0013c48, group=0x0, having=0x0, proc_param=0x0, select_options=2147748609, result=0x7f7ea0013e28, unit=0x7f7ea0004b20, select_lex=0x7f7ea00125e0) at /data/src/10.5/sql/sql_select.cc:4664
      #14 0x000055d166538766 in handle_select (thd=0x7f7ea0000b18, lex=0x7f7ea0004a58, result=0x7f7ea0013e28, setup_tables_done_option=0) at /data/src/10.5/sql/sql_select.cc:429
      #15 0x000055d1664fd992 in execute_sqlcom_select (thd=0x7f7ea0000b18, all_tables=0x7f7ea0012be8) at /data/src/10.5/sql/sql_parse.cc:6168
      #16 0x000055d1664f444c in mysql_execute_command (thd=0x7f7ea0000b18) at /data/src/10.5/sql/sql_parse.cc:3901
      #17 0x000055d1665028cc in mysql_parse (thd=0x7f7ea0000b18, rawbuf=0x7f7ea0012510 "SELECT DISTINCT col_char FROM t1 ORDER BY col_varchar", length=53, parser_state=0x7f7ee4201520, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:7953
      #18 0x000055d1664ee11d in dispatch_command (command=COM_QUERY, thd=0x7f7ea0000b18, packet=0x7f7ea0008579 "", packet_length=53, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:1840
      #19 0x000055d1664ec853 in do_command (thd=0x7f7ea0000b18) at /data/src/10.5/sql/sql_parse.cc:1359
      #20 0x000055d16668efc5 in do_handle_one_connection (connect=0x55d169f1ce78, put_in_cache=true) at /data/src/10.5/sql/sql_connect.cc:1422
      #21 0x000055d16668ecf4 in handle_one_connection (arg=0x55d169f1ce78) at /data/src/10.5/sql/sql_connect.cc:1319
      #22 0x000055d166bc2950 in pfs_spawn_thread (arg=0x55d169f41328) at /data/src/10.5/storage/perfschema/pfs.cc:2201
      #23 0x00007f7ee7c0d4a4 in start_thread (arg=0x7f7ee4202700) at pthread_create.c:456
      #24 0x00007f7ee5d41d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      To reproduce from scratch:

      • start 10.1 server with --innodb-page-size=32K, other options can be left default;
      • run on 10.1 server

        DROP TABLE IF EXISTS t1;
         
        CREATE TABLE t1 (
          `col_char` binary(2),
          `id` int,
          `col_blob` mediumblob,
          `col_varchar` varbinary(130),
          PRIMARY KEY (`col_varchar`,`col_char`,`id`),
          KEY `id` (`id`)
        ) ENGINE=InnoDB;
         
        INSERT INTO t1 VALUES (NULL,1,NULL,''),(NULL,2,NULL,'');
        

      • shut down the server normally;
      • start 10.5 debug server on the same datadir, with --innodb-page-size=32K, otherwise defaults;
      • (optionally, it does not change the outcome) run mysql_upgrade;
      • run on 10.5 server

        SELECT DISTINCT col_char FROM test.t1 ORDER BY col_varchar;
        

      Alternatively, a datadir pre-created on 10.1 server as described above is attached. Unpack, start 10.5 debug server on it with innodb-page-size=32K and run the SELECT above.

      No crash on a non-debug build, but possibly there can be side-effects later.

      The failure appeared in 10.5 branch after this commit:

      commit eb483c5181ab430877c135c16224284cfc517b3d
      Author: Monty <monty@mariadb.org>
      Date:   Fri Feb 28 12:59:30 2020 +0200
       
          Updated optimizer costs in multi_range_read_info_const() and sql_select.cc
      

      Attachments

        1. data.tar.gz
          1.29 MB
          Elena Stepanova

        Issue Links

          Activity

            People

              monty Michael Widenius
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.