Try fix test.

This commit is contained in:
Nikolai Kochetov 2019-11-08 20:44:55 +03:00
parent f909575196
commit 032e8c8aff

View File

@ -6,39 +6,39 @@ SELECT 'remote(system.one)';
SELECT * FROM remote('127.0.0.1', system.one); SELECT * FROM remote('127.0.0.1', system.one);
SELECT * FROM remote('127.0.0.{1,2}', system.one); SELECT * FROM remote('127.0.0.{1,2}', system.one);
SELECT _shard_num, * FROM remote('127.0.0.1', system.one); SELECT _shard_num, * FROM remote('127.0.0.1', system.one);
SELECT _shard_num, * FROM remote('127.0.0.{1,2}', system.one); SELECT _shard_num, * FROM remote('127.0.0.{1,2}', system.one) order by _shard_num;
SELECT _shard_num, * FROM remote('127.0.0.{1,2}', system.one) WHERE _shard_num = 1; SELECT _shard_num, * FROM remote('127.0.0.{1,2}', system.one) WHERE _shard_num = 1;
-- dist_1 using test_shard_localhost -- dist_1 using test_shard_localhost
SELECT 'dist_1'; SELECT 'dist_1';
CREATE TABLE mem1 (key Int) Engine=Memory(); CREATE TABLE mem1 (key Int) Engine=Memory();
CREATE TABLE dist_1 AS mem1 Engine=Distributed(test_shard_localhost, currentDatabase(), mem1); CREATE TABLE dist_1 AS mem1 Engine=Distributed(test_shard_localhost, currentDatabase(), mem1);
SELECT _shard_num FROM dist_1; SELECT _shard_num FROM dist_1 order by _shard_num;
INSERT INTO mem1 VALUES (10); INSERT INTO mem1 VALUES (10);
SELECT _shard_num FROM dist_1; SELECT _shard_num FROM dist_1 order by _shard_num;
SELECT _shard_num, key FROM dist_1; SELECT _shard_num, key FROM dist_1 order by _shard_num;
SELECT key FROM dist_1; SELECT key FROM dist_1;
INSERT INTO dist_1 VALUES (20); INSERT INTO dist_1 VALUES (20);
SELECT _shard_num FROM dist_1; SELECT _shard_num FROM dist_1 order by _shard_num;
SELECT _shard_num, key FROM dist_1; SELECT _shard_num, key FROM dist_1 order by _shard_num, key;
SELECT key FROM dist_1; SELECT key FROM dist_1;
-- dist_2 using test_cluster_two_shards_localhost -- dist_2 using test_cluster_two_shards_localhost
SELECT 'dist_2'; SELECT 'dist_2';
CREATE TABLE mem2 (key Int) Engine=Memory(); CREATE TABLE mem2 (key Int) Engine=Memory();
CREATE TABLE dist_2 AS mem2 Engine=Distributed(test_cluster_two_shards_localhost, currentDatabase(), mem2); CREATE TABLE dist_2 AS mem2 Engine=Distributed(test_cluster_two_shards_localhost, currentDatabase(), mem2);
SELECT _shard_num FROM dist_2; SELECT _shard_num FROM dist_2 order by _shard_num;
INSERT INTO mem2 VALUES (100); INSERT INTO mem2 VALUES (100);
SELECT _shard_num FROM dist_2; SELECT _shard_num FROM dist_2 order by _shard_num;
SELECT _shard_num, key FROM dist_2; SELECT _shard_num, key FROM dist_2 order by _shard_num, key;
SELECT key FROM dist_2; SELECT key FROM dist_2;
-- multiple _shard_num -- multiple _shard_num
SELECT 'remote(Distributed)'; SELECT 'remote(Distributed)';
SELECT _shard_num, key FROM remote('127.0.0.1', currentDatabase(), dist_2); SELECT _shard_num, key FROM remote('127.0.0.1', currentDatabase(), dist_2) order by _shard_num, key;
-- JOIN system.clusters -- JOIN system.clusters
SELECT 'JOIN system.clusters'; SELECT 'JOIN system.clusters';
@ -68,4 +68,4 @@ CREATE TABLE mem3 (key Int, _shard_num String) Engine=Memory();
CREATE TABLE dist_3 AS mem3 Engine=Distributed(test_shard_localhost, currentDatabase(), mem3); CREATE TABLE dist_3 AS mem3 Engine=Distributed(test_shard_localhost, currentDatabase(), mem3);
INSERT INTO mem3 VALUES (100, 'foo'); INSERT INTO mem3 VALUES (100, 'foo');
SELECT * FROM dist_3; SELECT * FROM dist_3;
SELECT _shard_num, * FROM dist_3; SELECT _shard_num, * FROM dist_3 order by _shard_num;