Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-5856

TokuDB partitioning and empty sql_mode could lead to a crash on a debug build

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: On Hold
    • Priority: High
    • Resolution: Unresolved
    • Affects Version/s: 8.0.x
    • Fix Version/s: None
    • Component/s: TokuDB

      Description

      sql:

      # mysqld options required for replay: --plugin-load=TokuDB=ha_tokudb.so --sql_mode=
      CREATE DATABASE test;
      USE test;
      CREATE TABLE t1(a int,b int,c CHAR (1),KEY (a),KEY (b),KEY (c,b)) ENGINE=TokuDB PARTITION BY HASH (a) PARTITIONS 5;
      INSERT INTO t1 VALUES(1,2,3),(4,5,6),(7,8,9),(10,11,12);
      select * from t1 where a>=1 and a<3 order by a desc;
      

      gdb:

      Core was generated by `/sdc/PS120819-percona-server-8.0.16-6-linux-x86_64-debug/bin/mysqld --no-defaul'.
      Program terminated with signal 6, Aborted.
      #0  0x00007fcb4fc949d1 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:59
      59        val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
      (gdb) bt
      +bt
      #0  0x00007fcb4fc949d1 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:59
      #1  0x000000000458b897 in my_write_core (sig=6) at /mnt/sdc/release-8.0.16-7_dbg/mysys/stacktrace.cc:284
      #2  0x00000000034ee7b1 in handle_fatal_signal (sig=6) at /mnt/sdc/release-8.0.16-7_dbg/sql/signal_handler.cc:171
      #3  <signal handler called>
      #4  0x00007fcb4dd972c7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:55
      #5  0x00007fcb4dd989b8 in __GI_abort () at abort.c:90
      #6  0x00007fcb4dd900e6 in __assert_fail_base (fmt=0x7fcb4deeb020 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x505ddf2 "0", file=file@entry=0x505e090 "/mnt/sdc/release-8.0.16-7_dbg/sql/partitioning/partition_handler.cc", line=line@entry=2898, function=function@entry=0x5060d20 <Partition_helper::handle_ordered_prev(unsigned char*)::__PRETTY_FUNCTION__> "int Partition_helper::handle_ordered_prev(uchar*)") at assert.c:92
      #7  0x00007fcb4dd90192 in __GI___assert_fail (assertion=0x505ddf2 "0", file=0x505e090 "/mnt/sdc/release-8.0.16-7_dbg/sql/partitioning/partition_handler.cc", line=2898, function=0x5060d20 <Partition_helper::handle_ordered_prev(unsigned char*)::__PRETTY_FUNCTION__> "int Partition_helper::handle_ordered_prev(uchar*)") at assert.c:101
      #8  0x00000000031b1920 in Partition_helper::handle_ordered_prev (this=0x7fcaaa590840, buf=0x7fcaaa4cc828 "\361\001") at /mnt/sdc/release-8.0.16-7_dbg/sql/partitioning/partition_handler.cc:2898
      #9  0x00000000031afb62 in Partition_helper::ph_index_prev (this=0x7fcaaa590840, buf=0x7fcaaa4cc828 "\361\001") at /mnt/sdc/release-8.0.16-7_dbg/sql/partitioning/partition_handler.cc:2231
      #10 0x0000000002f64874 in native_part::Partition_base::index_prev (this=0x7fcaaa58f028, buf=0x7fcaaa4cc828 "\361\001") at /mnt/sdc/release-8.0.16-7_dbg/sql/partitioning/partition_base.h:410
      #11 0x0000000002f80002 in handler::ha_index_prev (this=0x7fcaaa58f028, buf=0x7fcaaa4cc828 "\361\001") at /mnt/sdc/release-8.0.16-7_dbg/sql/handler.cc:3437
      #12 0x000000000316af86 in QUICK_SELECT_DESC::get_next (this=0x7fcaaa465a00) at /mnt/sdc/release-8.0.16-7_dbg/sql/opt_range.cc:11065
      #13 0x00000000031cbde3 in IndexRangeScanIterator::Read (this=0x7fcaaa4704c0) at /mnt/sdc/release-8.0.16-7_dbg/sql/records.cc:353
      #14 0x000000000360932b in FilterIterator::Read (this=0x7fcaaa470f78) at /mnt/sdc/release-8.0.16-7_dbg/sql/composite_iterators.cc:70
      #15 0x000000000329d67a in ExecuteIteratorQuery (join=0x7fcaaa46f620) at /mnt/sdc/release-8.0.16-7_dbg/sql/sql_executor.cc:1930
      #16 0x000000000329d8e5 in do_select (join=0x7fcaaa46f620) at /mnt/sdc/release-8.0.16-7_dbg/sql/sql_executor.cc:1986
      #17 0x0000000003297581 in JOIN::exec (this=0x7fcaaa46f620) at /mnt/sdc/release-8.0.16-7_dbg/sql/sql_executor.cc:313
      #18 0x000000000337e266 in Sql_cmd_dml::execute_inner (this=0x7fcaaa46f0f8, thd=0x7fcaaa421000) at /mnt/sdc/release-8.0.16-7_dbg/sql/sql_select.cc:904
      #19 0x000000000337d8ef in Sql_cmd_dml::execute (this=0x7fcaaa46f0f8, thd=0x7fcaaa421000) at /mnt/sdc/release-8.0.16-7_dbg/sql/sql_select.cc:700
      #20 0x0000000003319e07 in mysql_execute_command (thd=0x7fcaaa421000, first_level=true) at /mnt/sdc/release-8.0.16-7_dbg/sql/sql_parse.cc:4626
      #21 0x000000000331c6f2 in mysql_parse (thd=0x7fcaaa421000, parser_state=0x7fcb4c738a10, update_userstat=false) at /mnt/sdc/release-8.0.16-7_dbg/sql/sql_parse.cc:5427
      #22 0x00000000033112b8 in dispatch_command (thd=0x7fcaaa421000, com_data=0x7fcb4c739b80, command=COM_QUERY) at /mnt/sdc/release-8.0.16-7_dbg/sql/sql_parse.cc:1796
      #23 0x000000000330f759 in do_command (thd=0x7fcaaa421000) at /mnt/sdc/release-8.0.16-7_dbg/sql/sql_parse.cc:1293
      #24 0x00000000034d903d in handle_connection (arg=0x7fcb377851a0) at /mnt/sdc/release-8.0.16-7_dbg/sql/conn_handler/connection_handler_per_thread.cc:308
      #25 0x00000000046777a4 in pfs_spawn_thread (arg=0x7fcb3772aa20) at /mnt/sdc/release-8.0.16-7_dbg/storage/perfschema/pfs.cc:2836
      #26 0x00007fcb4fc8fdd5 in start_thread (arg=0x7fcb4c73a700) at pthread_create.c:307
      #27 0x00007fcb4de5f02d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      Reproduced with 8.0.16-7 debug build.

      Release build doesn't crash:

      ./1565722034_run
      Executing testcase ./1565722034.sql against mysqld with socket /dev/shm/1565722034/socket.sock using the mysql CLI client...
      a       b       c
      1       2       3
      1       2       3
      

        Smart Checklist

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                Unassigned
                Reporter:
                hrvoje.matijakovic Hrvoje Matijakovic
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 45 minutes
                    45m