From 2fb735ffc1afa09d55364a44c780c6047dfaac09 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Wed, 25 May 2022 22:32:34 +0300 Subject: [PATCH] tests: add echo for 01883_grouping_sets_crash Signed-off-by: Azat Khuzhin --- .../01883_grouping_sets_crash.reference | 78 +++++++++++++++++++ .../0_stateless/01883_grouping_sets_crash.sql | 4 +- 2 files changed, 81 insertions(+), 1 deletion(-) diff --git a/tests/queries/0_stateless/01883_grouping_sets_crash.reference b/tests/queries/0_stateless/01883_grouping_sets_crash.reference index 4d9e967b766..bdb7adec06c 100644 --- a/tests/queries/0_stateless/01883_grouping_sets_crash.reference +++ b/tests/queries/0_stateless/01883_grouping_sets_crash.reference @@ -1,3 +1,14 @@ +-- { echoOn } +SELECT + fact_3_id, + fact_4_id +FROM grouping_sets +GROUP BY + GROUPING SETS ( + ('wo\0ldworldwo\0ldworld'), + (fact_3_id, fact_4_id)) +ORDER BY + fact_3_id, fact_4_id; 0 0 1 1 2 2 @@ -9,7 +20,23 @@ 8 8 9 9 10 10 +SELECT 'SECOND QUERY:'; SECOND QUERY: +SELECT + fact_3_id, + fact_4_id +FROM grouping_sets +GROUP BY + GROUPING SETS ( + (fact_1_id, fact_2_id), + ((-9223372036854775808, NULL, (tuple(1.), (tuple(1.), 1048576), 65535))), + ((tuple(3.4028234663852886e38), (tuple(1024), -2147483647), NULL)), + (fact_3_id, fact_4_id)) +ORDER BY + (NULL, ('256', (tuple(NULL), NULL), NULL, NULL), NULL) ASC, + fact_1_id DESC NULLS FIRST, + fact_2_id DESC NULLS FIRST, + fact_4_id ASC; 0 0 0 0 0 0 @@ -32,7 +59,26 @@ SECOND QUERY: 8 8 9 9 10 10 +SELECT 'THIRD QUERY:'; THIRD QUERY: +SELECT + extractAllGroups(NULL, 'worldworldworldwo\0ldworldworldworldwo\0ld'), + fact_2_id, + fact_3_id, + fact_4_id +FROM grouping_sets +GROUP BY + GROUPING SETS ( + (sales_value), + (fact_1_id, fact_2_id), + ('wo\0ldworldwo\0ldworld'), + (fact_3_id, fact_4_id)) +ORDER BY + fact_1_id DESC NULLS LAST, + fact_1_id DESC NULLS FIRST, + fact_2_id ASC, + fact_3_id DESC NULLS FIRST, + fact_4_id ASC; \N 1 0 0 \N 2 0 0 \N 3 0 0 @@ -154,6 +200,11 @@ THIRD QUERY: \N 0 0 0 \N 0 0 0 \N 0 0 0 +SELECT fact_3_id +FROM grouping_sets +GROUP BY + GROUPING SETS ((fact_3_id, fact_4_id)) +ORDER BY fact_3_id ASC; 1 2 3 @@ -164,6 +215,24 @@ THIRD QUERY: 8 9 10 +-- Following two queries were fuzzed +SELECT 'w\0\0ldworldwo\0l\0world' +FROM grouping_sets +GROUP BY + GROUPING SETS ( + ( fact_4_id), + ( NULL), + ( fact_3_id, fact_4_id)) +ORDER BY + NULL ASC, + NULL DESC NULLS FIRST, + fact_3_id ASC, + fact_3_id ASC NULLS LAST, + 'wo\0ldworldwo\0ldworld' ASC NULLS LAST, + 'w\0\0ldworldwo\0l\0world' DESC NULLS FIRST, + 'wo\0ldworldwo\0ldworld' ASC, + NULL ASC NULLS FIRST, + fact_4_id DESC NULLS LAST; w\0\0ldworldwo\0l\0world w\0\0ldworldwo\0l\0world w\0\0ldworldwo\0l\0world @@ -185,6 +254,15 @@ w\0\0ldworldwo\0l\0world w\0\0ldworldwo\0l\0world w\0\0ldworldwo\0l\0world w\0\0ldworldwo\0l\0world +SELECT fact_3_id +FROM grouping_sets +GROUP BY + GROUPING SETS ( + ( 'wo\0ldworldwo\0ldworldwo\0ldworldwo\0ldworldwo\0ldworldwo\0ldworldwo\0ldworldwo\0ldworld'), + ( NULL), + ( fact_4_id), + ( fact_3_id, fact_4_id)) +ORDER BY fact_3_id ASC NULLS FIRST; 0 0 0 diff --git a/tests/queries/0_stateless/01883_grouping_sets_crash.sql b/tests/queries/0_stateless/01883_grouping_sets_crash.sql index cf56c8546ce..7810ad1d8da 100644 --- a/tests/queries/0_stateless/01883_grouping_sets_crash.sql +++ b/tests/queries/0_stateless/01883_grouping_sets_crash.sql @@ -11,6 +11,7 @@ SELECT number % 100 AS sales_value FROM system.numbers limit 1000; +-- { echoOn } SELECT fact_3_id, fact_4_id @@ -96,4 +97,5 @@ GROUP BY ( fact_3_id, fact_4_id)) ORDER BY fact_3_id ASC NULLS FIRST; -DROP TABLE IF EXISTS grouping_sets; \ No newline at end of file +-- { echoOff } +DROP TABLE IF EXISTS grouping_sets;