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

DROP PROCEDURE assertion sql/sql_parse.cc:5909: int mysql_execute_command(THD*): Assertion `thd->transaction.stmt.is_empty()' failed

    XMLWordPrintable

Details

    Description

      Bootstrap under --enforce-storage-engine=innodb causes assertion in Debug builds:

      $  mkdir -p /tmp/${PWD##*/}-datadir && scripts/mysql_install_db --no-defaults --srcdir=$OLDPWD --builddir=$PWD --datadir=/tmp/${PWD##*/}-datadir --verbose --enforce-storage-engine=innodb
      Installing MariaDB/MySQL system tables in '/tmp/build-mariadb-server-10.4-debug-datadir' ...
      2022-11-23  9:53:04 0 [Note] /home/dan/repos/build-mariadb-server-10.4-debug/sql/mysqld (mysqld 10.4.28-MariaDB-debug) starting as process 31325 ...
      2022-11-23  9:53:04 0 [Note] InnoDB: Using Linux native AIO
      2022-11-23  9:53:04 0 [Note] InnoDB: The first innodb_system data file 'ibdata1' did not exist. A new tablespace will be created!
      2022-11-23  9:53:04 0 [Note] InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!
      2022-11-23  9:53:04 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
      2022-11-23  9:53:04 0 [Note] InnoDB: Uses event mutexes
      2022-11-23  9:53:04 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
      2022-11-23  9:53:04 0 [Note] InnoDB: Number of pools: 1
      2022-11-23  9:53:04 0 [Note] InnoDB: Using SSE2 crc32 instructions
      2022-11-23  9:53:04 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
      2022-11-23  9:53:04 0 [Note] InnoDB: Completed initialization of buffer pool
      2022-11-23  9:53:04 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
      2022-11-23  9:53:04 0 [Note] InnoDB: Setting file './ibdata1' size to 12 MB. Physically writing the file full; Please wait ...
      2022-11-23  9:53:04 0 [Note] InnoDB: File './ibdata1' size is now 12 MB.
      2022-11-23  9:53:04 0 [Note] InnoDB: Setting log file ./ib_logfile101 size to 50331648 bytes
      2022-11-23  9:53:04 0 [Note] InnoDB: Setting log file ./ib_logfile1 size to 50331648 bytes
      2022-11-23  9:53:04 0 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
      2022-11-23  9:53:04 0 [Note] InnoDB: New log files created, LSN=11451
      2022-11-23  9:53:04 0 [Note] InnoDB: Doublewrite buffer not found: creating new
      2022-11-23  9:53:04 0 [Note] InnoDB: Doublewrite buffer created
      2022-11-23  9:53:04 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
      2022-11-23  9:53:04 0 [Note] InnoDB: Creating foreign key constraint system tables.
      2022-11-23  9:53:04 0 [Note] InnoDB: Creating tablespace and datafile system tables.
      2022-11-23  9:53:04 0 [Note] InnoDB: Creating sys_virtual system tables.
      2022-11-23  9:53:04 0 [Note] InnoDB: Creating shared tablespace for temporary tables
      2022-11-23  9:53:04 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
      2022-11-23  9:53:04 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
      2022-11-23  9:53:04 0 [Note] InnoDB: Waiting for purge to start
      2022-11-23  9:53:04 0 [Note] InnoDB: 10.4.28 started; log sequence number 0; transaction id 7
      mysqld: /home/dan/repos/mariadb-server-10.4/sql/sql_parse.cc:5909: int mysql_execute_command(THD*): Assertion `thd->transaction.stmt.is_empty()' failed.
      221123  9:53:05 [ERROR] mysqld got signal 6 ;
      ...
      Query  DROP PROCEDURE IF EXISTS AddGeometryColumn;
      

      10.4-3e0fd5e8a72ec8c6d48153113fb2987c2b456d17

      (gdb)  bt full
      #0  0x00007f3b2143ec6b in kill () from /lib64/libc.so.6
      No symbol table info available.
      #1  0x000055c0801bd682 in handle_fatal_signal (sig=6) at /home/dan/repos/mariadb-server-10.4/sql/signal_handler.cc:378
              curr_time = 1669157585
              tm = {tm_sec = 5, tm_min = 53, tm_hour = 9, tm_mday = 23, tm_mon = 10, tm_year = 122, tm_wday = 3, tm_yday = 326, tm_isdst = 1, tm_gmtoff = 39600, tm_zone = 0x55c0835e4690 "AEDT"}
              thd = 0x55c0836cf490
              print_invalid_query_pointer = false
      #2  <signal handler called>
      No symbol table info available.
      #3  0x00007f3b2148ec0c in __pthread_kill_implementation () from /lib64/libc.so.6
      No symbol table info available.
      #4  0x00007f3b2143e986 in raise () from /lib64/libc.so.6
      No symbol table info available.
      #5  0x00007f3b214287f4 in abort () from /lib64/libc.so.6
      No symbol table info available.
      #6  0x00007f3b2142871b in __assert_fail_base.cold () from /lib64/libc.so.6
      No symbol table info available.
      #7  0x00007f3b21437536 in __assert_fail () from /lib64/libc.so.6
      No symbol table info available.
      #8  0x000055c07fe7f883 in mysql_execute_command (thd=0x55c0836cf490) at /home/dan/repos/mariadb-server-10.4/sql/sql_parse.cc:5909
              sp_result = -1
              sph = 0x55c08151eab0 <sp_handler_procedure>
              res = 0
              up_result = 0
              lex = 0x55c0836d32e8
              select_lex = 0x55c0836d3bd8
              first_table = 0x0
              all_tables = 0x0
              unit = 0x55c0836d33a8
              have_table_map_for_update = false
              rpl_filter = 0x55c080abbfec <DoTrace+150>
              _db_stack_frame_ = {func = 0x55c080c60f2d "mysql_parse", file = 0x55c080c5f6e0 "/home/dan/repos/mariadb-server-10.4/sql/sql_parse.cc", level = 2147483651, line = -1, prev = 0x7ffd699e5d50}
              __PRETTY_FUNCTION__ = "int mysql_execute_command(THD*)"
              ots = {ctx = 0x55c0836d2fd0, traceable = false}
              trace_command = {<Json_writer_struct> = {_vptr.Json_writer_struct = 0x55c0813d9ed0 <vtable for Json_writer_object+16>, my_writer = 0x0, context = {writer = 0x0}, closed = false}, <No data fields>}
              trace_command_steps = {<Json_writer_struct> = {_vptr.Json_writer_struct = 0x55c0813d9eb0 <vtable for Json_writer_array+16>, my_writer = 0x0, context = {writer = 0x0}, closed = false}, <No data fields>}
              orig_binlog_format = BINLOG_FORMAT_MIXED
              orig_current_stmt_binlog_format = BINLOG_FORMAT_STMT
      #9  0x000055c07fe84dc2 in mysql_parse (thd=0x55c0836cf490, rawbuf=0x55c0845794b8 "DROP PROCEDURE IF EXISTS AddGeometryColumn;", length=43, parser_state=0x7ffd699e5e10, is_com_multi=false, is_next_command=false) at /home/dan/repos/mariadb-server-10.4/sql/sql_parse.cc:7982
              found_semicolon = 0x0
              error = 21952
              lex = 0x55c0836d32e8
              err = false
              _db_stack_frame_ = {func = 0x55c080c5f7ea "handle_bootstrap", file = 0x55c080c5f6e0 "/home/dan/repos/mariadb-server-10.4/sql/sql_parse.cc", level = 2147483650, line = -1, prev = 0x7ffd699e5df0}
              __PRETTY_FUNCTION__ = "void mysql_parse(THD*, char*, uint, Parser_state*, bool, bool)"
      #10 0x000055c07fe71a92 in bootstrap (file=0x55c081f90ca0 <instrumented_stdin>) at /home/dan/repos/mariadb-server-10.4/sql/sql_parse.cc:1091
              buffer = "DROP PROCEDURE IF EXISTS AddGeometryColumn;", '\000' <repeats 19956 times>
              length = 43
              db_len = 0
              rc = 0
              query = 0x55c0845794b8 "DROP PROCEDURE IF EXISTS AddGeometryColumn;"
              error = 0
              parser_state = {m_lip = {lookahead_token = -1, lookahead_yylval = 0x0, m_thd = 0x55c0836cf490, m_ptr = 0x55c0845794e4 "", m_tok_start = 0x55c0845794e4 "", m_tok_end = 0x55c0845794e4 "", m_end_of_query = 0x55c0845794e3 "", m_tok_start_prev = 0x55c0845794e3 "", m_buf = 0x55c0845794b8 "DROP PROCEDURE IF EXISTS AddGeometryColumn;", m_buf_length = 43, m_echo = true, m_echo_saved = true, m_cpp_buf = 0x55c084579540 "DROP PROCEDURE IF EXISTS AddGeometryColumn;", m_cpp_ptr = 0x55c08457956b "", m_cpp_tok_start = 0x55c08457956b "", m_cpp_tok_start_prev = 0x55c08457956b "", m_cpp_tok_end = 0x55c08457956b "", m_body_utf8 = 0x0, m_body_utf8_ptr = 0x55c084658f0c "", 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 = NO_COMMENT, m_cpp_text_start = 0x55c084579559 "AddGeometryColumn;", m_cpp_text_end = 0x55c08457956a ";", m_underscore_cs = 0x0}, m_yacc = {yacc_yyss = 0x0, yacc_yyvs = 0x0, m_set_signal_info = {m_item = {0x0 <repeats 12 times>}}, m_lock_type = TL_READ_DEFAULT, m_mdl_type = MDL_SHARED_READ}, m_digest_psi = 0x0}
              bootstrap_error = 0
              _db_stack_frame_ = {func = 0x55c081013ef5 "?func", file = 0x55c081013efb "?file", level = 2147483649, line = -1, prev = 0x0}
              thd = 0x55c0836cf490
              __PRETTY_FUNCTION__ = "int bootstrap(MYSQL_FILE*)"
      #11 0x000055c07fd379c6 in mysqld_main (argc=12, argv=0x55c0835e0da8) at /home/dan/repos/mariadb-server-10.4/sql/mysqld.cc:5871
              bootstrap_error = 21952
              please_close_stdin = true
              ho_error = 0
              new_thread_stack_size = 299008
              user = 0x0
      #12 0x000055c07fd2bb39 in main (argc=12, argv=0x7ffd699eafe8) at /home/dan/repos/mariadb-server-10.4/sql/main.cc:25
      No locals.
       
       
      #8  0x000055c07fe7f883 in mysql_execute_command (thd=0x55c0836cf490) at /home/dan/repos/mariadb-server-10.4/sql/sql_parse.cc:5909
      5909	      DBUG_ASSERT(thd->transaction.stmt.is_empty());
      (gdb) p thd->transaction
      $1 = {savepoints = 0x0, all = {no_2pc = false, ha_list = 0x0, modified_non_trans_table = false, m_unsafe_rollback_flags = 0}, stmt = {no_2pc = false, ha_list = 0x55c0836d1be8, modified_non_trans_table = false, m_unsafe_rollback_flags = 16}, on = true, xid_state = {xid_cache_element = 0x0}, implicit_xid = {formatID = 1, gtrid_length = 24, bqual_length = 0, data = "MySQLXid\000\000\000\000\000\000\000\000\243\005", '\000' <repeats 109 times>}, wt = {my_resources = {buffer = 0x0, elements = 0, max_element = 0, alloc_increment = 5, size_of_element = 8, malloc_flags = 0}, waiting_for = 0x0, pins = 0x0, timeout_short = 0x55c0836cff28, deadlock_search_depth_short = 0x55c0836cff30, timeout_long = 0x55c0836cff38, deadlock_search_depth_long = 0x55c0836cff40, weight = 0, killed = 0 '\000', name = 0x55c0835df028 "T@1"}, m_pending_rows_event = 0x0, start_time = {<timeval> = {tv_sec = 0, tv_usec = 0}, <No data fields>}, changed_tables = 0x0, mem_root = {free = 0x55c08457f540, used = 0x0, pre_alloc = 0x55c08457f540, min_malloc = 32, block_size = 8153, total_alloc = 4120, block_num = 4, first_block_usage = 0, error_handler = 0x55c07ffc6343 <sql_alloc_error_handler()>, name = 0x55c080c4e211 "THD::transactions"}}
      (gdb) p thd->transaction.stmt.ha_list
      $2 = (Ha_trx_info *) 0x55c0836d1be8
      (gdb) p *thd->transaction.stmt.ha_list
      $3 = {m_next = 0x0, m_ht = 0x55c0836e8900, m_flags = 0 '\000'}
      (gdb) p *thd->transaction.stmt.ha_list.m_ht
      $4 = {state = SHOW_OPTION_YES, db_type = DB_TYPE_INNODB, slot = 7, savepoint_offset = 0, close_connection = 0x55c080571f76 <innobase_close_connection(handlerton*, THD*)>, kill_query = 0x55c08057217a <innobase_kill_query(handlerton*, THD*, thd_kill_levels)>, savepoint_set = 0x55c080571d07 <innobase_savepoint(handlerton*, THD*, void*)>, savepoint_rollback = 0x55c080571842 <innobase_rollback_to_savepoint(handlerton*, THD*, void*)>, savepoint_rollback_can_release_mdl = 0x55c080571a1d <innobase_rollback_to_savepoint_can_release_mdl(handlerton*, THD*)>, savepoint_release = 0x55c080571b42 <innobase_release_savepoint(handlerton*, THD*, void*)>, commit = 0x55c080570dac <innobase_commit(handlerton*, THD*, bool)>, commit_ordered = 0x55c080570b9f <innobase_commit_ordered(handlerton*, THD*, bool)>, rollback = 0x55c0805711cf <innobase_rollback(handlerton*, THD*, bool)>, prepare = 0x55c080588ebd <innobase_xa_prepare(handlerton*, THD*, bool)>, prepare_ordered = 0x0, recover = 0x55c0805890e6 <innobase_xa_recover(handlerton*, XID*, uint)>, commit_by_xid = 0x55c0805891a6 <innobase_commit_by_xid(handlerton*, XID*)>, rollback_by_xid = 0x55c0805893aa <innobase_rollback_by_xid(handlerton*, xid_t*)>, commit_checkpoint_request = 0x55c0805715c5 <innobase_checkpoint_request(handlerton*, void*)>, checkpoint_state = 0x0, create_cursor_read_view = 0x0, set_cursor_read_view = 0x0, close_cursor_read_view = 0x0, create = 0x55c08056b0b1 <innobase_create_handler(handlerton*, TABLE_SHARE*, MEM_ROOT*)>, drop_database = 0x55c080581ba8 <innobase_drop_database(handlerton*, char*)>, panic = 0x55c08057041f <innobase_end(handlerton*, ha_panic_function)>, start_consistent_snapshot = 0x55c080570691 <innobase_start_trx_and_assign_read_view(handlerton*, THD*)>, flush_logs = 0x55c08056afb8 <innobase_flush_logs(handlerton*)>, show_status = 0x55c080587d21 <innobase_show_status(handlerton*, THD*, stat_print_fn*, ha_stat_type)>, partition_flags = 0x0, alter_table_flags = 0x0, alter_tablespace = 0x0, fill_is_table = 0x0, flags = 273409, binlog_func = 0x0, binlog_log_query = 0x0, abort_transaction = 0x0, set_checkpoint = 0x0, get_checkpoint = 0x0, table_options = 0x55c081528ce0 <innodb_table_option_list>, field_options = 0x0, index_options = 0x0, tablefile_extensions = 0x55c081f38c40 <ha_innobase_exts>, create_group_by = 0x0, create_derived = 0x0, create_select = 0x0, discover_table = 0x0, discover_table_names = 0x0, discover_table_existence = 0x0, discover_table_structure = 0x0, prepare_commit_versioned = 0x55c08056e5ab <innodb_prepare_commit_versioned(THD*, ulonglong*)>, disable_internal_writes = 0x0, prepare_for_backup = 0x0, end_backup = 0x0}
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              danblack Daniel Black
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.