Commit 1bc3899a authored by Sergei Golubchik's avatar Sergei Golubchik

Merge branch '10.0' into 10.1

parents de0e5fe1 34045af0
set global my_cache.key_buffer_size = 1024*1024;
create table t1 (i int) engine=myisam partition by hash (i) partitions 2;
xa start 'xid';
cache index t1 partition (non_existing_partition) in my_cache;
Table Op Msg_type Msg_text
test.t1 assign_to_keycache error Error in list of partitions to test.t1
cache index t1 partition (p1) in my_cache;
Table Op Msg_type Msg_text
test.t1 assign_to_keycache status OK
xa end 'xid';
xa rollback 'xid';
drop table t1;
set global my_cache.key_buffer_size = 0;
...@@ -562,7 +562,7 @@ INSERT INTO db1.trans (a) VALUES (1); ...@@ -562,7 +562,7 @@ INSERT INTO db1.trans (a) VALUES (1);
cache index t3 in keycache; cache index t3 in keycache;
CALL db1.test_if_commit(); CALL db1.test_if_commit();
IMPLICIT COMMIT IMPLICIT COMMIT
YES NO
set global keycache.key_buffer_size=0; set global keycache.key_buffer_size=0;
# #
# SQLCOM_PRELOAD_KEYS # SQLCOM_PRELOAD_KEYS
...@@ -571,7 +571,7 @@ INSERT INTO db1.trans (a) VALUES (1); ...@@ -571,7 +571,7 @@ INSERT INTO db1.trans (a) VALUES (1);
load index into cache t3; load index into cache t3;
CALL db1.test_if_commit(); CALL db1.test_if_commit();
IMPLICIT COMMIT IMPLICIT COMMIT
YES NO
# #
# SQLCOM_FLUSH # SQLCOM_FLUSH
# #
......
#
# MDEV-15216 Assertion `! is_set() || m_can_overwrite_status' failed in Diagnostics_area::set_error_status upon operation inside XA
#
--source include/have_partition.inc
set global my_cache.key_buffer_size = 1024*1024;
create table t1 (i int) engine=myisam partition by hash (i) partitions 2;
xa start 'xid';
cache index t1 partition (non_existing_partition) in my_cache;
cache index t1 partition (p1) in my_cache;
xa end 'xid';
xa rollback 'xid';
drop table t1;
set global my_cache.key_buffer_size = 0;
...@@ -1113,7 +1113,9 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, ...@@ -1113,7 +1113,9 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
} }
else else
{ {
if (trans_commit_stmt(thd) || trans_commit_implicit(thd)) if (trans_commit_stmt(thd) ||
(stmt_causes_implicit_commit(thd, CF_IMPLICIT_COMMIT_END) &&
trans_commit_implicit(thd)))
goto err; goto err;
} }
close_thread_tables(thd); close_thread_tables(thd);
...@@ -1147,6 +1149,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, ...@@ -1147,6 +1149,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
err: err:
/* Make sure this table instance is not reused after the failure. */ /* Make sure this table instance is not reused after the failure. */
trans_rollback_stmt(thd); trans_rollback_stmt(thd);
if (stmt_causes_implicit_commit(thd, CF_IMPLICIT_COMMIT_END))
trans_rollback(thd); trans_rollback(thd);
if (table && table->table) if (table && table->table)
{ {
......
...@@ -198,7 +198,7 @@ static bool some_non_temp_table_to_be_updated(THD *thd, TABLE_LIST *tables) ...@@ -198,7 +198,7 @@ static bool some_non_temp_table_to_be_updated(THD *thd, TABLE_LIST *tables)
/* /*
Implicitly commit a active transaction if statement requires so. Check whether the statement implicitly commits an active transaction.
@param thd Thread handle. @param thd Thread handle.
@param mask Bitmask used for the SQL command match. @param mask Bitmask used for the SQL command match.
...@@ -206,7 +206,7 @@ static bool some_non_temp_table_to_be_updated(THD *thd, TABLE_LIST *tables) ...@@ -206,7 +206,7 @@ static bool some_non_temp_table_to_be_updated(THD *thd, TABLE_LIST *tables)
@return 0 No implicit commit @return 0 No implicit commit
@return 1 Do a commit @return 1 Do a commit
*/ */
static bool stmt_causes_implicit_commit(THD *thd, uint mask) bool stmt_causes_implicit_commit(THD *thd, uint mask)
{ {
LEX *lex= thd->lex; LEX *lex= thd->lex;
bool skip= FALSE; bool skip= FALSE;
......
...@@ -85,6 +85,7 @@ bool check_identifier_name(LEX_STRING *str, uint max_char_length, ...@@ -85,6 +85,7 @@ bool check_identifier_name(LEX_STRING *str, uint max_char_length,
uint err_code, const char *param_for_err_msg); uint err_code, const char *param_for_err_msg);
bool mysql_test_parse_for_slave(THD *thd,char *inBuf,uint length); bool mysql_test_parse_for_slave(THD *thd,char *inBuf,uint length);
bool sqlcom_can_generate_row_events(const THD *thd); bool sqlcom_can_generate_row_events(const THD *thd);
bool stmt_causes_implicit_commit(THD *thd, uint mask);
bool is_update_query(enum enum_sql_command command); bool is_update_query(enum enum_sql_command command);
bool is_log_table_write_query(enum enum_sql_command command); bool is_log_table_write_query(enum enum_sql_command command);
bool alloc_query(THD *thd, const char *packet, uint packet_length); bool alloc_query(THD *thd, const char *packet, uint packet_length);
......
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