mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
fix test
This commit is contained in:
parent
ea98d9ef89
commit
92ea82eac9
@ -822,12 +822,18 @@ def main(args):
|
|||||||
else:
|
else:
|
||||||
args.shard = False
|
args.shard = False
|
||||||
|
|
||||||
if args.database and args.database != "test":
|
def create_common_database(args, db_name):
|
||||||
clickhouse_proc_create = Popen(shlex.split(args.client), stdin=PIPE, stdout=PIPE, stderr=None, universal_newlines=True)
|
create_database_retries = 0
|
||||||
clickhouse_proc_create.communicate(("CREATE DATABASE IF NOT EXISTS " + args.database + get_db_engine(args, args.database)))
|
while create_database_retries < MAX_RETRIES:
|
||||||
|
clickhouse_proc_create = Popen(shlex.split(args.client), stdin=PIPE, stdout=PIPE, stderr=PIPE, universal_newlines=True)
|
||||||
|
(_, stderr) = clickhouse_proc_create.communicate(("CREATE DATABASE IF NOT EXISTS " + db_name + get_db_engine(args, db_name)))
|
||||||
|
if not need_retry(stderr):
|
||||||
|
break
|
||||||
|
create_database_retries += 1
|
||||||
|
|
||||||
clickhouse_proc_create = Popen(shlex.split(args.client), stdin=PIPE, stdout=PIPE, stderr=None, universal_newlines=True)
|
if args.database and args.database != "test":
|
||||||
clickhouse_proc_create.communicate(("CREATE DATABASE IF NOT EXISTS test" + get_db_engine(args, 'test')))
|
create_common_database(args, args.database)
|
||||||
|
create_common_database(args, "test")
|
||||||
|
|
||||||
def is_test_from_dir(suite_dir, case):
|
def is_test_from_dir(suite_dir, case):
|
||||||
case_file = os.path.join(suite_dir, case)
|
case_file = os.path.join(suite_dir, case)
|
||||||
|
@ -1,22 +1,23 @@
|
|||||||
DROP TABLE IF EXISTS test.secure1;
|
DROP TABLE IF EXISTS secure1;
|
||||||
DROP TABLE IF EXISTS test.secure2;
|
DROP TABLE IF EXISTS secure2;
|
||||||
DROP TABLE IF EXISTS test.secure3;
|
DROP TABLE IF EXISTS secure3;
|
||||||
|
|
||||||
CREATE TABLE test.secure1 ( date Date, a Int32, b Int32, c Int32, d Int32) ENGINE = MergeTree(date, (a, date), 8192);
|
CREATE TABLE secure1 ( date Date, a Int32, b Int32, c Int32, d Int32) ENGINE = MergeTree(date, (a, date), 8192);
|
||||||
CREATE TABLE test.secure2 ( date Date, a Int32, b Int32, c Int32, d Int32) ENGINE = Distributed(test_shard_localhost_secure, 'test', 'secure1');
|
CREATE TABLE secure2 ( date Date, a Int32, b Int32, c Int32, d Int32) ENGINE = Distributed(test_shard_localhost_secure, currentDatabase(), 'secure1');
|
||||||
CREATE TABLE test.secure3 ( date Date, a Int32, b Int32, c Int32, d Int32) ENGINE = Distributed(test_shard_localhost_secure, 'test', 'secure2');
|
CREATE TABLE secure3 ( date Date, a Int32, b Int32, c Int32, d Int32) ENGINE = Distributed(test_shard_localhost_secure, currentDatabase(), 'secure2');
|
||||||
|
|
||||||
INSERT INTO test.secure1 VALUES (1, 2, 3, 4, 5);
|
INSERT INTO secure1 VALUES (1, 2, 3, 4, 5);
|
||||||
INSERT INTO test.secure1 VALUES (11,12,13,14,15);
|
INSERT INTO secure1 VALUES (11,12,13,14,15);
|
||||||
INSERT INTO test.secure2 VALUES (21,22,23,24,25);
|
INSERT INTO secure2 VALUES (21,22,23,24,25);
|
||||||
INSERT INTO test.secure3 VALUES (31,32,33,34,35);
|
INSERT INTO secure3 VALUES (31,32,33,34,35);
|
||||||
|
|
||||||
SELECT 'sleep', sleep(1);
|
SYSTEM FLUSH DISTRIBUTED secure2;
|
||||||
|
SYSTEM FLUSH DISTRIBUTED secure3;
|
||||||
|
|
||||||
SELECT * FROM test.secure1 ORDER BY a;
|
SELECT * FROM secure1 ORDER BY a;
|
||||||
SELECT * FROM test.secure2 ORDER BY a;
|
SELECT * FROM secure2 ORDER BY a;
|
||||||
SELECT * FROM test.secure3 ORDER BY a;
|
SELECT * FROM secure3 ORDER BY a;
|
||||||
|
|
||||||
DROP TABLE test.secure1;
|
DROP TABLE secure1;
|
||||||
DROP TABLE test.secure2;
|
DROP TABLE secure2;
|
||||||
DROP TABLE test.secure3;
|
DROP TABLE secure3;
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
2
|
2
|
||||||
3
|
3
|
||||||
4
|
4
|
||||||
sleep 0
|
|
||||||
1970-01-02 2 3 4 5
|
1970-01-02 2 3 4 5
|
||||||
1970-01-12 12 13 14 15
|
1970-01-12 12 13 14 15
|
||||||
1970-01-22 22 23 24 25
|
1970-01-22 22 23 24 25
|
||||||
|
Loading…
Reference in New Issue
Block a user