1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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
parent 23dae6173c
commit 9854fb6fa7
400 changed files with 1339 additions and 42 deletions

View File

@@ -164,10 +164,14 @@ let SEARCH_PATTERN= \[ERROR\] InnoDB: Tablespace [0-9]+ was not found at .*test.
-- source include/restart_mysqld.inc
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
--disable_ps2_protocol
SELECT * FROM bug16735660;
--enable_ps2_protocol
XA RECOVER;
XA ROLLBACK 'x';
--disable_ps2_protocol
SELECT * FROM bug16735660;
--enable_ps2_protocol
DROP TABLE bug16735660;

View File

@@ -439,7 +439,9 @@ end|
delimiter ;|
flush tables;
flush status;
--disable_ps2_protocol
select foo();
--enable_ps2_protocol
show status like '%opened_tab%';
drop function foo;
drop table t2, t1;

View File

@@ -25,7 +25,9 @@ END //
DELIMITER ;//
--disable_ps_protocol
SELECT bug56228();
--enable_ps2_protocol
DROP FUNCTION bug56228;
DROP TEMPORARY TABLE t2_56228;

View File

@@ -22,7 +22,9 @@ start transaction;
update t1 set f2 = 4 where f1 = 1 and f2 is null;
-- echo (b) Number of rows updated:
--disable_ps2_protocol
select row_count();
--enable_ps2_protocol
insert into t1 values (3, 1, null);
@@ -40,7 +42,9 @@ SET SESSION debug_dbug="+d,bug14007649";
update t1 set f2 = 6 where f1 = 1 and f2 is null;
-- echo (a) Number of rows updated:
--disable_ps2_protocol
select row_count();
--enable_ps2_protocol
-- echo (a) After the update statement is executed.
select rowid, f1, f2 from t1;

View File

@@ -36,13 +36,17 @@ CONNECT (con3,localhost,root,,);
--let $shutdown_timeout=0
--source include/restart_mysqld.inc
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
--disable_ps2_protocol
SELECT * FROM t;
--enable_ps2_protocol
COMMIT;
--source include/restart_mysqld.inc
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
--disable_ps2_protocol
SELECT * FROM t;
--enable_ps2_protocol
COMMIT;
--sorted_result
XA RECOVER;

View File

@@ -160,7 +160,9 @@ connection default;
let $status=`SHOW ENGINE INNODB STATUS`;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
--disable_ps2_protocol
select * from t2;
--enable_ps2_protocol
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
select * from t2;
SET SESSION innodb_lock_wait_timeout=1;

View File

@@ -128,7 +128,9 @@ INSERT INTO t1 (f1,f2,f3,f4,f5,f6,f7,f8) VALUES
INSERT INTO t1 (f1,f2,f3,f4,f5,f6,f7,f8) VALUES ('impact', 'b', 'h', 185, 'fj', 7, 7, 3);
ALTER TABLE t1 ADD COLUMN filler VARCHAR(255) DEFAULT '';
--disable_ps2_protocol
SELECT * INTO OUTFILE 'load.data' FROM t1;
--enable_ps2_protocol
UPDATE IGNORE t1 SET pk = 0;
LOAD DATA INFILE 'load.data' REPLACE INTO TABLE t1;
HANDLER t1 OPEN AS h;

View File

@@ -356,6 +356,7 @@ primary key (a(1), c(1)), key(b)) engine = innodb;
insert into monitor_test values("13", 2, "aa");
--disable_ps2_protocol
select a from monitor_test where b < 1 for update;
# should have icp_attempts = 1 and icp_out_of_range = 1
@@ -367,6 +368,7 @@ select a from monitor_test where b < 3 for update;
select name, count from information_schema.innodb_metrics
where name like "icp%";
--enable_ps2_protocol
drop table monitor_test;
set global innodb_monitor_disable = All;

View File

@@ -55,7 +55,9 @@ ROLLBACK;
--disconnect con2
SELECT * FROM t;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
--disable_ps2_protocol
SELECT * FROM t;
--enable_ps2_protocol
# refused on MySQL 5.6, MariaDB 10.0, 10.1, but not MariaDB 10.2+
UPDATE t SET a=3 WHERE a=1;
--let $restart_parameters= --innodb-read-only

View File

@@ -9,6 +9,7 @@ FLUSH TABLE_STATISTICS;
SET @userstat_old= @@userstat;
SET GLOBAL userstat=ON;
--disable_ps2_protocol
CREATE TABLE t1 (id int(10), PRIMARY KEY (id));
INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
SELECT COUNT(*) FROM t1;
@@ -33,6 +34,7 @@ SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
SELECT COUNT(*) FROM t1;
SELECT ROWS_READ FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t1';
SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
--enable_ps2_protocol
DROP TABLE t1;

View File

@@ -290,7 +290,10 @@ select count(*) from t4 where c1 = 140;
select count(*) from t5 where c1 = 140;
--replace_result $MYSQLTEST_VARDIR VARDIR
--disable_ps2_protocol
eval select * into outfile "$MYSQLTEST_VARDIR/tmp/t1.outfile" from t1;
--enable_ps2_protocol
create temporary table temp_1 engine = innodb as select * from t1 where 1=2;
select count(*) from temp_1;

View File

@@ -47,7 +47,9 @@ DROP TABLE t2;
disconnect con1;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
--disable_ps2_protocol
SELECT * FROM t1;
--enable_ps2_protocol
XA ROLLBACK 'x';
SELECT * FROM t1;