MDEV-31003: Second execution for ps-protocol

This patch adds for "--ps-protocol" second execution
of queries "SELECT".
Also in this patch it is added ability to disable/enable
(--disable_ps2_protocol/--enable_ps2_protocol) second
execution for "--ps-prototocol" in testcases.
This commit is contained in:
Lena Startseva 2023-05-31 11:57:45 +07:00
commit 9854fb6fa7
400 changed files with 1339 additions and 42 deletions

View file

@ -272,7 +272,9 @@ let $MYSQLD_DATADIR= `select @@datadir`;
use test;
let $benchmark_file= `select replace(concat("benchmark_",uuid(),".out"),"-","_")`;
--replace_regex /benchmark_.*.out/benchmark.out/
--disable_ps2_protocol
eval select * from test1.benchmark into outfile '$benchmark_file';
--enable_ps2_protocol
select ts from test0.benchmark where state like 'master started load' into @m_0;
select ts from test0.benchmark where state like 'master ends load' into @m_1;
select ts from test0.benchmark where state like 'slave takes on load' into @s_m0;
@ -282,10 +284,11 @@ select ts from test0.benchmark where state like 'slave ends load' into @s_1;
select ts from test0.benchmark where state like 'slave is processing load' into @s_0;
let $delta_file= `select replace(concat("delta_",uuid(),".out"),"-","_")`;
--replace_regex /delta_.*.out/delta.out/
--disable_ps2_protocol
eval select time_to_sec(@m_1) - time_to_sec(@m_0) as 'delta_m',
time_to_sec(@s_1) - time_to_sec(@s_0) as 'delta_s',
time_to_sec(@s_m1) - time_to_sec(@s_m0) as 'delta_sm' into outfile '$delta_file';
--enable_ps2_protocol
#
# Consistency verification

View file

@ -9,6 +9,7 @@ create table t (id int not null, x int not null, y int not null, primary key(id)
insert into t values (0,0,0),(1,1,1),(2,2,2),(3,2,3),(4,2,4);
--disable_ps2_protocol
explain select x,id from t force index (x) where x=0 and id=0;
flush status;
select x,id from t force index (x) where x=0 and id=0;
@ -38,5 +39,6 @@ explain select x,id from t force index (x) where x=2 and id=0;
flush status;
select x,id from t force index (x) where x=2 and id=0;
show status like 'handler_read%';
--enable_ps2_protocol
drop table t;

View file

@ -8,6 +8,7 @@ create table t (id int not null, x int not null, y int not null, primary key(id)
insert into t values (0,0,0),(1,1,1),(2,2,2),(3,2,3),(4,2,4);
--disable_ps2_protocol
explain select x,id from t force index (x) where x=0 and id=0;
flush status;
select x,id from t force index (x) where x=0 and id=0;
@ -37,5 +38,6 @@ explain select x,id from t force index (x) where x=2 and id=0;
flush status;
select x,id from t force index (x) where x=2 and id=0;
show status like 'handler_read%';
--enable_ps2_protocol
drop table t;

View file

@ -9,6 +9,7 @@ create table t (a int not null, b int not null, c int not null, d int not null,
insert into t values (0,0,0,0),(0,1,0,1);
--disable_ps2_protocol
explain select c,a,b from t where c=0 and a=0 and b=1;
flush status;
select c,a,b from t where c=0 and a=0 and b=1;
@ -18,5 +19,6 @@ explain select c,a,b from t force index (c) where c=0 and a=0 and b=1;
flush status;
select c,a,b from t force index (c) where c=0 and a=0 and b=1;
show status like 'handler_read%';
--enable_ps2_protocol
drop table t;

View file

@ -8,6 +8,7 @@ create table t (a int not null, b int not null, c int not null, d int not null,
insert into t values (0,0,0,0),(0,1,0,1);
--disable_ps2_protocol
explain select c,a,b from t where c=0 and a=0 and b=1;
flush status;
select c,a,b from t where c=0 and a=0 and b=1;
@ -17,5 +18,6 @@ explain select c,a,b from t force index (c) where c=0 and a=0 and b=1;
flush status;
select c,a,b from t force index (c) where c=0 and a=0 and b=1;
show status like 'handler_read%';
--enable_ps2_protocol
drop table t;

View file

@ -148,10 +148,14 @@ commit|
set autocommit= 1|
# Let us test that savepoints work inside of functions
# even in auto-commit mode
--disable_ps2_protocol
select bug13825_3(0)|
--enable_ps2_protocol
select * from t1|
delete from t1|
--disable_ps2_protocol
select bug13825_3(1)|
--enable_ps2_protocol
select * from t1|
delete from t1|
# Curious case: rolling back to savepoint which is set by first

View file

@ -278,6 +278,7 @@ drop table t1;
# Bug#28261: Wrong DATETIME comparison result when the GET_USER_VAR function
# is involved.
#
--disable_ps2_protocol
create table t1(f1 date);
insert into t1 values('01-01-01'),('02-02-02'),('01-01-01'),('02-02-02');
set @bug28261='';
@ -285,6 +286,7 @@ select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
drop table t1;
--enable_ps2_protocol
#
# Bug#28778: Wrong result of BETWEEN when comparing a DATETIME field with an

View file

@ -1212,7 +1212,9 @@ CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL);
INSERT INTO t1 VALUES (3,30), (1,10), (2,10);
SET @a= CAST(1 AS decimal);
--disable_ps2_protocol
SELECT 1 FROM t1 GROUP BY @b := @a, @b;
--enable_ps2_protocol
DROP TABLE t1;

View file

@ -10,8 +10,10 @@ SET tokudb_auto_analyze=0;
INSERT INTO t1 VALUES(0,0,0), (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5);
SET GLOBAL debug_dbug = "+d,tokudb_fake_db_notfound_error_in_read_full_row";
--disable_ps2_protocol
--error ER_NOT_KEYFILE
SELECT * FROM t1 WHERE b = 2;
--enable_ps2_protocol
DROP TABLE t1;

View file

@ -16,6 +16,7 @@ create table foo (a int, b int, c int, d int, e int, key(a,b,c)) engine=TokuDB;
insert into foo (a,b,c) select * from a,b,c;
--disable_ps2_protocol
flush status;
show status like '%Handler_read_next%';
replace_column 9 NA;
@ -43,5 +44,6 @@ replace_column 9 NA;
explain select * from foo where a > 19 and c=10;
select * from foo where a > 19 and c=10;
show status like '%Handler_read_next%';
--enable_ps2_protocol
drop table foo,a,b,c;