mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
dbms: added tests [#METR-17745].
This commit is contained in:
parent
d192a76be8
commit
bfd52af224
@ -0,0 +1,9 @@
|
||||
1
|
||||
2
|
||||
3
|
||||
b -3
|
||||
c -3
|
||||
c -2
|
||||
d -3
|
||||
d -2
|
||||
d -1
|
13
dbms/tests/queries/0_stateless/00214_primary_key_order.sql
Normal file
13
dbms/tests/queries/0_stateless/00214_primary_key_order.sql
Normal file
@ -0,0 +1,13 @@
|
||||
DROP TABLE IF EXISTS test.primary_key;
|
||||
CREATE TABLE test.primary_key (d Date DEFAULT today(), x Int8) ENGINE = MergeTree(d, -x, 1);
|
||||
|
||||
INSERT INTO test.primary_key (x) VALUES (1), (2), (3);
|
||||
|
||||
SELECT x FROM test.primary_key ORDER BY x;
|
||||
|
||||
SELECT 'a', -x FROM test.primary_key WHERE -x < -3;
|
||||
SELECT 'b', -x FROM test.primary_key WHERE -x < -2;
|
||||
SELECT 'c', -x FROM test.primary_key WHERE -x < -1;
|
||||
SELECT 'd', -x FROM test.primary_key WHERE -x < toInt8(0);
|
||||
|
||||
DROP TABLE test.primary_key;
|
@ -0,0 +1,5 @@
|
||||
1
|
||||
2
|
||||
3
|
||||
2
|
||||
3
|
@ -0,0 +1,14 @@
|
||||
DROP TABLE IF EXISTS test.primary_key;
|
||||
CREATE TABLE test.primary_key (d Date DEFAULT today(), x Int8) ENGINE = ReplicatedMergeTree('/clickhouse/tables/test/primary_key', 'r1', d, -x, 1);
|
||||
|
||||
INSERT INTO test.primary_key (x) VALUES (1), (2), (3);
|
||||
INSERT INTO test.primary_key (x) VALUES (1), (3), (2);
|
||||
INSERT INTO test.primary_key (x) VALUES (2), (1), (3);
|
||||
INSERT INTO test.primary_key (x) VALUES (2), (3), (1);
|
||||
INSERT INTO test.primary_key (x) VALUES (3), (1), (2);
|
||||
INSERT INTO test.primary_key (x) VALUES (3), (2), (1);
|
||||
|
||||
SELECT x FROM test.primary_key ORDER BY x;
|
||||
SELECT x FROM test.primary_key WHERE -x < -1 ORDER BY x;
|
||||
|
||||
DROP TABLE test.primary_key;
|
Loading…
Reference in New Issue
Block a user