3663 Mattias Jonsson 2011-12-19
Post push fix for bug#13357766.
Too agressiv to set table->m_needs_reopen
in beginning of mysql_admin_table.
Changed to only set it on failure.
Also a miss in truncate_partition,
failure was incorrectly logged to binlog.
modified:
sql/ha_partition.cc
sql/sql_admin.cc
3662 Andrei Elkin 2011-12-19
BUG#12964649
fixing slave_checkpoint_group_basic.
modified:
sql/sys_vars.cc
=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc 2011-12-19 13:21:37 +0000
+++ b/sql/ha_partition.cc 2011-12-19 22:31:09 +0000
@@ -3803,12 +3803,12 @@ int ha_partition::truncate_partition(Alt
uint i= 0;
DBUG_ENTER("ha_partition::truncate_partition");
- if (set_part_state(alter_info, m_part_info, PART_ADMIN))
- DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND);
-
/* Only binlog when it starts any call to the partitions handlers */
*binlog_stmt= false;
+ if (set_part_state(alter_info, m_part_info, PART_ADMIN))
+ DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND);
+
/*
TRUNCATE also means resetting auto_increment. Hence, reset
it so that it will be initialized again at the next use.
=== modified file 'sql/sql_admin.cc'
--- a/sql/sql_admin.cc 2011-11-08 12:55:37 +0000
+++ b/sql/sql_admin.cc 2011-12-19 22:31:09 +0000
@@ -379,10 +379,6 @@ static bool mysql_admin_table(THD* thd,
open_error= open_and_lock_tables(thd, table, TRUE, 0);
}
- /* Make sure this table instance is not reused after the operation. */
- if (table->table)
- table->table->m_needs_reopen= true;
-
table->next_global= save_next_global;
table->next_local= save_next_local;
thd->open_options&= ~extra_open_options;
@@ -453,6 +449,9 @@ static bool mysql_admin_table(THD* thd,
case 1: // error, message written to net
trans_rollback_stmt(thd);
trans_rollback(thd);
+ /* Make sure this table instance is not reused after the operation. */
+ if (table->table)
+ table->table->m_needs_reopen= true;
close_thread_tables(thd);
thd->mdl_context.release_transactional_locks();
DBUG_PRINT("admin", ("simple error, admin next table"));
@@ -525,6 +524,9 @@ static bool mysql_admin_table(THD* thd,
protocol->store(buff, length, system_charset_info);
trans_commit_stmt(thd);
trans_commit(thd);
+ /* Make sure this table instance is not reused after the operation. */
+ if (table->table)
+ table->table->m_needs_reopen= true;
close_thread_tables(thd);
thd->mdl_context.release_transactional_locks();
lex->reset_query_tables_list(FALSE);
@@ -601,6 +603,9 @@ static bool mysql_admin_table(THD* thd,
trans_rollback_stmt(thd);
trans_rollback(thd);
+ /* Make sure this table instance is not reused after the operation. */
+ if (table->table)
+ table->table->m_needs_reopen= true;
close_thread_tables(thd);
thd->mdl_context.release_transactional_locks();
@@ -821,6 +826,9 @@ send_result_message:
}
thd->clear_error();
}
+ /* Make sure this table instance is not reused after the operation. */
+ if (table->table)
+ table->table->m_needs_reopen= true;
}
result_code= result_code ? HA_ADMIN_FAILED : HA_ADMIN_OK;
table->next_local= save_next_local;
@@ -920,6 +928,9 @@ send_result_message:
err:
trans_rollback_stmt(thd);
trans_rollback(thd);
+ /* Make sure this table instance is not reused after the operation. */
+ if (table->table)
+ table->table->m_needs_reopen= true;
close_thread_tables(thd); // Shouldn't be needed
thd->mdl_context.release_transactional_locks();
DBUG_RETURN(TRUE);
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (mattias.jonsson:3662 to 3663) Bug#13357766 | Mattias Jonsson | 20 Dec |