From 2b46006774c9e90125633046e542736c16e50268 Mon Sep 17 00:00:00 2001 From: Maksim Kita Date: Sun, 27 Jun 2021 20:44:31 +0300 Subject: [PATCH] DatabaseAtomic EXCHANGE DICTIONARIES fix test --- .../0_stateless/01913_replace_dictionary.sql | 1 + .../01914_exchange_dictionaries.reference | 2 +- .../01914_exchange_dictionaries.sql | 47 ++++++++++--------- .../01915_create_or_replace_dictionary.sql | 1 + 4 files changed, 29 insertions(+), 22 deletions(-) diff --git a/tests/queries/0_stateless/01913_replace_dictionary.sql b/tests/queries/0_stateless/01913_replace_dictionary.sql index 22b0bd002ae..43dd460707a 100644 --- a/tests/queries/0_stateless/01913_replace_dictionary.sql +++ b/tests/queries/0_stateless/01913_replace_dictionary.sql @@ -44,6 +44,7 @@ LIFETIME(0); SELECT * FROM 01913_db.test_dictionary; DROP DICTIONARY 01913_db.test_dictionary; + DROP TABLE 01913_db.test_source_table_1; DROP TABLE 01913_db.test_source_table_2; diff --git a/tests/queries/0_stateless/01914_exchange_dictionaries.reference b/tests/queries/0_stateless/01914_exchange_dictionaries.reference index 9278d0abeed..d176a0d7396 100644 --- a/tests/queries/0_stateless/01914_exchange_dictionaries.reference +++ b/tests/queries/0_stateless/01914_exchange_dictionaries.reference @@ -1,4 +1,4 @@ 1 Table1 2 Table2 -2 Table2 1 Table1 +2 Table2 diff --git a/tests/queries/0_stateless/01914_exchange_dictionaries.sql b/tests/queries/0_stateless/01914_exchange_dictionaries.sql index ba0c70d13be..840fb43b8b2 100644 --- a/tests/queries/0_stateless/01914_exchange_dictionaries.sql +++ b/tests/queries/0_stateless/01914_exchange_dictionaries.sql @@ -1,34 +1,39 @@ -DROP TABLE IF EXISTS table_1; -CREATE TABLE table_1 (id UInt64, value String) ENGINE=TinyLog; +DROP DATABASE IF EXISTS 01915_db; +CREATE DATABASE 01915_db ENGINE=Atomic; -DROP TABLE IF EXISTS table_2; -CREATE TABLE table_2 (id UInt64, value String) ENGINE=TinyLog; +DROP TABLE IF EXISTS 01915_db.table_1; +CREATE TABLE 01915_db.table_1 (id UInt64, value String) ENGINE=TinyLog; -INSERT INTO table_1 VALUES (1, 'Table1'); -INSERT INTO table_2 VALUES (2, 'Table2'); +DROP TABLE IF EXISTS 01915_db.table_2; +CREATE TABLE 01915_db.table_2 (id UInt64, value String) ENGINE=TinyLog; -DROP DICTIONARY IF EXISTS dictionary_1; -CREATE DICTIONARY dictionary_1 (id UInt64, value String) +INSERT INTO 01915_db.table_1 VALUES (1, 'Table1'); +INSERT INTO 01915_db.table_2 VALUES (2, 'Table2'); + +DROP DICTIONARY IF EXISTS 01915_db.dictionary_1; +CREATE DICTIONARY 01915_db.dictionary_1 (id UInt64, value String) PRIMARY KEY id LAYOUT(DIRECT()) -SOURCE(CLICKHOUSE(TABLE 'table_1')); +SOURCE(CLICKHOUSE(DB '01915_db' TABLE 'table_1')); -DROP DICTIONARY IF EXISTS dictionary_2; -CREATE DICTIONARY dictionary_2 (id UInt64, value String) +DROP DICTIONARY IF EXISTS 01915_db.dictionary_2; +CREATE DICTIONARY 01915_db.dictionary_2 (id UInt64, value String) PRIMARY KEY id LAYOUT(DIRECT()) -SOURCE(CLICKHOUSE(TABLE 'table_2')); +SOURCE(CLICKHOUSE(DB '01915_db' TABLE 'table_2')); -SELECT * FROM dictionary_1; -SELECT * FROM dictionary_2; +SELECT * FROM 01915_db.dictionary_1; +SELECT * FROM 01915_db.dictionary_2; -EXCHANGE DICTIONARIES dictionary_1 AND dictionary_2; +EXCHANGE DICTIONARIES 01915_db.dictionary_1 AND 01915_db.dictionary_2; -SELECT * FROM dictionary_1; -SELECT * FROM dictionary_2; +SELECT * FROM 01915_db.dictionary_1; +SELECT * FROM 01915_db.dictionary_2; -DROP DICTIONARY dictionary_1; -DROP DICTIONARY dictionary_2; +DROP DICTIONARY 01915_db.dictionary_1; +DROP DICTIONARY 01915_db.dictionary_2; -DROP TABLE table_1; -DROP TABLE table_2; +DROP TABLE 01915_db.table_1; +DROP TABLE 01915_db.table_2; + +DROP DATABASE 01915_db; diff --git a/tests/queries/0_stateless/01915_create_or_replace_dictionary.sql b/tests/queries/0_stateless/01915_create_or_replace_dictionary.sql index 5d5515f4f8a..c9df6114ec9 100644 --- a/tests/queries/0_stateless/01915_create_or_replace_dictionary.sql +++ b/tests/queries/0_stateless/01915_create_or_replace_dictionary.sql @@ -44,6 +44,7 @@ LIFETIME(0); SELECT * FROM 01915_db.test_dictionary; DROP DICTIONARY 01915_db.test_dictionary; + DROP TABLE 01915_db.test_source_table_1; DROP TABLE 01915_db.test_source_table_2;