1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +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

@ -1,4 +1,6 @@
--disable_ps2_protocol
--connection slave
SET @saved_slave_type_conversions = @@slave_type_conversions;
@ -257,4 +259,4 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
DROP TABLE t1,t2;
--sync_slave_with_master
--enable_ps2_protocol

View File

@ -6,6 +6,7 @@
## - $engine_type should be set
##
--disable_ps2_protocol
set sql_mode=no_engine_substitution;
eval set default_storage_engine = $engine_type;
set autocommit=1;
@ -782,3 +783,4 @@ call p_verify_status_increment(0, 0, 0, 0);
drop table t1, t2, t3;
drop procedure p_verify_status_increment;
drop function f1;
--enable_ps2_protocol

View File

@ -463,6 +463,7 @@ select * from t1;
show create table t1;
drop table t1;
--disable_ps2_protocol
# Ensure that row_count() value is reset after drop table.
select 1;
select hex(concat(row_count()));
@ -474,6 +475,7 @@ select hex(concat(found_rows()));
create table t1 as select concat(found_rows()) as c1;
show create table t1;
drop table t1;
--enable_ps2_protocol
create table t1 as select concat(uuid_short()) as c1;
show create table t1;

View File

@ -165,9 +165,11 @@ while ($_dt_tables)
# Now that we have the comma-separated list of columns, we can write
# the table to a file.
--disable_ps2_protocol
--let $_dt_outfile= `SELECT @@datadir`
--let $_dt_outfile= $_dt_outfile/diff_table-$_dt_connection-$_dt_database-$_dt_table
eval SELECT * INTO OUTFILE '$_dt_outfile' FROM $_dt_database.$_dt_table ORDER BY `$_dt_column_list`;
--enable_ps2_protocol
# Compare files.
if ($_dt_prev_outfile)

View File

@ -26,6 +26,7 @@
--echo # query: $query
--echo # select: $select
--echo #
--disable_ps2_protocol
--disable_view_protocol
if ($select) {
--disable_query_log
@ -160,3 +161,4 @@ SHOW STATUS WHERE (Variable_name LIKE 'Sort%' OR
--echo
--enable_view_protocol
--enable_ps2_protocol

View File

@ -824,6 +824,7 @@ eval CREATE TABLE t2 (
i $datetime DEFAULT $current_timestamp ON UPDATE $current_timestamp NOT NULL
);
--disable_ps2_protocol
SELECT 1 INTO OUTFILE 't3.dat' FROM dual;
SELECT NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
@ -831,6 +832,7 @@ INTO OUTFILE 't4.dat'
FROM dual;
SELECT 1, 2 INTO OUTFILE 't5.dat' FROM dual;
--enable_ps2_protocol
--echo # Mon Aug 1 15:11:19 2011 UTC
SET TIMESTAMP = 1312211479.918273;
@ -929,9 +931,11 @@ remove_file $MYSQLD_DATADIR/test/t5.dat;
--echo # Mon Aug 1 15:11:19 2011 UTC
SET TIMESTAMP = 1312211479.089786;
--disable_ps2_protocol
SELECT 1 INTO OUTFILE "file1.dat" FROM dual;
SELECT NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
INTO OUTFILE "file2.dat" FROM dual;
--enable_ps2_protocol
--echo # Too short row

View File

@ -54,6 +54,8 @@ set GLOBAL query_cache_type=ON;
set LOCAL query_cache_type=ON;
set GLOBAL query_cache_size=1355776;
--disable_ps2_protocol
reset query cache;
flush status;
connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
@ -171,6 +173,8 @@ show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_not_cached";
--enable_ps2_protocol
# Cleanup
connection root;

View File

@ -869,6 +869,7 @@ SET optimizer_switch=@save_optimizer_switch;
DROP TABLE t1,t2;
--disable_ps2_protocol
--echo # check "Handler_pushed" status varuiables
CREATE TABLE t1 (
c1 CHAR(1),
@ -890,6 +891,7 @@ SELECT * FROM t1 WHERE (c2='3' or c2='4') and c2 % 2 = 0 ;
show status like "Handler_icp%";
DROP TABLE t1;
--enable_ps2_protocol
#
# MDEV-308 lp:1008516 - Failing assertion: templ->mysql_col_len == len

View File

@ -14,6 +14,7 @@
# old name was innodb_cache.test
# main code went into include/query_cache.inc
#
--disable_ps2_protocol
--disable_view_protocol
SET global query_cache_type=ON;
SET local query_cache_type=ON;
@ -192,3 +193,4 @@ drop table t2;
SET global query_cache_type=default;
--enable_view_protocol
--enable_ps2_protocol

View File

@ -44,13 +44,14 @@ flush status;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
--disable_ps2_protocol
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
--enable_ps2_protocol
drop table t1;
@ -79,12 +80,14 @@ flush status;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
--disable_ps2_protocol
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
--enable_ps2_protocol
drop table t1;
@ -114,6 +117,7 @@ INSERT INTO t1 VALUES (1, now(), 0);
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
--disable_ps2_protocol
BEGIN;
UPDATE `t1` SET `cool` = 1 WHERE `id` = 1;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
@ -126,6 +130,7 @@ SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
--enable_ps2_protocol
drop table t1;

View File

@ -23,6 +23,8 @@
set GLOBAL query_cache_type=ON;
set LOCAL query_cache_type=ON;
--disable_ps2_protocol
connect (con1,localhost,root,,test,$MASTER_MYPORT,);
connection default;
@ -252,6 +254,7 @@ set @a=10;
execute stmt1 using @a;
show status like 'Qcache_hits';
--enable_ps2_protocol
drop table t1;
disconnect con1;

View File

@ -1 +1,3 @@
--disable_ps2_protocol
eval select "Outfile OK" into outfile "$MYSQLTEST_VARDIR/tmp/outfile.test";
--enable_ps2_protocol

View File

@ -34,8 +34,10 @@ SET sql_mode=DEFAULT;
--eval CREATE TABLE t1 (a $type DEFAULT $defval, b $type DEFAULT $defval)
--eval INSERT INTO t1 VALUES (DEFAULT,DEFAULT);
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--disable_ps2_protocol
--eval SELECT a INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/mdev-7824.txt' FROM t1
DELETE FROM t1;
--enable_ps2_protocol
SET sql_mode=TRADITIONAL;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error ER_INVALID_DEFAULT_VALUE_FOR_FIELD

View File

@ -46,7 +46,9 @@ if (`SELECT LENGTH(@@secure_file_priv) > 0`)
--let $_wvtf_suffix= `SELECT UUID()`
--let $_wvtf_tmp_file= $MYSQLTEST_VARDIR/_wvtf_$_wvtf_suffix
--disable_ps2_protocol
--eval SELECT '$write_var' INTO DUMPFILE '$_wvtf_tmp_file'
--enable_ps2_protocol
--copy_file $_wvtf_tmp_file $write_to_file
--remove_file $_wvtf_tmp_file
}