test rename

This commit is contained in:
Vasilyev Nikita 2019-10-02 16:06:57 +03:00
parent de3deb9e85
commit 136b1665a3
2 changed files with 30 additions and 10 deletions

View File

@ -4,6 +4,12 @@ testlazy tlog TinyLog 0 ['/var/lib/clickhouse/data/testlazy/tlog/'] /var/lib/cli
testlazy log 0000-00-00 00:00:00
testlazy slog 0000-00-00 00:00:00
testlazy tlog 0000-00-00 00:00:00
testlazy log2 0000-00-00 00:00:00
testlazy slog 0000-00-00 00:00:00
testlazy tlog 0000-00-00 00:00:00
testlazy log2 0000-00-00 00:00:00
testlazy slog 0000-00-00 00:00:00
testlazy tlog 0000-00-00 00:00:00
1 1
2 2
3 3

View File

@ -11,44 +11,58 @@ ${CLICKHOUSE_CLIENT} -n -q "
CREATE TABLE testlazy.tlog (a UInt64, b UInt64) ENGINE = TinyLog;
"
sleep 2
sleep 1.5
${CLICKHOUSE_CLIENT} -q "
SELECT * FROM system.tables WHERE database = 'testlazy';
"
sleep 2
sleep 1.5
${CLICKHOUSE_CLIENT} -q "
SELECT database, name, metadata_modification_time FROM system.tables WHERE database = 'testlazy';
"
sleep 2
sleep 1.5
${CLICKHOUSE_CLIENT} -n -q "
INSERT INTO testlazy.log VALUES (1, 1);
SELECT * FROM testlazy.log LIMIT 0; -- drop testlazy.log from cache
RENAME TABLE testlazy.log TO testlazy.log2;
SELECT database, name, metadata_modification_time FROM system.tables WHERE database = 'testlazy';
"
sleep 1.5
${CLICKHOUSE_CLIENT} -q "
SELECT database, name, metadata_modification_time FROM system.tables WHERE database = 'testlazy';
"
sleep 1.5
${CLICKHOUSE_CLIENT} -n -q "
INSERT INTO testlazy.log2 VALUES (1, 1);
INSERT INTO testlazy.slog VALUES (2, 2);
INSERT INTO testlazy.tlog VALUES (3, 3);
SELECT * FROM testlazy.log;
SELECT * FROM testlazy.log2;
SELECT * FROM testlazy.slog;
SELECT * FROM testlazy.tlog;
"
sleep 2
sleep 1.5
${CLICKHOUSE_CLIENT} -n -q "
SELECT * FROM testlazy.tlog LIMIT 0; -- drop testlazy.log from cache
DROP TABLE testlazy.log;
SELECT * FROM testlazy.log2 LIMIT 0; -- drop testlazy.log2 from cache
DROP TABLE testlazy.log2;
"
sleep 2
sleep 1.5
${CLICKHOUSE_CLIENT} -n -q "
SELECT * FROM testlazy.slog;
SELECT * FROM testlazy.tlog;
"
sleep 2
sleep 1.5
${CLICKHOUSE_CLIENT} -q "
DROP DATABASE testlazy;