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

Assertion `is_last_prefix <= 0' failed in QUICK_GROUP_MIN_MAX_SELECT::get_next

    XMLWordPrintable

Details

    Description

      Note: the test case contains a little bit of everything – versioning, partitioning, views, InnoDB, concurrency, I got rid of whatever I could, the rest seems to play some role, even if only creating the right conditions for race.
      Note: the test case is not deterministic, don't add it to the regression suite, create a better one when the reason of the problem is clear.

      --source include/have_innodb.inc
      --source include/have_partition.inc
       
      # Restoring default values
      SET @lru_depth.save= @@innodb_lru_scan_depth, @stats.save= @@innodb_stats_persistent;
      SET GLOBAL innodb_lru_scan_depth= 1024, innodb_stats_persistent= ON;
       
      CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a VARCHAR(4), PRIMARY KEY (pk)) ENGINE=InnoDB 
      WITH SYSTEM VERSIONING PARTITION BY key (pk) PARTITIONS 2;
       
      CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1;
      INSERT INTO t1 (a) VALUES  
      ('foo'),('bar'),('foo'),('bar'),('foo'),
      ('foo'),('bar'),('foo'),('bar'),('foo'),
      ('foo'),('bar'),('foo'),('bar'),('foo'),
      ('foo'),('bar'),('foo'),('bar'),('foo'),
      ('foo'),('bar'),('foo'),('bar'),('foo'),
      ('foo'),('bar'),('foo'),('bar'),('foo'),
      ('foo'),('bar'),('foo'),('bar'),('foo'),
      ('foo'),('bar'),('foo'),('bar'),('foo');
       
      --connect (con1,localhost,root,,test)
       
      SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
      UPDATE t1 SET a = 'qux';
       
      --let $run= 100
      --disable_result_log
      while ($run)
      {
        --send
          SELECT DISTINCT pk FROM v1;
        --connection default
        INSERT INTO v1 (pk) VALUES (NULL);
        --connection con1
        --reap
        --dec $run
        --echo # $run trials left
      }
      --enable_result_log
       
      # Cleanup
      DROP VIEW v1;
      DROP TABLE t1;
      SET GLOBAL innodb_lru_scan_depth= @lur_depth.save, innodb_stats_persistent= @stats.save;
      

      10.3 ad647cc84

      mysqld: /data/src/10.3/sql/opt_range.cc:14009: virtual int QUICK_GROUP_MIN_MAX_SELECT::get_next(): Assertion `is_last_prefix <= 0' failed.
      180327  3:34:17 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f5a793c8ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x000055a6f2c37025 in QUICK_GROUP_MIN_MAX_SELECT::get_next (this=0x7f5a24023e20) at /data/src/10.3/sql/opt_range.cc:14009
      #9  0x000055a6f2c424e8 in rr_quick (info=0x7f5a2401f080) at /data/src/10.3/sql/records.cc:366
      #10 0x000055a6f274499b in READ_RECORD::read_record (this=0x7f5a2401f080) at /data/src/10.3/sql/records.h:73
      #11 0x000055a6f284bc43 in sub_select (join=0x7f5a24016af8, join_tab=0x7f5a2401efb8, end_of_records=false) at /data/src/10.3/sql/sql_select.cc:19251
      #12 0x000055a6f284b0ff in do_select (join=0x7f5a24016af8, procedure=0x0) at /data/src/10.3/sql/sql_select.cc:18772
      #13 0x000055a6f28241b0 in JOIN::exec_inner (this=0x7f5a24016af8) at /data/src/10.3/sql/sql_select.cc:3987
      #14 0x000055a6f2823648 in JOIN::exec (this=0x7f5a24016af8) at /data/src/10.3/sql/sql_select.cc:3781
      #15 0x000055a6f2824889 in mysql_select (thd=0x7f5a24000b00, tables=0x7f5a24013b98, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748609, result=0x7f5a24016ad8, unit=0x7f5a24004938, select_lex=0x7f5a240050b0) at /data/src/10.3/sql/sql_select.cc:4186
      #16 0x000055a6f2816b67 in handle_select (thd=0x7f5a24000b00, lex=0x7f5a24004870, result=0x7f5a24016ad8, setup_tables_done_option=0) at /data/src/10.3/sql/sql_select.cc:382
      #17 0x000055a6f27e1d31 in execute_sqlcom_select (thd=0x7f5a24000b00, all_tables=0x7f5a24013b98) at /data/src/10.3/sql/sql_parse.cc:6552
      #18 0x000055a6f27d834b in mysql_execute_command (thd=0x7f5a24000b00) at /data/src/10.3/sql/sql_parse.cc:3763
      #19 0x000055a6f27e572a in mysql_parse (thd=0x7f5a24000b00, rawbuf=0x7f5a24013988 "SELECT DISTINCT pk FROM v1", length=26, parser_state=0x7f5a6e6a05d0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8009
      #20 0x000055a6f27d2dde in dispatch_command (command=COM_QUERY, thd=0x7f5a24000b00, packet=0x7f5a2400b251 "", packet_length=26, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1838
      #21 0x000055a6f27d181d in do_command (thd=0x7f5a24000b00) at /data/src/10.3/sql/sql_parse.cc:1383
      #22 0x000055a6f2935c85 in do_handle_one_connection (connect=0x55a6f52a3530) at /data/src/10.3/sql/sql_connect.cc:1402
      #23 0x000055a6f2935a12 in handle_one_connection (arg=0x55a6f52a3530) at /data/src/10.3/sql/sql_connect.cc:1308
      #24 0x000055a6f2dbd029 in pfs_spawn_thread (arg=0x55a6f52e5630) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #25 0x00007f5a7b09f494 in start_thread (arg=0x7f5a6e6a1700) at pthread_create.c:333
      #26 0x00007f5a7948593f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      No visible effect on non-debug build.
      Couldn't check earlier versions because of versioning.

      Attachments

        Issue Links

          Activity

            People

              oleg.smirnov Oleg Smirnov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              10 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.