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

SELECT FROM RocksDB table INTO OUTFILE can lead to a crash

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: On Hold
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: Not 5.6, Not 5.7, 8.0.15-5
    • Fix Version/s: None
    • Component/s: MyRocks
    • Labels:

      Description

      gdb

      Program terminated with signal 6, Aborted.
      #0  0x00007f0e6a9ad9d1 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  0x00007f0e6a9ad9d1 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:59                                                                                                             #1  0x0000000004486a7d in my_write_core (sig=6) at /sdc/release-8.0.15-5_dbg/mysys/stacktrace.cc:278
      #2  0x000000000342f82b in handle_fatal_signal (sig=6) at /sdc/release-8.0.15-5_dbg/sql/signal_handler.cc:252
      #3  <signal handler called>
      #4  0x00007f0e68ab1207 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:55
      #5  0x00007f0e68ab28f8 in __GI_abort () at abort.c:90
      #6  0x00007f0e68aaa026 in __assert_fail_base (fmt=0x7f0e68c04ea0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5617360 "join->best_read < double(1.79769313486231570815e+308L)", file=file@entry=0x5616e58 "/sdc/release-8.0.15-5_dbg/sql/sql_planner.cc", line=line@entry=2225, function=function@entry=0x5618440 <Optimize_table_order::greedy_search(unsigned long long)::__PRETTY_FUNCTION__> "bool Optimize_table_order::greedy_search(table_map)") at assert.c:92
      #7  0x00007f0e68aaa0d2 in __GI___assert_fail (assertion=0x5617360 "join->best_read < double(1.79769313486231570815e+308L)", file=0x5616e58 "/sdc/release-8.0.15-5_dbg/sql/sql_planner.cc", line=2225, function=0x5618440 <Optimize_table_order::greedy_search(unsigned long long)::__PRETTY_FUNCTION__> "bool Optimize_table_order::greedy_search(table_map)") at assert.c:101
      #8  0x000000000328f357 in Optimize_table_order::greedy_search (this=0x7f0e67450f00, remaining_tables=3) at /sdc/release-8.0.15-5_dbg/sql/sql_planner.cc:2225
      #9  0x000000000328eab1 in Optimize_table_order::choose_table_order (this=0x7f0e67450f00) at /sdc/release-8.0.15-5_dbg/sql/sql_planner.cc:1900
      #10 0x000000000324f503 in JOIN::make_join_plan (this=0x7f0e04e19908) at /sdc/release-8.0.15-5_dbg/sql/sql_optimizer.cc:4810
      #11 0x00000000032433e6 in JOIN::optimize (this=0x7f0e04e19908) at /sdc/release-8.0.15-5_dbg/sql/sql_optimizer.cc:443
      #12 0x00000000032d4355 in SELECT_LEX::optimize (this=0x7f0e04dff108, thd=0x7f0e04c1a000) at /sdc/release-8.0.15-5_dbg/sql/sql_select.cc:1520
      #13 0x00000000032d268e in Sql_cmd_dml::execute_inner (this=0x7f0e04e034b8, thd=0x7f0e04c1a000) at /sdc/release-8.0.15-5_dbg/sql/sql_select.cc:685
      #14 0x00000000032d2146 in Sql_cmd_dml::execute (this=0x7f0e04e034b8, thd=0x7f0e04c1a000) at /sdc/release-8.0.15-5_dbg/sql/sql_select.cc:594
      #15 0x0000000003271799 in mysql_execute_command (thd=0x7f0e04c1a000, first_level=true) at /sdc/release-8.0.15-5_dbg/sql/sql_parse.cc:4576
      #16 0x0000000003273d99 in mysql_parse (thd=0x7f0e04c1a000, parser_state=0x7f0e67452a30, update_userstat=false, force_primary_storage_engine=false) at /sdc/release-8.0.15-5_dbg/sql/sql_parse.cc:5334
      #17 0x000000000326946e in dispatch_command (thd=0x7f0e04c1a000, com_data=0x7f0e67453b80, command=COM_QUERY) at /sdc/release-8.0.15-5_dbg/sql/sql_parse.cc:1761
      #18 0x000000000326794c in do_command (thd=0x7f0e04c1a000) at /sdc/release-8.0.15-5_dbg/sql/sql_parse.cc:1292
      #19 0x000000000341afec in handle_connection (arg=0x7f0e171f3c80) at /sdc/release-8.0.15-5_dbg/sql/conn_handler/connection_handler_per_thread.cc:311
      #20 0x0000000004570614 in pfs_spawn_thread (arg=0x7f0e173e0520) at /sdc/release-8.0.15-5_dbg/storage/perfschema/pfs.cc:2836
      #21 0x00007f0e6a9a8dd5 in start_thread (arg=0x7f0e67454700) at pthread_create.c:307
      #22 0x00007f0e68b78ead in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      (gdb)
      

      SQL:

      # mysqld options required for replay: --plugin-load-add=RocksDB=ha_rocksdb.so
      CREATE DATABASE test;
      USE test;
      set default_storage_engine=RocksDB;
      CREATE TABLE t2(t2_autoinc INT(1),uuid CHAR (1),date DATE,KEY k (uuid));
      CREATE TABLE t1(a int,b int);
      SELECT * FROM t1 WHERE a IN(SELECT * FROM (SELECT b FROM t2 LIMIT 2,2)x) INTO OUTFILE './before_explain.txt';
      

      Another test case:

      # mysqld options required for replay: --plugin-load-add=RocksDB=ha_rocksdb.so
      CREATE DATABASE test;
      USE test;
      create TABLE t1(a int,b char)engine=RocksDB;
      create table test.t2(a int)engine=RocksDB;
      SELECT * FROM t1 WHERE a IN(SELECT * FROM (SELECT b FROM t2 LIMIT 2,2)x) INTO OUTFILE './explain.txt';
      

      I'm able to reproduce this only on a debug build, opt fails with:

      ERROR 1290 (HY000) at line 7: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
      

      Variable secure_file_priv is set to NULL in both debug and opt build:

      mysql> show variables like '%secure_file%';
      +------------------+-------+
      | Variable_name    | Value |
      +------------------+-------+
      | secure_file_priv | NULL  |
      +------------------+-------+
      1 row in set (0.02 sec)
      

      I've tried reproducing this with InnoDB and TokuDB but both result in:

      Executing testcase ./1551970593.sql against mysqld with socket /dev/shm/1551970593/socket.sock using the mysql CLI client...
      ERROR 1290 (HY000) at line 7: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
      

      Can't reproduce on 5.7.25-28:

      Executing testcase ./1551970593.sql against mysqld with socket /dev/shm/1551970593/socket.sock using the mysql CLI client...
      ERROR 1054 (42S22) at line 7: Unknown column 'b' in 'field list'
      

        Smart Checklist

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated: