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

handle_fatal_signal (sig=11) in Table_node::Table_node on simple UPDATE statement with statement binlogging format

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 5.7.x, Not 5.5.x, Not 5.6.x
    • Fix Version/s: 5.7.21-21
    • Component/s: None
    • Labels:

      Description

      # mysqld options required for replay: --log-bin --server-id=1
      CREATE DATABASE test;
      USE test;
      SET binlog_format=STATEMENT;
      CREATE TABLE t1(a BLOB);
      CREATE VIEW v1 AS SELECT * FROM t1;
      UPDATE v1 SET a=10 WHERE a=200 LIMIT 1;
      

      Leads to;

      Core was generated by `/sda/PS281217-percona-server-5.7.20-18-linux-x86_64-debug/bin/mysqld --no-defau'.
      Program terminated with signal 11, Segmentation fault.
      #0 0x00007f3b49f6d9b1 in __pthread_kill (threadid=<optimized out>, signo=11)
      at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
      61	val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
      (gdb) bt
      #0 0x00007f3b49f6d9b1 in __pthread_kill (threadid=<optimized out>, signo=11)
      at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
      #1 0x000000000186b89d in my_write_core (sig=11) at /git/PS-5.7-new/PS-5.7-trunk_dbg/mysys/stacktrace.c:249
      #2 0x0000000000e8e8b9 in handle_fatal_signal (sig=11)
      at /git/PS-5.7-new/PS-5.7-trunk_dbg/sql/signal_handler.cc:223
      #3 <signal handler called>
      #4 0x00000000014b2369 in Table_node::Table_node (this=0x7f3ad8968350, table_arg=0x0)
      at /git/PS-5.7-new/PS-5.7-trunk_dbg/sql/sql_base.cc:10101
      #5 0x00000000014b26da in Const_ordered_table_node::Const_ordered_table_node (this=0x7f3ad84edfc0, 
      table_arg=0x0) at /git/PS-5.7-new/PS-5.7-trunk_dbg/sql/sql_base.cc:10181
      #6 0x00000000014b6108 in Join_node::add_table (this=0x7f3b4a55e650, table=0x0)
      at /git/PS-5.7-new/PS-5.7-trunk_dbg/sql/sql_base.cc:10236
      #7 0x00000000014b63a5 in Join_node::Join_node (this=0x7f3b4a55e650, table=0x7f3ad873f018, cond=
      0x7f3ad873f7f8, order=0x0) at /git/PS-5.7-new/PS-5.7-trunk_dbg/sql/sql_base.cc:10256
      #8 0x00000000014b2ff5 in is_order_deterministic (table=0x7f3ad873f018, cond=0x7f3ad873f7f8, order=0x0)
      at /git/PS-5.7-new/PS-5.7-trunk_dbg/sql/sql_base.cc:10481
      #9 0x00000000017e01c6 in THD::issue_unsafe_warnings (this=0x7f3ad8412000)
      at /git/PS-5.7-new/PS-5.7-trunk_dbg/sql/binlog.cc:12144
      #10 0x00000000017e0532 in THD::binlog_query (this=0x7f3ad8412000, qtype=THD::ROW_QUERY_TYPE, 
      query_arg=0x7f3ad873e030 "UPDATE v1 SET a=10 WHERE a=200 LIMIT 1", query_len=38, is_trans=true, 
      direct=false, suppress_use=false, errcode=0) at /git/PS-5.7-new/PS-5.7-trunk_dbg/sql/binlog.cc:12342
      #11 0x00000000015ec0cf in mysql_update (thd=0x7f3ad8412000, fields=..., values=..., limit=1, 
      handle_duplicates=DUP_ERROR, found_return=0x7f3b4a560168, updated_return=0x7f3b4a560160)
      at /git/PS-5.7-new/PS-5.7-trunk_dbg/sql/sql_update.cc:1061
      #12 0x00000000015f1cfa in Sql_cmd_update::try_single_table_update (this=0x7f3ad873efe8, thd=0x7f3ad8412000, 
      switch_to_multitable=0x7f3b4a56020f) at /git/PS-5.7-new/PS-5.7-trunk_dbg/sql/sql_update.cc:2889
      #13 0x00000000015f222b in Sql_cmd_update::execute (this=0x7f3ad873efe8, thd=0x7f3ad8412000)
      at /git/PS-5.7-new/PS-5.7-trunk_dbg/sql/sql_update.cc:3016
      #14 0x0000000001530f3b in mysql_execute_command (thd=0x7f3ad8412000, first_level=true)
      at /git/PS-5.7-new/PS-5.7-trunk_dbg/sql/sql_parse.cc:3760
      #15 0x0000000001536dec in mysql_parse (thd=0x7f3ad8412000, parser_state=0x7f3b4a5614b0)
      at /git/PS-5.7-new/PS-5.7-trunk_dbg/sql/sql_parse.cc:5897
      #16 0x000000000152b973 in dispatch_command (thd=0x7f3ad8412000, com_data=0x7f3b4a561c90, command=COM_QUERY)
      at /git/PS-5.7-new/PS-5.7-trunk_dbg/sql/sql_parse.cc:1493
      #17 0x000000000152a7b9 in do_command (thd=0x7f3ad8412000)
      at /git/PS-5.7-new/PS-5.7-trunk_dbg/sql/sql_parse.cc:1021
      #18 0x000000000166a3b0 in handle_connection (arg=0x7f3ad8411040)
      at /git/PS-5.7-new/PS-5.7-trunk_dbg/sql/conn_handler/connection_handler_per_thread.cc:312
      #19 0x000000000189aee7 in pfs_spawn_thread (arg=0x7f3b3c7ebe20)
      at /git/PS-5.7-new/PS-5.7-trunk_dbg/storage/perfschema/pfs.cc:2190
      #20 0x00007f3b49f68e25 in start_thread (arg=0x7f3b4a562700) at pthread_create.c:308
      #21 0x00007f3b4834834d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

      Interesting is that on MS the UPDATE statement gives a warning;

      | Note | 1592 | Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. |
      

       

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                zsolt.parragi Zsolt Parragi
                Reporter:
                roel.vandepaar Roel Van de Paar (Inactive)
              • 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 - 0 minutes
                  0m
                  Logged:
                  Time Spent - 7 hours, 4 minutes
                  7h 4m