From cd8f6a1e16407d157cfde82cd4344a98fd7d3f2e Mon Sep 17 00:00:00 2001 From: Guilhem Bichot Date: Tue, 3 Jun 2008 21:35:39 +0200 Subject: [PATCH] Fix for BUG#36104 "INFORMATION_SCHEMA.TABLES shows TRANSACTIONAL=1 twice in CREATE_OPTIONS" mysql-test/r/maria.result: result; before the bugfix it would be "TRANSACTIONAL=1 transactional=1" mysql-test/t/maria.test: test for BUG#36104 "INFORMATION_SCHEMA.TABLES shows TRANSACTIONAL=1 twice in CREATE_OPTIONS" sql-bench/example: doblewrite->doublewrite sql/mysqld.cc: fix of a wrong 5.1->maria merge of the past sql/sql_insert.cc: removing my old idea of disabling transactionality in CREATE SELECT: 1) it caused bugs because re-enabling (ha_enable_transaction()) causes implicit commit, so in complex cases like "CREATE SELECT some_func())", where some_func() would want to insert two rows in another table, and fail on the second row, the implicit commit would commit the inserted row, while it should roll back. 2) it's not needed anymore, because CREATE SELECT uses bulk insert, and Maria has transactionality disabled by bulk insert. sql/sql_show.cc: This was duplicate code, causing BUG#36104 "INFORMATION_SCHEMA.TABLES shows TRANSACTIONAL=1 twice in CREATE_OPTIONS" --- mysql-test/r/maria.result | 6 ++++++ mysql-test/t/maria.test | 9 +++++++++ sql-bench/example | 4 ++-- sql/mysqld.cc | 1 - sql/sql_insert.cc | 20 ++------------------ sql/sql_show.cc | 6 ------ 6 files changed, 19 insertions(+), 27 deletions(-) diff --git a/mysql-test/r/maria.result b/mysql-test/r/maria.result index 96fc4e25bc4..73d0df84d4f 100644 --- a/mysql-test/r/maria.result +++ b/mysql-test/r/maria.result @@ -2373,3 +2373,9 @@ SELECT a FROM t1 WHERE MATCH a AGAINST ('+city (of)*' IN BOOLEAN MODE); a City Of God DROP TABLE t1; +create table t1(a int) engine=maria transactional=1; +select CREATE_OPTIONS from information_schema.TABLES where +TABLE_SCHEMA='test' and TABLE_NAME='t1'; +CREATE_OPTIONS +transactional=1 +drop table t1; diff --git a/mysql-test/t/maria.test b/mysql-test/t/maria.test index bea9521dcf6..e180773869d 100644 --- a/mysql-test/t/maria.test +++ b/mysql-test/t/maria.test @@ -1562,6 +1562,15 @@ SELECT a FROM t1 WHERE MATCH a AGAINST ('+city of*' IN BOOLEAN MODE); SELECT a FROM t1 WHERE MATCH a AGAINST ('+city (of)*' IN BOOLEAN MODE); DROP TABLE t1; +# +# BUG#36104 - INFORMATION_SCHEMA.TABLES shows TRANSACTIONAL=1 twice in +# CREATE_OPTIONS +# +create table t1(a int) engine=maria transactional=1; +select CREATE_OPTIONS from information_schema.TABLES where +TABLE_SCHEMA='test' and TABLE_NAME='t1'; +drop table t1; + # End of 5.1 tests --disable_result_log diff --git a/sql-bench/example b/sql-bench/example index cb39fad819e..877fd080ac5 100644 --- a/sql-bench/example +++ b/sql-bench/example @@ -6,9 +6,9 @@ machine="Linux-x64" # InnoDB tests -./run-all-tests --suffix=-innodb --comments="Engine=InnoDB --innodb_buffer_pool_size=256M --innodb_additional_mem_pool_size=20M --innodb_log_file_size=1000M --innodb_log_buffer_size=16M --innodb_lock_wait_timeout=50 --innodb_flush_log_at_trx_commit=1 --innodb_flush_method=O_DIRECT --innodb_log_files_in_group=2 --skip-innodb-doblewrite" --create-options="ENGINE=InnoDB" --hw="$hw" --optimization="$optimization" --machine="$machine" --log +./run-all-tests --suffix=-innodb --comments="Engine=InnoDB --innodb_buffer_pool_size=256M --innodb_additional_mem_pool_size=20M --innodb_log_file_size=1000M --innodb_log_buffer_size=16M --innodb_lock_wait_timeout=50 --innodb_flush_log_at_trx_commit=1 --innodb_flush_method=O_DIRECT --innodb_log_files_in_group=2 --skip-innodb-doublewrite" --create-options="ENGINE=InnoDB" --hw="$hw" --optimization="$optimization" --machine="$machine" --log -./run-all-tests --suffix=_fast-innodb --comments="Engine=InnoDB --innodb_buffer_pool_size=256M --innodb_additional_mem_pool_size=20M --innodb_log_file_size=1000M --innodb_log_buffer_size=16M --innodb_lock_wait_timeout=50 --innodb_flush_log_at_trx_commit=1 --innodb_flush_method=O_DIRECT --innodb_log_files_in_group=2 --skip-innodb-doblewrite" --create-options="ENGINE=InnoDB" --hw="$hw" --optimization="$optimization" --machine="$machine" --fast --log +./run-all-tests --suffix=_fast-innodb --comments="Engine=InnoDB --innodb_buffer_pool_size=256M --innodb_additional_mem_pool_size=20M --innodb_log_file_size=1000M --innodb_log_buffer_size=16M --innodb_lock_wait_timeout=50 --innodb_flush_log_at_trx_commit=1 --innodb_flush_method=O_DIRECT --innodb_log_files_in_group=2 --skip-innodb-doublewrite" --create-options="ENGINE=InnoDB" --hw="$hw" --optimization="$optimization" --machine="$machine" --fast --log # MyISAM tests diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a19cde65e2b..3a48f9eadd0 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1102,7 +1102,6 @@ static void __cdecl kill_server(int sig_ptr) close_connections(); if (sig != MYSQL_KILL_SIGNAL && - sig != SIGINT && /* Bug#18235 */ sig != 0) unireg_abort(1); /* purecov: inspected */ else diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 61ce6b04832..a3610385725 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -3532,22 +3532,11 @@ select_create::prepare(List &values, SELECT_LEX_UNIT *u) thd->binlog_start_trans_and_stmt(); } - /* - If error during the CREATE SELECT we drop the table, so no need for - engines to do logging of insertions (optimization). We don't do it for - temporary tables (yet) as re-enabling causes an undesirable commit. - */ - if (!(table= create_table_from_items(thd, create_info, create_table, alter_info, &values, &extra_lock, hook_ptr))) DBUG_RETURN(-1); // abort() deletes table - if (((thd->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) == 0) && - !create_info->table_existed && - ha_enable_transaction(thd, FALSE)) - DBUG_RETURN(-1); - if (extra_lock) { DBUG_ASSERT(m_plock == NULL); @@ -3688,9 +3677,6 @@ bool select_create::send_eof() abort(); else { - if ((thd->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) == 0 && - !create_info->table_existed) - ha_enable_transaction(thd, TRUE); /* Do an implicit commit at end of statement for non-temporary tables. This can fail, but we should unlock the table @@ -3724,7 +3710,7 @@ void select_create::abort() truncating the transaction cache of the binary log. To do this, we pretend that the statement is transactional, even though it might be the case that it was not. - + We roll back the statement prior to deleting the table and prior to releasing the lock on the table, since there might be potential for failure if the rollback is executed after the drop or after @@ -3735,13 +3721,11 @@ void select_create::abort() log state. */ tmp_disable_binlog(thd); - if ((thd->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) == 0 && - !create_info->table_existed) - ha_enable_transaction(thd, TRUE); select_insert::abort(); thd->transaction.stmt.modified_non_trans_table= FALSE; reenable_binlog(thd); + if (m_plock) { mysql_unlock_tables(thd, *m_plock); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 5b2fe04f1e2..e0baa986272 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3519,12 +3519,6 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables, ptr=strxmov(ptr, " row_format=", ha_row_type[(uint) share->row_type], NullS); - if (share->transactional != HA_CHOICE_UNDEF) - { - ptr= strxmov(ptr, " TRANSACTIONAL=", - (share->transactional == HA_CHOICE_YES ? "1" : "0"), - NullS); - } #ifdef WITH_PARTITION_STORAGE_ENGINE if (show_table->s->db_type() == partition_hton && show_table->part_info != NULL &&