1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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"
This commit is contained in:
Guilhem Bichot
2008-06-03 21:35:39 +02:00
parent 280c989c4e
commit cd8f6a1e16
6 changed files with 19 additions and 27 deletions

View File

@@ -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
@@ -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);