dbms: fixed test [#METR-2944].

This commit is contained in:
Alexey Milovidov 2016-02-07 19:55:57 +03:00
parent 6c38979819
commit 35d1bc10e2
2 changed files with 20 additions and 21 deletions

View File

@ -3,8 +3,6 @@
2014-10-02 1
1
2014-10-01 2
1
2014-10-01 2
2
2014-10-01 2
2014-10-02 1
@ -16,11 +14,7 @@
2014-10-02 1
2015-01-01 4
2015-01-02 3
2
2014-10-01 2
2014-10-02 1
2014-10-01 2
2014-10-02 1
4
2014-10-01 2
2014-10-02 1
2014-10-01 2
@ -29,12 +23,17 @@
2015-01-02 3
2014-10-01 2
2014-10-02 1
2015-01-01 4
2015-01-02 3
2014-10-01 2
2014-10-02 1
2015-01-02 3
2014-10-01 2
2014-10-02 1
2015-01-01 4
2015-01-02 3
2014-10-01 2
2014-10-02 1
2015-01-02 3
3
4
4
4
3

View File

@ -7,26 +7,26 @@ CREATE TABLE test.r1 (d Date DEFAULT today(), x UInt64) ENGINE = ReplicatedMerge
INSERT INTO test.r1 VALUES ('2014-10-02', 1);
INSERT INTO test.r1 VALUES ('2014-10-01', 2);
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r1';
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r1'; -- 2
SELECT d, x FROM test.r1 ORDER BY d, x;
ALTER TABLE test.r1 DETACH PARTITION 201410;
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r1';
SELECT d, x FROM test.r1 ORDER BY d, x;
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r1'; -- empty result
SELECT d, x FROM test.r1 ORDER BY d, x; -- empty result
ALTER TABLE test.r1 ATTACH PART '20141001_20141001_201_201_0';
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r1';
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r1'; -- 1
SELECT d, x FROM test.r1 ORDER BY d, x;
ALTER TABLE test.r1 ATTACH PART '20141002_20141002_200_200_0';
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r1';
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r1'; -- 2
SELECT d, x FROM test.r1 ORDER BY d, x;
SET replication_alter_partitions_sync = 1;
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r1' AND active;
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r1' AND active; -- 2
SELECT d, x FROM test.r1 ORDER BY d, x;
CREATE TABLE test.r2 (d Date DEFAULT today(), x UInt64) ENGINE = ReplicatedMergeTree('/clickhouse/tables/01/r/', 'r2', d, x, 111);
@ -35,12 +35,12 @@ CREATE TABLE test.r3 (d Date DEFAULT today(), x UInt64) ENGINE = ReplicatedMerge
INSERT INTO test.r2 VALUES ('2015-01-02', 3);
INSERT INTO test.r2 VALUES ('2015-01-01', 4);
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r2';
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r2'; -- 4
SELECT d, x FROM test.r2 ORDER BY d, x;
ALTER TABLE test.r2 DETACH PARTITION 201501;
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r2';
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r2'; -- 2
SELECT d, x FROM test.r1 ORDER BY d, x;
SELECT d, x FROM test.r2 ORDER BY d, x;
@ -52,9 +52,9 @@ SELECT d, x FROM test.r1 ORDER BY d, x;
SELECT d, x FROM test.r2 ORDER BY d, x;
SELECT d, x FROM test.r3 ORDER BY d, x;
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r1' AND active;
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r2' AND active;
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r3' AND active;
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r1' AND active; -- 4
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r2' AND active; -- 4
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r3' AND active; -- 4
DROP TABLE test.r1;
DROP TABLE test.r2;