mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
analyzer - add test
This commit is contained in:
parent
7966c114bd
commit
036fb0b9ef
@ -0,0 +1,63 @@
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
15
|
||||
15
|
||||
16
|
||||
16
|
||||
17
|
||||
30
|
||||
30
|
||||
31
|
||||
31
|
||||
32
|
||||
102
|
||||
103
|
||||
104
|
||||
105
|
||||
105
|
||||
106
|
||||
107
|
||||
108
|
||||
109
|
||||
105
|
||||
106
|
||||
107
|
||||
108
|
||||
109
|
||||
60
|
||||
60
|
||||
61
|
||||
61
|
||||
62
|
||||
62
|
||||
63
|
||||
63
|
||||
64
|
||||
64
|
||||
60
|
||||
35
|
||||
35
|
||||
36
|
||||
36
|
||||
37
|
||||
37
|
||||
38
|
||||
38
|
||||
39
|
||||
39
|
||||
105
|
||||
106
|
||||
107
|
||||
108
|
||||
109
|
||||
12
|
||||
13
|
||||
13
|
||||
14
|
||||
14
|
||||
15
|
||||
15
|
||||
16
|
34
tests/queries/0_stateless/02676_analyzer_limit_offset.sql
Normal file
34
tests/queries/0_stateless/02676_analyzer_limit_offset.sql
Normal file
@ -0,0 +1,34 @@
|
||||
set allow_experimental_analyzer=1;
|
||||
|
||||
DROP TABLE IF EXISTS test;
|
||||
CREATE TABLE test (i UInt64) Engine = MergeTree() order by i;
|
||||
INSERT INTO test SELECT number FROM numbers(100);
|
||||
INSERT INTO test SELECT number FROM numbers(10,100);
|
||||
OPTIMIZE TABLE test FINAL;
|
||||
|
||||
-- Only set limit
|
||||
SET limit = 5;
|
||||
SELECT * FROM test; -- 5 rows
|
||||
SELECT * FROM test OFFSET 20; -- 5 rows
|
||||
SELECT * FROM (SELECT i FROM test LIMIT 10 OFFSET 50) TMP; -- 5 rows
|
||||
SELECT * FROM test LIMIT 4 OFFSET 192; -- 4 rows
|
||||
SELECT * FROM test LIMIT 10 OFFSET 195; -- 5 rows
|
||||
|
||||
-- Only set offset
|
||||
SET limit = 0;
|
||||
SET offset = 195;
|
||||
SELECT * FROM test; -- 5 rows
|
||||
SELECT * FROM test OFFSET 20; -- no result
|
||||
SELECT * FROM test LIMIT 100; -- no result
|
||||
SET offset = 10;
|
||||
SELECT * FROM test LIMIT 20 OFFSET 100; -- 10 rows
|
||||
SELECT * FROM test LIMIT 11 OFFSET 100; -- 1 rows
|
||||
|
||||
-- offset and limit together
|
||||
SET limit = 10;
|
||||
SELECT * FROM test LIMIT 50 OFFSET 50; -- 10 rows
|
||||
SELECT * FROM test LIMIT 50 OFFSET 190; -- 0 rows
|
||||
SELECT * FROM test LIMIT 50 OFFSET 185; -- 5 rows
|
||||
SELECT * FROM test LIMIT 18 OFFSET 5; -- 8 rows
|
||||
|
||||
DROP TABLE test;
|
Loading…
Reference in New Issue
Block a user