From 7d480ffa3d3be1a927c8f4d66f413e4c2e594139 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Wed, 15 Apr 2020 02:46:29 +0300 Subject: [PATCH] Added failing tests --- .../01131_max_rows_to_sort.reference | 1 + .../0_stateless/01131_max_rows_to_sort.sql | 7 + .../01132_max_rows_to_read.reference | 6 + .../0_stateless/01132_max_rows_to_read.sql | 17 ++ .../01133_max_result_rows.reference | 158 ++++++++++++++++++ .../0_stateless/01133_max_result_rows.sql | 15 ++ .../01134_set_overflow_mode.reference | 13 ++ .../0_stateless/01134_set_overflow_mode.sql | 17 ++ 8 files changed, 234 insertions(+) create mode 100644 tests/queries/0_stateless/01131_max_rows_to_sort.reference create mode 100644 tests/queries/0_stateless/01131_max_rows_to_sort.sql create mode 100644 tests/queries/0_stateless/01132_max_rows_to_read.reference create mode 100644 tests/queries/0_stateless/01132_max_rows_to_read.sql create mode 100644 tests/queries/0_stateless/01133_max_result_rows.reference create mode 100644 tests/queries/0_stateless/01133_max_result_rows.sql create mode 100644 tests/queries/0_stateless/01134_set_overflow_mode.reference create mode 100644 tests/queries/0_stateless/01134_set_overflow_mode.sql diff --git a/tests/queries/0_stateless/01131_max_rows_to_sort.reference b/tests/queries/0_stateless/01131_max_rows_to_sort.reference new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/tests/queries/0_stateless/01131_max_rows_to_sort.reference @@ -0,0 +1 @@ +1 diff --git a/tests/queries/0_stateless/01131_max_rows_to_sort.sql b/tests/queries/0_stateless/01131_max_rows_to_sort.sql new file mode 100644 index 00000000000..a6109700045 --- /dev/null +++ b/tests/queries/0_stateless/01131_max_rows_to_sort.sql @@ -0,0 +1,7 @@ +SET max_rows_to_sort = 100; +SELECT * FROM system.numbers ORDER BY number; -- { serverError 396 } + +SET sort_overflow_mode = 'break'; +SET max_block_size = 1000; + +SELECT count() >= 100 AND count() <= 1000 FROM (SELECT * FROM system.numbers ORDER BY number); diff --git a/tests/queries/0_stateless/01132_max_rows_to_read.reference b/tests/queries/0_stateless/01132_max_rows_to_read.reference new file mode 100644 index 00000000000..91653a56ef7 --- /dev/null +++ b/tests/queries/0_stateless/01132_max_rows_to_read.reference @@ -0,0 +1,6 @@ +19 +20 +30 +19 +20 +21 diff --git a/tests/queries/0_stateless/01132_max_rows_to_read.sql b/tests/queries/0_stateless/01132_max_rows_to_read.sql new file mode 100644 index 00000000000..7a00365ed4d --- /dev/null +++ b/tests/queries/0_stateless/01132_max_rows_to_read.sql @@ -0,0 +1,17 @@ +SET max_block_size = 10; +SET max_rows_to_read = 20; +SET read_overflow_mode = 'throw'; + +SELECT count() FROM numbers(30); -- { serverError 158 } +SELECT count() FROM numbers(19); +SELECT count() FROM numbers(20); +SELECT count() FROM numbers(21); -- { serverError 158 } + +SET read_overflow_mode = 'break'; + +SELECT count() FROM numbers(19); +SELECT count() FROM numbers(20); +SELECT count() FROM numbers(21); +SELECT count() FROM numbers(29); -- one extra block is read and it is Ok. +SELECT count() FROM numbers(30); +SELECT count() FROM numbers(31); \ No newline at end of file diff --git a/tests/queries/0_stateless/01133_max_result_rows.reference b/tests/queries/0_stateless/01133_max_result_rows.reference new file mode 100644 index 00000000000..61ecaca3948 --- /dev/null +++ b/tests/queries/0_stateless/01133_max_result_rows.reference @@ -0,0 +1,158 @@ +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 diff --git a/tests/queries/0_stateless/01133_max_result_rows.sql b/tests/queries/0_stateless/01133_max_result_rows.sql new file mode 100644 index 00000000000..fe86a5902cf --- /dev/null +++ b/tests/queries/0_stateless/01133_max_result_rows.sql @@ -0,0 +1,15 @@ +SET max_block_size = 10; +SET max_result_rows = 20; +SET result_overflow_mode = 'throw'; + +SELECT DISTINCT intDiv(number, 10) FROM numbers(300); -- { serverError 396 } +SELECT DISTINCT intDiv(number, 10) FROM numbers(190); +SELECT DISTINCT intDiv(number, 10) FROM numbers(200); +SELECT DISTINCT intDiv(number, 10) FROM numbers(210); -- { serverError 396 } + +SET result_overflow_mode = 'break'; + +SELECT DISTINCT intDiv(number, 10) FROM numbers(300); +SELECT DISTINCT intDiv(number, 10) FROM numbers(190); +SELECT DISTINCT intDiv(number, 10) FROM numbers(200); +SELECT DISTINCT intDiv(number, 10) FROM numbers(210); diff --git a/tests/queries/0_stateless/01134_set_overflow_mode.reference b/tests/queries/0_stateless/01134_set_overflow_mode.reference new file mode 100644 index 00000000000..2e981dc7c97 --- /dev/null +++ b/tests/queries/0_stateless/01134_set_overflow_mode.reference @@ -0,0 +1,13 @@ +1 +0 +1 +0 +--- +1 +0 +1 +0 +1 +0 +1 +0 diff --git a/tests/queries/0_stateless/01134_set_overflow_mode.sql b/tests/queries/0_stateless/01134_set_overflow_mode.sql new file mode 100644 index 00000000000..791bc6d7f9e --- /dev/null +++ b/tests/queries/0_stateless/01134_set_overflow_mode.sql @@ -0,0 +1,17 @@ +SET max_block_size = 10; +SET max_rows_in_set = 20; +SET set_overflow_mode = 'throw'; + +SELECT arrayJoin([5, 25]) IN (SELECT DISTINCT toUInt8(intDiv(number, 10)) FROM numbers(300)); -- { serverError 191 } +SELECT arrayJoin([5, 25]) IN (SELECT DISTINCT toUInt8(intDiv(number, 10)) FROM numbers(190)); +SELECT arrayJoin([5, 25]) IN (SELECT DISTINCT toUInt8(intDiv(number, 10)) FROM numbers(200)); +SELECT arrayJoin([5, 25]) IN (SELECT DISTINCT toUInt8(intDiv(number, 10)) FROM numbers(210)); -- { serverError 191 } + +SET set_overflow_mode = 'break'; + +SELECT '---'; + +SELECT arrayJoin([5, 25]) IN (SELECT DISTINCT toUInt8(intDiv(number, 10)) FROM numbers(300)); +SELECT arrayJoin([5, 25]) IN (SELECT DISTINCT toUInt8(intDiv(number, 10)) FROM numbers(190)); +SELECT arrayJoin([5, 25]) IN (SELECT DISTINCT toUInt8(intDiv(number, 10)) FROM numbers(200)); +SELECT arrayJoin([5, 25]) IN (SELECT DISTINCT toUInt8(intDiv(number, 10)) FROM numbers(210));