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:
@ -61,6 +61,7 @@ select grp,group_concat(c order by c) from t1 group by grp;
|
||||
|
||||
# Test warnings
|
||||
|
||||
--disable_ps2_protocol
|
||||
set group_concat_max_len = 4;
|
||||
select grp,group_concat(c) from t1 group by grp;
|
||||
show warnings;
|
||||
@ -72,6 +73,7 @@ set group_concat_max_len = 1024;
|
||||
select group_concat(sum(c)) from t1 group by grp;
|
||||
--error 1054
|
||||
select grp,group_concat(c order by 2) from t1 group by grp;
|
||||
--enable_ps2_protocol
|
||||
|
||||
drop table t1;
|
||||
|
||||
@ -237,10 +239,12 @@ select group_concat(distinct b) from t1 group by a;
|
||||
select group_concat(b order by b) from t1 group by a;
|
||||
select group_concat(distinct b order by b) from t1 group by a;
|
||||
set local group_concat_max_len=4;
|
||||
--disable_ps2_protocol
|
||||
select group_concat(b) from t1 group by a;
|
||||
select group_concat(distinct b) from t1 group by a;
|
||||
select group_concat(b order by b) from t1 group by a;
|
||||
select group_concat(distinct b order by b) from t1 group by a;
|
||||
--enable_ps2_protocol
|
||||
|
||||
#
|
||||
# long blobs
|
||||
@ -256,10 +260,12 @@ select group_concat(distinct b) from t1 group by a;
|
||||
select group_concat(b order by b) from t1 group by a;
|
||||
select group_concat(distinct b order by b) from t1 group by a;
|
||||
set local group_concat_max_len=400;
|
||||
--disable_ps2_protocol
|
||||
select group_concat(b) from t1 group by a;
|
||||
select group_concat(distinct b) from t1 group by a;
|
||||
select group_concat(b order by b) from t1 group by a;
|
||||
select group_concat(distinct b order by b) from t1 group by a;
|
||||
--enable_ps2_protocol
|
||||
|
||||
drop table t1;
|
||||
|
||||
@ -517,10 +523,12 @@ CREATE TABLE t1( a VARCHAR( 10 ), b INT );
|
||||
INSERT INTO t1 VALUES ( repeat( 'a', 10 ), 1),
|
||||
( repeat( 'b', 10 ), 2);
|
||||
SET group_concat_max_len = 20;
|
||||
--disable_ps2_protocol
|
||||
SELECT GROUP_CONCAT( a ) FROM t1;
|
||||
SELECT GROUP_CONCAT( DISTINCT a ) FROM t1;
|
||||
SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1;
|
||||
SELECT GROUP_CONCAT( DISTINCT a ORDER BY b ) FROM t1;
|
||||
SELECT GROUP_CONCAT( DISTINCT a ORDER BY b ) FROM t1;
|
||||
--enable_ps2_protocol
|
||||
SET group_concat_max_len = DEFAULT;
|
||||
DROP TABLE t1;
|
||||
# Bug #23856:GROUP_CONCAT and ORDER BY: junk from previous rows for query on I_S
|
||||
@ -787,7 +795,9 @@ INSERT INTO t1 VALUES ('555555', 5);
|
||||
SET group_concat_max_len = 5;
|
||||
SET @old_sql_mode = @@sql_mode, @@sql_mode = 'traditional';
|
||||
|
||||
--disable_ps2_protocol
|
||||
SELECT GROUP_CONCAT(a), b FROM t1 GROUP BY b LIMIT 3;
|
||||
--enable_ps2_protocol
|
||||
--error ER_CUT_VALUE_GROUP_CONCAT
|
||||
INSERT INTO t2 SELECT GROUP_CONCAT(a), b FROM t1 GROUP BY b;
|
||||
UPDATE t1 SET a = '11111' WHERE b = 1;
|
||||
@ -864,6 +874,7 @@ CREATE TABLE t2 SELECT GROUP_CONCAT(UPPER(f1) ORDER BY f2) FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
DROP TABLE t2;
|
||||
|
||||
--disable_ps2_protocol
|
||||
SET group_concat_max_len= 1024;
|
||||
SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1;
|
||||
|
||||
@ -873,6 +884,7 @@ SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2;
|
||||
|
||||
INSERT INTO t1 VALUES (REPEAT('a', 499999), 3), (REPEAT('b', 500000), 4);
|
||||
SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2;
|
||||
--enable_ps2_protocol
|
||||
|
||||
DROP TABLE t1;
|
||||
SET group_concat_max_len= DEFAULT;
|
||||
@ -882,8 +894,10 @@ SET group_concat_max_len= DEFAULT;
|
||||
#
|
||||
set session group_concat_max_len=1024;
|
||||
set max_session_mem_used=16*1024*1024; # 8M..32M
|
||||
--disable_ps2_protocol
|
||||
SELECT GROUP_CONCAT(concat(seq/1.1), concat(seq/1.1), concat(seq/1.1), concat(seq/1.1), concat(seq/1.1), concat(seq/1.1), concat(seq/1.1), concat(seq/1.1) ORDER BY 2,1,3,4,6,5,8,7) AS c
|
||||
FROM seq_1_to_200000;
|
||||
--enable_ps2_protocol
|
||||
set max_session_mem_used=default;
|
||||
set session group_concat_max_len=default;
|
||||
|
||||
|
Reference in New Issue
Block a user