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

Assertion failure in THD::binlog_query or unexpected ER_ERROR_ON_WRITE with auto-partitioning

    XMLWordPrintable

Details

    Description

      --source include/have_partition.inc
       
      CREATE TABLE t (a INT) WITH SYSTEM VERSIONING PARTITION BY SYSTEM_TIME LIMIT 6 AUTO;
      INSERT INTO t () VALUES (),(),(),(),(),();
      UPDATE t SET a = 1;
      UPDATE t SET a = 2 LIMIT 0;
       
      # Cleanup
      DROP TABLE t;
      

      10.9 6e61369b debug

      mariadbd: /data/src/10.9/sql/sql_class.cc:7621: int THD::binlog_query(THD::enum_binlog_query_type, const char*, ulong, bool, bool, bool, int): Assertion `((WSREP_PROVIDER_EXISTS_ && this->variables.wsrep_on) && wsrep_emulate_bin_log) || mysql_bin_log.is_open()' failed.
      220629 14:23:48 [ERROR] mysqld got signal 6 ;
       
      #6  0x00007fa92119640f in __assert_fail_base (fmt=0x7fa9212ff128 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55604d15b120 "((WSREP_PROVIDER_EXISTS_ && this->variables.wsrep_on) && wsrep_emulate_bin_log) || mysql_bin_log.is_open()", file=0x55604d158eb0 "/data/src/10.9/sql/sql_class.cc", line=7621, function=<optimized out>) at assert.c:92
              str = 0x7fa900191480 "\220\001"
              total = 4096
      #7  0x00007fa9211a5662 in __GI___assert_fail (assertion=0x55604d15b120 "((WSREP_PROVIDER_EXISTS_ && this->variables.wsrep_on) && wsrep_emulate_bin_log) || mysql_bin_log.is_open()", file=0x55604d158eb0 "/data/src/10.9/sql/sql_class.cc", line=7621, function=0x55604d15b538 "int THD::binlog_query(THD::enum_binlog_query_type, const char*, ulong, bool, bool, bool, int)") at assert.c:101
      No locals.
      #8  0x000055604c37fa88 in THD::binlog_query (this=0x7fa900000db8, qtype=THD::STMT_QUERY_TYPE, query_arg=0x7fa900015450 "UPDATE t SET a = 2 LIMIT 0", query_len=26, is_trans=false, direct=false, suppress_use=false, errcode=0) at /data/src/10.9/sql/sql_class.cc:7621
              _db_stack_frame_ = {func = 0x55604d1a1b11 "mysql_update", file = 0x55604d1a1a08 "/data/src/10.9/sql/sql_update.cc", level = 2147483654, line = -1, prev = 0x7fa91c34f9f0}
              __PRETTY_FUNCTION__ = "int THD::binlog_query(THD::enum_binlog_query_type, const char*, ulong, bool, bool, bool, int)"
      #9  0x000055604c37f03d in THD::binlog_for_noop_dml (this=0x7fa900000db8, transactional_table=false) at /data/src/10.9/sql/sql_class.cc:7364
      No locals.
      #10 0x000055604c548ef0 in mysql_update (thd=0x7fa900000db8, table_list=0x7fa900015530, fields=@0x7fa900005c78: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x7fa900015dd0, last = 0x7fa900015dd0, elements = 1}, <No data fields>}, values=@0x7fa9000060a8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x7fa900015de0, last = 0x7fa900015de0, elements = 1}, <No data fields>}, conds=0x7fa900018400, order_num=0, order=0x0, limit=0, ignore=false, found_return=0x7fa91c34ff50, updated_return=0x7fa91c350040) at /data/src/10.9/sql/sql_update.cc:604
              using_limit = true
              safe_update = false
              used_key_is_modified = false
              transactional_table = false
              will_batch = false
              can_compare_record = 249
              res = 3256
              error = 0
              loc_error = 32681
              dup_key_found = 140363826290128
              need_sort = true
              reverse = false
              want_privilege = NO_ACL
              table_count = 1
              updated = 140364299434992
              updated_or_same = 140364299434848
              found = 140363826200582
              old_covering_keys = {buffer = {0}}
              table = 0x7fa900043398
              select = 0x7fa9000186d8
              file_sort = 0x0
              info = {table = 0x0, unlock_row = 0xe69df8f, read_record_func = 0x55604d171a78, read_record_func_and_unpack_calls = 0x0, thd = 0x7fa91c34faf0, select = 0x100004d036849, ref_length = 473234192, reclength = 32681, rec_cache_size = 1292264765, error_offset = 21856, unpack_counter = 140364299434768, ref_pos = 0x7fa900000ce0 "\253\356i\016\374\177", rec_buf = 0x7fa900000ce0 "\253\356i\016\374\177", cache = 0x0, cache_pos = 0x7fa91c34fd50 "", cache_end = 0x55604d0657af <_db_return_+209> "\203\340\001\205\300\017\204\n\001", read_positions = 0x7fa91c34fb60 "\260\374\064\034\251\177", sort_info = 0x7fa91c34fd70, io_cache = 0xffffff8000000005, print_error = 224, copy_field = 0x7fa91c34fb60, copy_field_end = 0x55604c30adb7 <operator&=(privilege_t&, ulonglong)+38>}
              select_lex = 0x7fa9000059d8
              id = 4294970552
              all_fields = {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55604dd52380 <end_of_list>, last = 0x7fa91c34f9b0, elements = 0}, <No data fields>}
              killed_status = NOT_KILLED
              has_triggers = 101
              binlog_is_row = 32
              do_direct_update = false
              query_plan = {_vptr.Update_plan = 0x55604d9f52e8 <vtable for Update_plan+16>, impossible_where = true, no_partitions = false, mem_root = 0x7fa900006d20, table = 0x7fa900043398, select = 0x7fa91c34faa0, index = 64, scanned_rows = 140364299434720, select_lex = 0x7fa9000059d8, possible_keys = {buffer = {140720551172599}}, using_filesort = false, using_io_buffer = false}
              explain = 0x7fa91c34f9b0
              update_source_table = 0x0
              rows_inserted = 0
              _db_stack_frame_ = {func = 0x55604d170050 "mysql_execute_command", file = 0x55604d16f318 "/data/src/10.9/sql/sql_parse.cc", level = 2147483653, line = -1, prev = 0x7fa91c34ff30}
              __PRETTY_FUNCTION__ = "int mysql_update(THD*, TABLE_LIST*, List<Item>&, List<Item>&, COND*, uint, ORDER*, ha_rows, bool, ha_rows*, ha_rows*)"
              has_vers_fields = true
              err2 = 1
      #11 0x000055604c3f9721 in mysql_execute_command (thd=0x7fa900000db8, is_called_from_prepared_stmt=false) at /data/src/10.9/sql/sql_parse.cc:4405
              found = 0
              updated = 0
              res = 0
              up_result = 0
              lex = 0x7fa900005100
              select_lex = 0x7fa9000059d8
              first_table = 0x7fa900015530
              all_tables = 0x7fa900015530
              unit = 0x7fa9000051d8
              have_table_map_for_update = false
              rpl_filter = 0x55604d9f21a8 <vtable for Internal_error_handler+16>
              _db_stack_frame_ = {func = 0x55604d1713e7 "mysql_parse", file = 0x55604d16f318 "/data/src/10.9/sql/sql_parse.cc", level = 2147483652, line = -1, prev = 0x7fa91c350380}
              __PRETTY_FUNCTION__ = "int mysql_execute_command(THD*, bool)"
              ots = {ctx = 0x7fa900004d98, traceable = false}
              orig_binlog_format = BINLOG_FORMAT_MIXED
              orig_current_stmt_binlog_format = BINLOG_FORMAT_STMT
      #12 0x000055604c405985 in mysql_parse (thd=0x7fa900000db8, rawbuf=0x7fa900015450 "UPDATE t SET a = 2 LIMIT 0", length=26, parser_state=0x7fa91c350500) at /data/src/10.9/sql/sql_parse.cc:8036
              found_semicolon = 0x0
              error = 32681
              lex = 0x7fa900005100
              err = false
              _db_stack_frame_ = {func = 0x55604d16f891 "dispatch_command", file = 0x55604d16f318 "/data/src/10.9/sql/sql_parse.cc", level = 2147483651, line = -1, prev = 0x7fa91c3504e0}
              __PRETTY_FUNCTION__ = "void mysql_parse(THD*, char*, uint, Parser_state*)"
      #13 0x000055604c3f1f39 in dispatch_command (command=COM_QUERY, thd=0x7fa900000db8, packet=0x7fa90000b9d9 "UPDATE t SET a = 2 LIMIT 0", packet_length=26, blocking=true) at /data/src/10.9/sql/sql_parse.cc:1894
              packet_end = 0x7fa90001546a ""
              parser_state = {m_lip = {lookahead_token = -1, lookahead_yylval = 0x0, m_thd = 0x7fa900000db8, m_ptr = 0x7fa90001546b "\004", m_tok_start = 0x7fa90001546b "\004", m_tok_end = 0x7fa90001546b "\004", m_end_of_query = 0x7fa90001546a "", m_tok_start_prev = 0x7fa90001546a "", m_buf = 0x7fa900015450 "UPDATE t SET a = 2 LIMIT 0", m_buf_length = 26, m_echo = true, m_echo_saved = false, m_cpp_buf = 0x7fa9000154c8 "UPDATE t SET a = 2 LIMIT 0", m_cpp_ptr = 0x7fa9000154e2 "", m_cpp_tok_start = 0x7fa9000154e2 "", m_cpp_tok_start_prev = 0x7fa9000154e2 "", m_cpp_tok_end = 0x7fa9000154e2 "", m_body_utf8 = 0x0, m_body_utf8_ptr = 0x100000cb8 <error: Cannot access memory at address 0x100000cb8>, m_cpp_utf8_processed_ptr = 0x0, next_state = MY_LEX_END, found_semicolon = 0x0, ignore_space = false, stmt_prepare_mode = false, multi_statements = true, yylineno = 1, m_digest = 0x0, in_comment = NO_COMMENT, in_comment_saved = (unknown: 0x10000), m_cpp_text_start = 0x7fa9000154e1 "0", m_cpp_text_end = 0x7fa9000154e2 "", m_underscore_cs = 0x0}, m_yacc = {yacc_yyss = 0x0, yacc_yyvs = 0x0, m_set_signal_info = {m_item = {0x0 <repeats 13 times>}}, m_lock_type = TL_READ_DEFAULT, m_mdl_type = MDL_SHARED_READ}, m_digest_psi = 0x7fa900004b28}
              net = 0x7fa9000010f0
              error = false
              do_end_of_statement = true
              _db_stack_frame_ = {func = 0x55604d16f515 "do_command", file = 0x55604d16f318 "/data/src/10.9/sql/sql_parse.cc", level = 2147483650, line = -1, prev = 0x7fa91c350dc0}
              drop_more_results = false
              __PRETTY_FUNCTION__ = "dispatch_command_return dispatch_command(enum_server_command, THD*, char*, uint, bool)"
              __FUNCTION__ = "dispatch_command"
              res = <optimized out>
      #14 0x000055604c3f0934 in do_command (thd=0x7fa900000db8, blocking=true) at /data/src/10.9/sql/sql_parse.cc:1407
              return_value = DISPATCH_COMMAND_SUCCESS
              packet = 0x7fa90000b9d8 "\003UPDATE t SET a = 2 LIMIT 0"
              packet_length = 27
              net = 0x7fa9000010f0
              command = COM_QUERY
              _db_stack_frame_ = {func = 0x55604d5c0ea0 "?func", file = 0x55604d5c0ea6 "?file", level = 2147483649, line = -1, prev = 0x0}
              __PRETTY_FUNCTION__ = "dispatch_command_return do_command(THD*, bool)"
              __FUNCTION__ = "do_command"
      #15 0x000055604c5c73a6 in do_handle_one_connection (connect=0x55604f937138, put_in_cache=true) at /data/src/10.9/sql/sql_connect.cc:1418
              create_user = true
              thr_create_utime = 2923940576369
              thd = 0x7fa900000db8
              __PRETTY_FUNCTION__ = "void do_handle_one_connection(CONNECT*, bool)"
      #16 0x000055604c5c7045 in handle_one_connection (arg=0x55604f939b18) at /data/src/10.9/sql/sql_connect.cc:1312
              connect = 0x55604f939b18
      #17 0x000055604cac3864 in pfs_spawn_thread (arg=0x55604f936ca8) at /data/src/10.9/storage/perfschema/pfs.cc:2201
              typed_arg = 0x55604f936ca8
              user_arg = 0x55604f939b18
              user_start_routine = 0x55604c5c6fea <handle_one_connection(void*)>
              pfs = 0x7fa920a995c0
              klass = 0x55604f36f540
      #18 0x00007fa92166fea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
              ret = <optimized out>
              pd = <optimized out>
              unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140364299441920, -9054949281398170958, 140720550305678, 140720550305679, 140364299440000, 311296, 9008435039550397106, 9008353018039458482}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
              not_first_call = 0
      #19 0x00007fa92126edef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      On a non-debug build the outcome is also bad:

      10.9 6e61369b non-debug

      CURRENT_TEST: bug.14095
      mysqltest: At line 6: query 'UPDATE t SET a = 2 LIMIT 0' failed: ER_ERROR_ON_WRITE (1026): Error writing file 'binary log' (errno: -1 "Internal error < 0 (Not system error)")
      

      Reproducible on 10.9, 10.10, with at least MyISAM and InnoDB.

      Attachments

        Activity

          People

            midenok Aleksey Midenkov
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.