MDEV-34589 Do not execute before queries in spider_db_mbase::rollback()
Rollback is not supposed to fail. This prevents false failures in spider rollback.
This commit is contained in:
parent
42735c557e
commit
282b92f0a2
23
storage/spider/mysql-test/spider/bugfix/r/mdev_34589.result
Normal file
23
storage/spider/mysql-test/spider/bugfix/r/mdev_34589.result
Normal file
@ -0,0 +1,23 @@
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
set spider_same_server_link= 1;
|
||||
CREATE USER spider@localhost IDENTIFIED BY 'pwd';
|
||||
GRANT ALL ON test.* TO spider@localhost;
|
||||
CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'spider',PASSWORD 'pwd');
|
||||
SET spider_internal_sql_log_off=0;
|
||||
CREATE TABLE t1 (c INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql", SRV "srv", TABLE "t1"' PARTITION BY HASH (c) PARTITIONS 2;
|
||||
CHECK TABLE t2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t2 check error Partition p0 returned error
|
||||
test.t2 check Error Access denied; you need (at least one of) the SUPER privilege(s) for this operation
|
||||
test.t2 check Error Access denied; you need (at least one of) the SUPER privilege(s) for this operation
|
||||
test.t2 check error Unknown - internal error 1227 during operation
|
||||
drop table t1, t2;
|
||||
drop server srv;
|
||||
drop user spider@localhost;
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
24
storage/spider/mysql-test/spider/bugfix/t/mdev_34589.test
Normal file
24
storage/spider/mysql-test/spider/bugfix/t/mdev_34589.test
Normal file
@ -0,0 +1,24 @@
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source ../../t/test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
set spider_same_server_link= 1;
|
||||
CREATE USER spider@localhost IDENTIFIED BY 'pwd';
|
||||
GRANT ALL ON test.* TO spider@localhost;
|
||||
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'spider',PASSWORD 'pwd');
|
||||
SET spider_internal_sql_log_off=0;
|
||||
CREATE TABLE t1 (c INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql", SRV "srv", TABLE "t1"' PARTITION BY HASH (c) PARTITIONS 2;
|
||||
CHECK TABLE t2;
|
||||
drop table t1, t2;
|
||||
drop server srv;
|
||||
drop user spider@localhost;
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source ../../t/test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
@ -2548,13 +2548,21 @@ int spider_db_mbase::commit(
|
||||
int spider_db_mbase::rollback(
|
||||
int *need_mon
|
||||
) {
|
||||
bool is_error;
|
||||
bool is_error, save_in_before_query;
|
||||
int error_num= 0;
|
||||
DBUG_ENTER("spider_db_mbase::rollback");
|
||||
DBUG_PRINT("info",("spider this=%p", this));
|
||||
spider_lock_before_query(conn, need_mon);
|
||||
if (spider_db_query(conn, SPIDER_SQL_ROLLBACK_STR,
|
||||
SPIDER_SQL_ROLLBACK_LEN, -1, need_mon))
|
||||
save_in_before_query= conn->in_before_query;
|
||||
/*
|
||||
We do not execute the before queries to avoid unnecessary
|
||||
failures in rollback
|
||||
*/
|
||||
conn->in_before_query= TRUE;
|
||||
error_num= spider_db_query(conn, SPIDER_SQL_ROLLBACK_STR,
|
||||
SPIDER_SQL_ROLLBACK_LEN, -1, need_mon);
|
||||
conn->in_before_query= save_in_before_query;
|
||||
if (error_num)
|
||||
{
|
||||
is_error= conn->thd->is_error();
|
||||
error_num= spider_db_errorno(conn);
|
||||
|
Loading…
x
Reference in New Issue
Block a user