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

Assertion `table->pos_in_locked _tables == __null || table->pos_in_locked_tables->table = table' failed in mark_used_tables_as_free_for_reuse, locking problems and binlogging problems on CREATE OR REPLACE under lock

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0.12
    • 10.0.14
    • None
    • None

    Description

      --source include/have_innodb.inc
      --source include/have_binlog_format_statement.inc
      --source include/have_metadata_lock_info.inc
      --enable_connect_log
       
      CREATE TABLE t1 (a INT) ENGINE=InnoDB;
      CREATE FUNCTION f1() RETURNS INT RETURN ( SELECT MAX(a) FROM t1 );
       
      --connect (con1,localhost,root,,test)
       
      CREATE TEMPORARY TABLE tmp (b INT) ENGINE=InnoDB;
      LOCK TABLE t1 WRITE;
       
      SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
       
      SELECT * FROM information_schema.metadata_lock_info;
      CREATE OR REPLACE TABLE t1 LIKE tmp;
      SELECT * FROM information_schema.metadata_lock_info;
      SHOW CREATE TABLE t1;
       
      --connection default
      SELECT f1();

      The test case above causes several problems. They might have the same root cause or be unrelated; in any case they all need to be addressed.

      In order of appearance:

      Binary logging complaints

      CREATE OR REPLACE TABLE t1 LIKE tmp causes a bunch of warnings of type Error:

      CREATE OR REPLACE TABLE t1 LIKE tmp;
      Warnings:
      Error	1665	Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
      Error	1015	Can't lock file (errno: 170 "It is not possible to log this statement")
      Error	1213	Deadlock found when trying to get lock; try restarting transaction

      It's unexpected – it should be pure DDL, why would we suddenly care about binlog format?

      It seems to only be happening under LOCK.

      Disappearance of locks

      The CREATE OR REPLACE TABLE t1 LIKE tmp , despite the warnings, gets executed. However, all locks are gone after that – I don't think it is supposed to happen:

      SELECT * FROM information_schema.metadata_lock_info;
      THREAD_ID	LOCK_MODE	LOCK_DURATION	LOCK_TYPE	TABLE_SCHEMA	TABLE_NAME
      5	MDL_INTENTION_EXCLUSIVE	MDL_EXPLICIT	Global read lock		
      5	MDL_SHARED_NO_READ_WRITE	MDL_EXPLICIT	Table metadata lock	test	t1
      5	MDL_INTENTION_EXCLUSIVE	MDL_EXPLICIT	Schema metadata lock	test	
       
      CREATE OR REPLACE TABLE t1 LIKE tmp;
      Warnings:
      Error	1665	Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
      Error	1015	Can't lock file (errno: 170 "It is not possible to log this statement")
      Error	1213	Deadlock found when trying to get lock; try restarting transaction
       
      SELECT * FROM information_schema.metadata_lock_info;
      THREAD_ID	LOCK_MODE	LOCK_DURATION	LOCK_TYPE	TABLE_SCHEMA	TABLE_NAME

      Assertion failure on the last SELECT f1():

      10.0/sql/sql_base.cc:756: void mark_used_tables_as_free_for_reuse(THD*, TABLE*): Assertion `table->pos_in_locked_tables == __null || table->pos_in_locked_tables->table == table' failed.
      140810  1:49:19 [ERROR] mysqld got signal 6 ;

      #6  0x00007ff368f5b6f1 in *__GI___assert_fail (assertion=0xf1b9e0 "table->pos_in_locked_tables == __null || table->pos_in_locked_tables->table == table", file=<optimized out>, line=756, function=0xf1f0c0 "void mark_used_tables_as_free_for_reuse(THD*, TABLE*)") at assert.c:81
      #7  0x0000000000615637 in mark_used_tables_as_free_for_reuse (thd=0x7ff35d61c070, table=0x7ff356111c70) at 10.0/sql/sql_base.cc:755
      #8  0x0000000000615b75 in close_thread_tables (thd=0x7ff35d61c070) at 10.0/sql/sql_base.cc:953
      #9  0x00000000009a56aa in sp_lex_keeper::reset_lex_and_exec_core (this=0x7ff355d57490, thd=0x7ff35d61c070, nextp=0x7ff36ae91a48, open_tables=true, instr=0x7ff355d57450) at 10.0/sql/sp_head.cc:2983
      #10 0x00000000009a68a2 in sp_instr_freturn::execute (this=0x7ff355d57450, thd=0x7ff35d61c070, nextp=0x7ff36ae91a48) at 10.0/sql/sp_head.cc:3467
      #11 0x00000000009a19c8 in sp_head::execute (this=0x7ff355dc2088, thd=0x7ff35d61c070, merge_da_on_success=true) at 10.0/sql/sp_head.cc:1366
      #12 0x00000000009a2b36 in sp_head::execute_function (this=0x7ff355dc2088, thd=0x7ff35d61c070, argp=0xa5a5a5a5a5a5a5a5, argcount=0, return_value_fld=0x7ff355e90d50) at 10.0/sql/sp_head.cc:1906
      #13 0x00000000008db057 in Item_func_sp::execute_impl (this=0x7ff355e8f330, thd=0x7ff35d61c070) at 10.0/sql/item_func.cc:6734
      #14 0x00000000008dadf8 in Item_func_sp::execute (this=0x7ff355e8f330) at 10.0/sql/item_func.cc:6667
      #15 0x00000000008ddddc in Item_func_sp::val_int (this=0x7ff355e8f330) at 10.0/sql/item_func.h:2069
      #16 0x00000000008875ce in Item::send (this=0x7ff355e8f330, protocol=0x7ff35d61c5f8, buffer=0x7ff36ae92010) at 10.0/sql/item.cc:6641
      #17 0x00000000005d1ddc in Protocol::send_result_set_row (this=0x7ff35d61c5f8, row_items=0x7ff35d620580) at 10.0/sql/protocol.cc:903
      #18 0x000000000063ed29 in select_send::send_data (this=0x7ff355e90ce0, items=...) at 10.0/sql/sql_class.cc:2542
      #19 0x00000000006b260a in JOIN::exec_inner (this=0x7ff355d3f088) at 10.0/sql/sql_select.cc:2455
      #20 0x00000000006b202a in JOIN::exec (this=0x7ff355d3f088) at 10.0/sql/sql_select.cc:2369
      #21 0x00000000006b53ad in mysql_select (thd=0x7ff35d61c070, rref_pointer_array=0x7ff35d6206e0, tables=0x0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7ff355e90ce0, unit=0x7ff35d61fd80, select_lex=0x7ff35d620468) at 10.0/sql/sql_select.cc:3307
      #22 0x00000000006ab98f in handle_select (thd=0x7ff35d61c070, lex=0x7ff35d61fcb8, result=0x7ff355e90ce0, setup_tables_done_option=0) at 10.0/sql/sql_select.cc:372
      #23 0x0000000000680678 in execute_sqlcom_select (thd=0x7ff35d61c070, all_tables=0x0) at 10.0/sql/sql_parse.cc:5265
      #24 0x0000000000678a17 in mysql_execute_command (thd=0x7ff35d61c070) at 10.0/sql/sql_parse.cc:2552
      #25 0x0000000000682e03 in mysql_parse (thd=0x7ff35d61c070, rawbuf=0x7ff355e8f088 "SELECT f1()", length=11, parser_state=0x7ff36ae93610) at 10.0/sql/sql_parse.cc:6411
      #26 0x0000000000675cb8 in dispatch_command (command=COM_QUERY, thd=0x7ff35d61c070, packet=0x7ff362a55071 "", packet_length=11) at 10.0/sql/sql_parse.cc:1307
      #27 0x000000000067505d in do_command (thd=0x7ff35d61c070) at 10.0/sql/sql_parse.cc:1004
      #28 0x0000000000791312 in do_handle_one_connection (thd_arg=0x7ff35d61c070) at 10.0/sql/sql_connect.cc:1379
      #29 0x0000000000791065 in handle_one_connection (arg=0x7ff35d61c070) at 10.0/sql/sql_connect.cc:1293
      #30 0x0000000000cc3992 in pfs_spawn_thread (arg=0x7ff35d6b7df0) at 10.0/storage/perfschema/pfs.cc:1860
      #31 0x00007ff36ab14b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
      #32 0x00007ff36900c20d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

      Stack trace from:

      revision-id: sergii@pisem.net-20140808155845-jiz321iz2o2bhn8e
      revno: 4346
      branch-nick: 10.0

      Attachments

        Activity

          elenst Elena Stepanova created issue -

          Error and general logs are attached as mdev6525.tar.gz

          elenst Elena Stepanova added a comment - Error and general logs are attached as mdev6525.tar.gz
          elenst Elena Stepanova made changes -
          Field Original Value New Value
          Attachment mdev6525.tar.gz [ 33100 ]

          Also observed on a regular x86_64 machine, so it's not PPC64-specific.

          elenst Elena Stepanova added a comment - Also observed on a regular x86_64 machine, so it's not PPC64-specific.
          elenst Elena Stepanova made changes -
          Summary [Draft] Assertion `table->pos_in_locked _tables == __null || table->pos_in_locked_tables->table == table' failed in mark_used_tables_as_free_for_reuse on PPC64 [Draft] Assertion `table->pos_in_locked _tables == __null || table->pos_in_locked_tables->table = table' failed in mark_used_tables_as_free_for_reuse
          elenst Elena Stepanova made changes -
          Fix Version/s 10.0 [ 16000 ]
          Affects Version/s 10.0.12 [ 15201 ]
          Assignee Elena Stepanova [ elenst ] Michael Widenius [ monty ]
          Description Observed once so far

          {noformat}
          10.0-for-stress-tests/sql/sql_base.cc:756: void mark_used_tables_as_free_for_reuse(THD*, TABLE*): Assertion `table->pos_in_locked
          _tables == __null || table->pos_in_locked_tables->table == table' failed.
          140804 2:11:16 [ERROR] mysqld got signal 6 ;
          {noformat}
          {noformat}
          #5 0x00000fffa8e718f4 in __GI_abort () at abort.c:89
          #6 0x00000fffa8e6645c in __assert_fail_base (fmt=0xfffa8fafde0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x10ded3b8 "table->pos_in_locked_tables == __null || table->pos_in_locked_tables->table == table", file=0x10ded120 "10.0/sql/sql_base.cc", line=<optimized out>, function=<optimized out>) at assert.c:92
          #7 0x00000fffa8e6654c in __GI___assert_fail (assertion=0x10ded3b8 "table->pos_in_locked_tables == __null || table->pos_in_locked_tables->table == table", file=0x10ded120 "10.0/sql/sql_base.cc", line=<optimized out>, function=0x10def198 <mark_used_tables_as_free_for_reuse(THD*, TABLE*)::__PRETTY_FUNCTION__> "void mark_used_tables_as_free_for_reuse(THD*, TABLE*)") at assert.c:101
          #8 0x00000000102018d0 in mark_used_tables_as_free_for_reuse (thd=0x10031f8f6d0, table=0xfff00065260) at 10.0/sql/sql_base.cc:755
          #9 0x0000000010201ef8 in close_thread_tables (thd=0x10031f8f6d0) at 10.0/sql/sql_base.cc:953
          #10 0x000000001020ae20 in open_and_lock_tables (thd=0x10031f8f6d0, tables=0xfff2000c4e0, derived=true, flags=0, prelocking_strategy=0xfff7c273fd0) at 10.0/sql/sql_base.cc:5139
          #11 0x00000000101fb5bc in open_and_lock_tables (thd=0x10031f8f6d0, tables=0xfff2000c4e0, derived=true, flags=0) at 10.0/sql/sql_base.h:486
          #12 0x00000000106e26e8 in sp_instr::exec_open_and_lock_tables (this=0xfff2000d7e0, thd=0x10031f8f6d0, tables=0xfff2000c4e0) at 10.0/sql/sp_head.cc:3062
          #13 0x00000000106e221c in sp_lex_keeper::reset_lex_and_exec_core (this=0xfff2000d820, thd=0x10031f8f6d0, nextp=0xfff7c2742c4, open_tables=true, instr=0xfff2000d7e0) at 10.0/sql/sp_head.cc:2960
          #14 0x00000000106e3fb4 in sp_instr_freturn::execute (this=0xfff2000d7e0, thd=0x10031f8f6d0, nextp=0xfff7c2742c4) at 10.0/sql/sp_head.cc:3467
          #15 0x00000000106dda24 in sp_head::execute (this=0xfff20026388, thd=0x10031f8f6d0, merge_da_on_success=true) at 10.0/sql/sp_head.cc:1366
          #16 0x00000000106deca4 in sp_head::execute_function (this=0xfff20026388, thd=0x10031f8f6d0, argp=0xa5a5a5a5a5a5a5a5, argcount=0, return_value_fld=0xfff202e3450) at 10.0/sql/sp_head.cc:1906
          #17 0x00000000105c052c in Item_func_sp::execute_impl (this=0xfff20084798, thd=0x10031f8f6d0) at 10.0/sql/item_func.cc:6747
          #18 0x00000000105c027c in Item_func_sp::execute (this=0xfff20084798) at 10.0/sql/item_func.cc:6680
          #19 0x00000000105c5d78 in Item_func_sp::val_int (this=0xfff20084798) at 10.0/sql/item_func.h:2076
          #20 0x000000001053c484 in Item::save_in_field (this=0xfff20084798, field=0xfff0008a678, no_conversions=false) at 10.0/sql/item.cc:6124
          #21 0x00000000102147b0 in fill_record (thd=0x10031f8f6d0, table_arg=0xfff00065260, fields=..., values=..., ignore_errors=false) at 10.0/sql/sql_base.cc:8662
          #22 0x0000000010214a64 in fill_record_n_invoke_before_triggers (thd=0x10031f8f6d0, table=0xfff00065260, fields=..., values=..., ignore_errors=false, event=TRG_EVENT_INSERT) at 10.0/sql/sql_base.cc:8718
          #23 0x000000001025f06c in mysql_insert (thd=0x10031f8f6d0, table_list=0xfff20083d18, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_REPLACE, ignore=false) at 10.0/sql/sql_insert.cc:876
          #24 0x00000000102888ec in mysql_execute_command (thd=0x10031f8f6d0) at 10.0/sql/sql_parse.cc:3437
          #25 0x00000000102914b4 in mysql_parse (thd=0x10031f8f6d0, rawbuf=0xfff20083a98 "REPLACE INTO test1 . /* table0_myisam_int table0_int_autoinc v1_nontrans_unsafe_for_sbr_31248 */ table1_innodb_int_autoinc ( `col_bigint` , col_tinyint ) VALUES ( f1_3_31248 () , 42 ) , ( @aux , 9 )", length=205, parser_state=0xfff7c275f28) at 10.0/sql/sql_parse.cc:6411
          #26 0x0000000010282f6c in dispatch_command (command=COM_QUERY, thd=0x10031f8f6d0, packet=0xfff200142e1 " REPLACE INTO test1 . /* table0_myisam_int table0_int_autoinc v1_nontrans_unsafe_for_sbr_31248 */ table1_innodb_int_autoinc ( `col_bigint` , col_tinyint ) VALUES ( f1_3_31248 () , 42 ) , ( @aux , 9 ) ", packet_length=209) at 10.0/sql/sql_parse.cc:1307
          #27 0x000000001028213c in do_command (thd=0x10031f8f6d0) at 10.0/sql/sql_parse.cc:1004
          #28 0x00000000103ef520 in do_handle_one_connection (thd_arg=0x10031f8f6d0) at 10.0/sql/sql_connect.cc:1379
          #29 0x00000000103ef184 in handle_one_connection (arg=0x10031f8f6d0) at 10.0/sql/sql_connect.cc:1293
          #30 0x00000fffa969c548 in start_thread (arg=0xfff7c277190) at pthread_create.c:311
          {noformat}

          {noformat}
          Query (0xfff20083a98): REPLACE INTO test1 . /* table0_myisam_int table0_int_autoinc v1_nontrans_unsafe_for_sbr_31248 */ table1_innodb_int_autoinc ( `col_bigint` , col_tinyint ) VALUES ( f1_3_31248 () , 42 ) , ( @aux , 9 )
          Connection ID (thread ID): 19
          Status: NOT_KILLED
          {noformat}
          {noformat}
          revision-id: sergii@pisem.net-20140731161437-oxyzqaskmptm5ssv
          revno: 4318
          branch-nick: 10.0-for-stress-tests
          {noformat}

          RQG command line:
          {noformat}
          perl ./runall-new.pl \
          --queries=100000000 \
          --no-mask \
          --seed=1407118200 \
          --threads=8 \
          --duration=600 \
          --queries=100M \
          --reporters=QueryTimeout,Backtrace,ErrorLog,Deadlock \
          --validators=TransformerNoComparator \
          --transformers=ExecuteAsDeleteReturning,ExecuteAsPreparedTwice,DisableOptimizations,EnableOptimizations,OrderBy \
          --redefine=conf/mariadb/general-workarounds.yy \
          --redefine=conf/mariadb/10.0-features-redefine.yy \
          --mysqld=--log_output=FILE \
          --mysqld=--query_cache_size=64M \
          --mysqld=--slow_query_log \
          --mysqld=--long_query_time=0.000001 \
          --mysqld=--log_bin_trust_function_creators=1 \
          --grammar=conf/replication/replication-ddl_sql.yy \
          --gendata=conf/replication/replication-ddl_data.zz \
          --engine=InnoDB \
          --rpl_mode=statement \
          --mysqld=--slave-skip-errors=1054,1317,1049,1305,1539,1505 \
          --use-gtid=current_pos \
          --mysqld=--optimizer_switch=extended_keys=on,exists_to_in=on \
          --mysqld=--use_stat_tables=PREFERABLY \
          --mysqld=--optimizer_selectivity_sampling_limit=100 \
          --mysqld=--optimizer_use_condition_selectivity=5 \
          --mysqld=--histogram_size=100 \
          --mysqld=--histogram_type=DOUBLE_PREC_HB \
          --mysqld=--log_slow_verbosity=query_plan,explain \
          --mysqld=--slave_parallel_threads=8 \
          --mtr-build-thread=300 \
          --mask=28220 \
          --basedir1=<basedir> --vardir1=<vardir>
          {noformat}

          {noformat}
          revision-id: elenst@montyprogram.com-20140803154606-g9zy38zdtq2fhpk5
          revno: 953
          branch-nick: randgen-mariadb-patches
          {noformat}

          {code:sql}
          --source include/have_innodb.inc
          --source include/have_binlog_format_statement.inc
          --source include/have_metadata_lock_info.inc
          --enable_connect_log

          CREATE TABLE t1 (a INT) ENGINE=InnoDB;
          CREATE FUNCTION f1() RETURNS INT RETURN ( SELECT MAX(a) FROM t1 );

          --connect (con1,localhost,root,,test)

          CREATE TEMPORARY TABLE tmp (b INT) ENGINE=InnoDB;
          LOCK TABLE t1 WRITE;

          SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;

          SELECT * FROM information_schema.metadata_lock_info;
          CREATE OR REPLACE TABLE t1 LIKE tmp;
          SELECT * FROM information_schema.metadata_lock_info;
          SHOW CREATE TABLE t1;

          --connection default
          SELECT f1();
          {code}

          The test case above causes several problems. They might have the same root cause or be unrelated; in any case they all need to be addressed.

          In order of appearance:

          h4. Binary logging complaints

          {{CREATE OR REPLACE TABLE t1 LIKE tmp}} causes a bunch of warnings of type Error:
          {code:sql}
          CREATE OR REPLACE TABLE t1 LIKE tmp;
          Warnings:
          Error 1665 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
          Error 1015 Can't lock file (errno: 170 "It is not possible to log this statement")
          Error 1213 Deadlock found when trying to get lock; try restarting transaction
          {code}

          It's unexpected -- it should be pure DDL, why would we suddenly care about binlog format?

          It seems to only be happening under LOCK.

          h4. Disappearance of locks

          The {{CREATE OR REPLACE TABLE t1 LIKE tmp}} , despite the warnings, gets executed. However, all locks are gone after that -- I don't think it is supposed to happen:

          {code:sql}
          SELECT * FROM information_schema.metadata_lock_info;
          THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
          5 MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Global read lock
          5 MDL_SHARED_NO_READ_WRITE MDL_EXPLICIT Table metadata lock test t1
          5 MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock test

          CREATE OR REPLACE TABLE t1 LIKE tmp;
          Warnings:
          Error 1665 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
          Error 1015 Can't lock file (errno: 170 "It is not possible to log this statement")
          Error 1213 Deadlock found when trying to get lock; try restarting transaction

          SELECT * FROM information_schema.metadata_lock_info;
          THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
          {code}

          h4. Assertion failure on the last {{SELECT f1()}}:

          {noformat}
          10.0/sql/sql_base.cc:756: void mark_used_tables_as_free_for_reuse(THD*, TABLE*): Assertion `table->pos_in_locked_tables == __null || table->pos_in_locked_tables->table == table' failed.
          140810 1:49:19 [ERROR] mysqld got signal 6 ;
          {noformat}
          {noformat}
          #6 0x00007ff368f5b6f1 in *__GI___assert_fail (assertion=0xf1b9e0 "table->pos_in_locked_tables == __null || table->pos_in_locked_tables->table == table", file=<optimized out>, line=756, function=0xf1f0c0 "void mark_used_tables_as_free_for_reuse(THD*, TABLE*)") at assert.c:81
          #7 0x0000000000615637 in mark_used_tables_as_free_for_reuse (thd=0x7ff35d61c070, table=0x7ff356111c70) at 10.0/sql/sql_base.cc:755
          #8 0x0000000000615b75 in close_thread_tables (thd=0x7ff35d61c070) at 10.0/sql/sql_base.cc:953
          #9 0x00000000009a56aa in sp_lex_keeper::reset_lex_and_exec_core (this=0x7ff355d57490, thd=0x7ff35d61c070, nextp=0x7ff36ae91a48, open_tables=true, instr=0x7ff355d57450) at 10.0/sql/sp_head.cc:2983
          #10 0x00000000009a68a2 in sp_instr_freturn::execute (this=0x7ff355d57450, thd=0x7ff35d61c070, nextp=0x7ff36ae91a48) at 10.0/sql/sp_head.cc:3467
          #11 0x00000000009a19c8 in sp_head::execute (this=0x7ff355dc2088, thd=0x7ff35d61c070, merge_da_on_success=true) at 10.0/sql/sp_head.cc:1366
          #12 0x00000000009a2b36 in sp_head::execute_function (this=0x7ff355dc2088, thd=0x7ff35d61c070, argp=0xa5a5a5a5a5a5a5a5, argcount=0, return_value_fld=0x7ff355e90d50) at 10.0/sql/sp_head.cc:1906
          #13 0x00000000008db057 in Item_func_sp::execute_impl (this=0x7ff355e8f330, thd=0x7ff35d61c070) at 10.0/sql/item_func.cc:6734
          #14 0x00000000008dadf8 in Item_func_sp::execute (this=0x7ff355e8f330) at 10.0/sql/item_func.cc:6667
          #15 0x00000000008ddddc in Item_func_sp::val_int (this=0x7ff355e8f330) at 10.0/sql/item_func.h:2069
          #16 0x00000000008875ce in Item::send (this=0x7ff355e8f330, protocol=0x7ff35d61c5f8, buffer=0x7ff36ae92010) at 10.0/sql/item.cc:6641
          #17 0x00000000005d1ddc in Protocol::send_result_set_row (this=0x7ff35d61c5f8, row_items=0x7ff35d620580) at 10.0/sql/protocol.cc:903
          #18 0x000000000063ed29 in select_send::send_data (this=0x7ff355e90ce0, items=...) at 10.0/sql/sql_class.cc:2542
          #19 0x00000000006b260a in JOIN::exec_inner (this=0x7ff355d3f088) at 10.0/sql/sql_select.cc:2455
          #20 0x00000000006b202a in JOIN::exec (this=0x7ff355d3f088) at 10.0/sql/sql_select.cc:2369
          #21 0x00000000006b53ad in mysql_select (thd=0x7ff35d61c070, rref_pointer_array=0x7ff35d6206e0, tables=0x0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7ff355e90ce0, unit=0x7ff35d61fd80, select_lex=0x7ff35d620468) at 10.0/sql/sql_select.cc:3307
          #22 0x00000000006ab98f in handle_select (thd=0x7ff35d61c070, lex=0x7ff35d61fcb8, result=0x7ff355e90ce0, setup_tables_done_option=0) at 10.0/sql/sql_select.cc:372
          #23 0x0000000000680678 in execute_sqlcom_select (thd=0x7ff35d61c070, all_tables=0x0) at 10.0/sql/sql_parse.cc:5265
          #24 0x0000000000678a17 in mysql_execute_command (thd=0x7ff35d61c070) at 10.0/sql/sql_parse.cc:2552
          #25 0x0000000000682e03 in mysql_parse (thd=0x7ff35d61c070, rawbuf=0x7ff355e8f088 "SELECT f1()", length=11, parser_state=0x7ff36ae93610) at 10.0/sql/sql_parse.cc:6411
          #26 0x0000000000675cb8 in dispatch_command (command=COM_QUERY, thd=0x7ff35d61c070, packet=0x7ff362a55071 "", packet_length=11) at 10.0/sql/sql_parse.cc:1307
          #27 0x000000000067505d in do_command (thd=0x7ff35d61c070) at 10.0/sql/sql_parse.cc:1004
          #28 0x0000000000791312 in do_handle_one_connection (thd_arg=0x7ff35d61c070) at 10.0/sql/sql_connect.cc:1379
          #29 0x0000000000791065 in handle_one_connection (arg=0x7ff35d61c070) at 10.0/sql/sql_connect.cc:1293
          #30 0x0000000000cc3992 in pfs_spawn_thread (arg=0x7ff35d6b7df0) at 10.0/storage/perfschema/pfs.cc:1860
          #31 0x00007ff36ab14b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
          #32 0x00007ff36900c20d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
          {noformat}

          Stack trace from:
          {noformat}
          revision-id: sergii@pisem.net-20140808155845-jiz321iz2o2bhn8e
          revno: 4346
          branch-nick: 10.0
          {noformat}

          Environment PPC64 RHEL 6.5 export PATH=/opt/at7.0/bin:$PATH && cmake -DCMAKE_BUILD_TYPE=Debug && make -j3
          Summary [Draft] Assertion `table->pos_in_locked _tables == __null || table->pos_in_locked_tables->table = table' failed in mark_used_tables_as_free_for_reuse Assertion `table->pos_in_locked _tables == __null || table->pos_in_locked_tables->table = table' failed in mark_used_tables_as_free_for_reuse, locking problems and binlogging problems on CREATE OR REPLACE under lock

          The bug was that innodb/xtradb thought that create or REPLACE was not safe to do in a transaction. This is not true as CREATE OR REPLACE will always be run in it's own transaction.

          I fixed this by changing so that thd_sqlcom_can_generate_row_events() does not report that CREATE OR REPLACE is generating row events.

          monty Michael Widenius added a comment - The bug was that innodb/xtradb thought that create or REPLACE was not safe to do in a transaction. This is not true as CREATE OR REPLACE will always be run in it's own transaction. I fixed this by changing so that thd_sqlcom_can_generate_row_events() does not report that CREATE OR REPLACE is generating row events.
          monty Michael Widenius made changes -
          Status Open [ 1 ] In Progress [ 3 ]

          Fix pushed

          monty Michael Widenius added a comment - Fix pushed
          monty Michael Widenius made changes -
          Fix Version/s 10.0.14 [ 17101 ]
          Fix Version/s 10.0 [ 16000 ]
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          ratzpo Rasmus Johansson (Inactive) made changes -
          Workflow MariaDB v2 [ 52000 ] MariaDB v3 [ 64817 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 64817 ] MariaDB v4 [ 148091 ]

          People

            monty Michael Widenius
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.