Commit cd8f6a1e authored by Guilhem Bichot's avatar Guilhem Bichot

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"
parent 280c989c
......@@ -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;
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -3532,22 +3532,11 @@ select_create::prepare(List<Item> &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
......@@ -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);
......
......@@ -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 &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment