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

Dropping TokuDB table with non-alphanumeric characters could lead to a crash

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Not 8.0, 5.6.41-84.1, 5.7.23-23
    • Fix Version/s: 5.6.42-84.2, 5.7.24-26
    • Component/s: TokuDB
    • Labels:
      None

      Description

      SQL:

      # mysqld options required for replay: --plugin-load=TokuDB=ha_tokudb.so
      CREATE DATABASE test;
      USE test;
      create table `#mysql50#q.q`(f1 int key)engine=TokuDB;
      DROP database test;
      

      gdb:

      (gdb) bt
      +bt
      #0  0x00007f1f48bb4a01 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
      #1  0x000000000189e77f in my_write_core (sig=6) at /home/hrvoje/worktable/PS-5.7.23-24_dbg/mysys/stacktrace.c:249
      #2  0x0000000001618601 in handle_fatal_signal (sig=6) at /home/hrvoje/worktable/PS-5.7.23-24_dbg/sql/signal_handler.cc:223
      #3  <signal handler called>
      #4  0x00007f1f46cb8277 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
      #5  0x00007f1f46cb9968 in __GI_abort () at abort.c:90
      #6  0x00007f1f46cb1096 in __assert_fail_base (fmt=0x7f1f46e0c580 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x1e18593 "*table_name", file=file@entry=0x1e184b0 "/home/hrvoje/worktable/PS-5.7.23-24_dbg/sql/partit
      ioning/partition_base.cc", line=line@entry=113, function=function@entry=0x1e19de0 <native_part::get_db_table_name_from_canonical_name(char const*, char*, unsigned long, char*, unsigned long)::__PRETTY_FUNCTION__> "void native_part::get_db
      _table_name_from_canonical_name(const char*, char*, size_t, char*, size_t)") at assert.c:92
      #7  0x00007f1f46cb1142 in __GI___assert_fail (assertion=0x1e18593 "*table_name", file=0x1e184b0 "/home/hrvoje/worktable/PS-5.7.23-24_dbg/sql/partitioning/partition_base.cc", line=113, function=0x1e19de0 <native_part::get_db_table_name_fro
      m_canonical_name(char const*, char*, unsigned long, char*, unsigned long)::__PRETTY_FUNCTION__> "void native_part::get_db_table_name_from_canonical_name(const char*, char*, size_t, char*, size_t)") at assert.c:101
      #8  0x0000000000e9457b in native_part::get_db_table_name_from_canonical_name (canonical_name=0x7f1f491a2730 "./test/", db_name_buf=0x7f1f491a0fa0 "test", db_name_buf_len=513, table_name_buf=0x7f1f491a11b0 "", table_name_buf_len=513) at /h
      ome/hrvoje/worktable/PS-5.7.23-24_dbg/sql/partitioning/partition_base.cc:113
      #9  0x0000000000e94a67 in native_part::get_part_str_for_table (name=0x7f1f491a2730 "./test/", result="") at /home/hrvoje/worktable/PS-5.7.23-24_dbg/sql/partitioning/partition_base.cc:207
      #10 0x00007f1f0942265a in ha_tokudb::delete_table (this=0x7f1eb75d4030, name=0x7f1f491a2730 "./test/") at /home/hrvoje/worktable/PS-5.7.23-24_dbg/storage/tokudb/ha_tokudb.cc:7627
      #11 0x0000000000ebbac0 in handler::ha_delete_table (this=0x7f1eb75d4030, name=0x7f1f491a2730 "./test/") at /home/hrvoje/worktable/PS-5.7.23-24_dbg/sql/handler.cc:5241
      #12 0x0000000000eb4fc5 in ha_delete_table (thd=0x7f1eb7419000, table_type=0x7f1f3dbf5660, path=0x7f1f491a2730 "./test/", db=0x7f1eb74af0f8 "test", alias=0x7f1eb74af0fd "", generate_warning=false) at /home/hrvoje/worktable/PS-5.7.23-24_dbg
      /sql/handler.cc:2763
      #13 0x00000000015523be in mysql_rm_table_no_locks (thd=0x7f1eb7419000, tables=0x7f1eb74aeb70, if_exists=true, drop_temporary=false, drop_view=true, dont_log_query=true) at /home/hrvoje/worktable/PS-5.7.23-24_dbg/sql/sql_table.cc:2680
      #14 0x0000000001474b94 in mysql_rm_db (thd=0x7f1eb7419000, db=..., if_exists=false, silent=false) at /home/hrvoje/worktable/PS-5.7.23-24_dbg/sql/sql_db.cc:867
      #15 0x00000000014c8c41 in mysql_execute_command (thd=0x7f1eb7419000, first_level=true) at /home/hrvoje/worktable/PS-5.7.23-24_dbg/sql/sql_parse.cc:4053
      #16 0x00000000014cdaad in mysql_parse (thd=0x7f1eb7419000, parser_state=0x7f1f491a5470) at /home/hrvoje/worktable/PS-5.7.23-24_dbg/sql/sql_parse.cc:5873
      #17 0x00000000014c2921 in dispatch_command (thd=0x7f1eb7419000, com_data=0x7f1f491a5c50, command=COM_QUERY) at /home/hrvoje/worktable/PS-5.7.23-24_dbg/sql/sql_parse.cc:1516
      #18 0x00000000014c17a9 in do_command (thd=0x7f1eb7419000) at /home/hrvoje/worktable/PS-5.7.23-24_dbg/sql/sql_parse.cc:1047
      #19 0x00000000015f5468 in handle_connection (arg=0x7f1f3abd3a90) at /home/hrvoje/worktable/PS-5.7.23-24_dbg/sql/conn_handler/connection_handler_per_thread.cc:312
      #20 0x00000000018c2220 in pfs_spawn_thread (arg=0x7f1f44c18c20) at /home/hrvoje/worktable/PS-5.7.23-24_dbg/storage/perfschema/pfs.cc:2190
      #21 0x00007f1f48bafe25 in start_thread (arg=0x7f1f491a6700) at pthread_create.c:308
      #22 0x00007f1f46d80bad in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
      (gdb) quit
      

      Reproduced on debug build of: RM-390 (57a9574def950d8dfc8ae5ba6f1367a7bad39622)

      Can't reproduce on the release build:

      Server version: 5.7.23-24 Percona Server (GPL), Release 24, Revision 57a9574
      
      Copyright (c) 2009-2018 Percona LLC and/or its affiliates
      Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
      
      Oracle is a registered trademark of Oracle Corporation and/or its
      affiliates. Other names may be trademarks of their respective
      owners.
      
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
      
      mysql> USE test;
      Database changed
      mysql> create table `#mysql50#q.q`(f1 int key)engine=TokuDB;
      Query OK, 0 rows affected (0.03 sec)
      
      mysql> DROP database test;
      Query OK, 1 row affected (0.01 sec)
      

      Not sure if connected with PS-4828.

        Attachments

          Activity

            People

            • Assignee:
              george.lorch George Lorch
              Reporter:
              hrvoje.matijakovic Hrvoje Matijakovic
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 5 hours, 30 minutes
                5h 30m