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

Packed keys: assertion failure

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Fix Version/s: N/A
    • Component/s: Optimizer
    • Labels:
      None

      Description

      This testcase fails an assertion:

      --source include/have_sequence.inc
      --source include/have_innodb.inc
       
      CREATE TABLE `t3` (
        `a` varchar(100) DEFAULT NULL,
        `b` varchar(32) DEFAULT NULL,
        `c` int(11) DEFAULT NULL
      ) ENGINE=INNODB DEFAULT CHARSET=utf8;
       
      insert into t3 
      select
        concat('1234567890AB-', 10000 + seq),
        concat('abcd-', 10000 + seq),
        NULL
      from seq_1_to_10000;
       
      set sort_buffer_size=32000;
      select a from t3 order by a;
       
      drop table t3;
      

      Thread 14 "mysqld" received signal SIGABRT, Aborted.
      [Switching to Thread 0x7ffff0057700 (LWP 28493)]
      __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      51      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
      (gdb) wher
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #1  0x00007ffff56bd801 in __GI_abort () at abort.c:79
      #2  0x00007ffff56ad39a in __assert_fail_base (fmt=0x7ffff58347d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x555556ce0080 "sort_length <= param->sort_length", file=file@entry=0x555556cdfa88 "/home/psergey/dev-git2/10.5-packed-sort-keys-cl/sql/filesort.cc", line=line@entry=1738, 
          function=function@entry=0x555556ce0ca0 <read_to_buffer(st_io_cache*, Merge_chunk*, Sort_param*)::__PRETTY_FUNCTION__> "ulong read_to_buffer(IO_CACHE*, Merge_chunk*, Sort_param*)") at assert.c:92
      #3  0x00007ffff56ad412 in __GI___assert_fail (assertion=0x555556ce0080 "sort_length <= param->sort_length", file=0x555556cdfa88 "/home/psergey/dev-git2/10.5-packed-sort-keys-cl/sql/filesort.cc", line=1738, 
          function=0x555556ce0ca0 <read_to_buffer(st_io_cache*, Merge_chunk*, Sort_param*)::__PRETTY_FUNCTION__> "ulong read_to_buffer(IO_CACHE*, Merge_chunk*, Sort_param*)") at assert.c:101
      #4  0x000055555611f5ee in read_to_buffer (fromfile=0x7ffff0055140, buffpek=0x7fffb8088da0, param=0x7ffff00550a0) at /home/psergey/dev-git2/10.5-packed-sort-keys-cl/sql/filesort.cc:1738
      #5  0x0000555556120619 in merge_buffers (param=0x7ffff00550a0, from_file=0x7ffff0055140, to_file=0x7fffb815d9c0, sort_buffer=..., lastbuff=0x7fffb8088d30, Fb=0x7fffb8088d30, Tb=0x7fffb8088da0, flag=1) at /home/psergey/dev-git2/10.5-packed-sort-keys-cl/sql/filesort.cc:2087
      #6  0x00005555561207a6 in merge_index (param=0x7ffff00550a0, sort_buffer=..., buffpek=0x7fffb8088d30, maxbuffer=2, tempfile=0x7ffff0055140, outfile=0x7fffb815d9c0) at /home/psergey/dev-git2/10.5-packed-sort-keys-cl/sql/filesort.cc:2112
      #7  0x000055555611b2fe in filesort (thd=0x7fffb8000d60, table=0x7fffb8159960, filesort=0x7fffb8016a88, tracker=0x7fffb8017160, join=0x7fffb8014cf8, first_table_bit=1) at /home/psergey/dev-git2/10.5-packed-sort-keys-cl/sql/filesort.cc:389
      #8  0x0000555555e6762a in create_sort_index (thd=0x7fffb8000d60, join=0x7fffb8014cf8, tab=0x7fffb8015f78, fsort=0x7fffb8016a88) at /home/psergey/dev-git2/10.5-packed-sort-keys-cl/sql/sql_select.cc:23696
      #9  0x0000555555e617da in st_join_table::sort_table (this=0x7fffb8015f78) at /home/psergey/dev-git2/10.5-packed-sort-keys-cl/sql/sql_select.cc:21435
      #10 0x0000555555e613b5 in join_init_read_record (tab=0x7fffb8015f78) at /home/psergey/dev-git2/10.5-packed-sort-keys-cl/sql/sql_select.cc:21374
      #11 0x0000555555e5f172 in sub_select (join=0x7fffb8014cf8, join_tab=0x7fffb8015f78, end_of_records=false) at /home/psergey/dev-git2/10.5-packed-sort-keys-cl/sql/sql_select.cc:20451
      #12 0x0000555555e5e662 in do_select (join=0x7fffb8014cf8, procedure=0x0) at /home/psergey/dev-git2/10.5-packed-sort-keys-cl/sql/sql_select.cc:19992
      #13 0x0000555555e32cbf in JOIN::exec_inner (this=0x7fffb8014cf8) at /home/psergey/dev-git2/10.5-packed-sort-keys-cl/sql/sql_select.cc:4457
      #14 0x0000555555e31deb in JOIN::exec (this=0x7fffb8014cf8) at /home/psergey/dev-git2/10.5-packed-sort-keys-cl/sql/sql_select.cc:4238
      #15 0x0000555555e3351c in mysql_select (thd=0x7fffb8000d60, tables=0x7fffb8013b38, fields=..., conds=0x0, og_num=1, order=0x7fffb8014b70, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fffb8014cd0, unit=0x7fffb8004ca8, select_lex=0x7fffb8013538)
      

      (gdb) list
      1733            {
      1734              uint sort_length=  param->using_packed_sortkeys() ?
      1735                                 Sort_keys::read_sortkey_length(record) :
      1736                                 param->sort_length;
      1737
      1738              DBUG_ASSERT(sort_length <= param->sort_length);
      1739
      1740              if (record + sort_length + size_of_addon_length >
      1741                  buffpek->buffer_end())
      1742                break;                                // Incomplete record.
      (gdb) p sort_length
      $1 = 360330348
      (gdb) p param->sort_length
      $2 = 307
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              varun Varun Gupta (Inactive)
              Reporter:
              psergei Sergei Petrunia
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.