Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-31787 MDEV-26151 Add a test exercising non-0 spider_casual_read
Also: - clean up spider_check_and_get_casual_read_conn() and spider_check_and_set_autocommit() - remove a couple of commented out code blocks
- Loading branch information
1 parent
d59334d
commit 96760d3
Showing
4 changed files
with
145 additions
and
62 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
storage/spider/mysql-test/spider/bugfix/r/mdev_26151.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
MDEV-26151 MDEV-31787 | ||
|
||
for master_1 | ||
for child2 | ||
for child3 | ||
set @old_spider_bgs_mode= @@spider_bgs_mode; | ||
set session spider_bgs_mode=1; | ||
CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); | ||
create table td (a int, PRIMARY KEY (a)); | ||
create table ts (a int, PRIMARY KEY (a)) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_mdev_26151",TABLE "td", casual_read "3"'; | ||
insert into td values (11), (42); | ||
select max(a) from ts; | ||
max(a) | ||
42 | ||
drop table td, ts; | ||
create table td (a int, PRIMARY KEY (a)); | ||
create table ts (a int, PRIMARY KEY (a)) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_mdev_26151",TABLE "td", casual_read "1"'; | ||
insert into td values (11), (42); | ||
select max(a) from ts; | ||
max(a) | ||
42 | ||
select min(a) from ts; | ||
min(a) | ||
11 | ||
drop table td, ts; | ||
drop server srv_mdev_26151; | ||
set session spider_bgs_mode=@old_spider_bgs_mode; | ||
for master_1 | ||
for child2 | ||
for child3 | ||
|
||
end of test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--echo | ||
--echo MDEV-26151 MDEV-31787 | ||
--echo | ||
|
||
# This test exercises the code path where a nonzero casual_read takes | ||
# effect. | ||
|
||
--disable_query_log | ||
--disable_result_log | ||
--source ../../t/test_init.inc | ||
--enable_result_log | ||
--enable_query_log | ||
|
||
--let $srv=srv_mdev_26151 | ||
set @old_spider_bgs_mode= @@spider_bgs_mode; | ||
set session spider_bgs_mode=1; | ||
evalp CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); | ||
|
||
# casual_read != 0 && casual_read != 1 | ||
create table td (a int, PRIMARY KEY (a)); | ||
|
||
eval create table ts (a int, PRIMARY KEY (a)) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "$srv",TABLE "td", casual_read "3"'; | ||
|
||
insert into td values (11), (42); | ||
|
||
select max(a) from ts; | ||
|
||
drop table td, ts; | ||
|
||
create table td (a int, PRIMARY KEY (a)); | ||
|
||
# casual_read = 1 | ||
eval create table ts (a int, PRIMARY KEY (a)) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "$srv",TABLE "td", casual_read "1"'; | ||
|
||
insert into td values (11), (42); | ||
|
||
select max(a) from ts; | ||
|
||
select min(a) from ts; | ||
|
||
drop table td, ts; | ||
|
||
eval drop server $srv; | ||
set session spider_bgs_mode=@old_spider_bgs_mode; | ||
|
||
--disable_query_log | ||
--disable_result_log | ||
--source ../../t/test_deinit.inc | ||
--enable_result_log | ||
--enable_query_log | ||
|
||
--echo | ||
--echo end of test | ||
--echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters