More tests

This commit is contained in:
alesapin 2019-10-14 12:52:43 +03:00
parent 67ea66604f
commit ecde224692
4 changed files with 44 additions and 1 deletions

View File

@ -159,6 +159,7 @@ void DatabaseWithOwnTablesBase::shutdown()
std::lock_guard lock(mutex);
tables.clear();
dictionaries.clear();
}
DatabaseWithOwnTablesBase::~DatabaseWithOwnTablesBase()

View File

@ -108,7 +108,6 @@ BlockIO InterpreterDropQuery::executeToTable(
database_and_table.first->getMetadataPath()
+ escapeForFileName(database_and_table.second->getTableName());
/// NOTE seems like duplication of the code inside removeTable method of database
const auto prev_metadata_name = metadata_file_without_extension + ".sql";
const auto drop_metadata_name = metadata_file_without_extension + ".sql.tmp_drop";

View File

@ -25,3 +25,6 @@ memory_db dict2
0
=DICTIONARY in Dictionary DB
=DICTIONARY in Lazy DB
=DROP DATABASE WITH DICTIONARY
dict4
dict4

View File

@ -151,3 +151,43 @@ LAYOUT(FLAT()); -- {serverError 1}
DROP DATABASE IF EXISTS lazy_db;
SELECT '=DROP DATABASE WITH DICTIONARY';
DROP DATABASE IF EXISTS ordinary_db;
CREATE DATABASE ordinary_db ENGINE = Ordinary;
CREATE DICTIONARY ordinary_db.dict4
(
key_column UInt64 DEFAULT 0,
second_column UInt8 DEFAULT 1,
third_column String DEFAULT 'qqq'
)
PRIMARY KEY key_column
SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 USER 'default' TABLE 'table_for_dict' PASSWORD ''))
LIFETIME(MIN 1 MAX 10)
LAYOUT(FLAT());
SHOW DICTIONARIES FROM ordinary_db;
DROP DATABASE IF EXISTS ordinary_db;
CREATE DATABASE ordinary_db ENGINE = Ordinary;
SHOW DICTIONARIES FROM ordinary_db;
CREATE DICTIONARY ordinary_db.dict4
(
key_column UInt64 DEFAULT 0,
second_column UInt8 DEFAULT 1,
third_column String DEFAULT 'qqq'
)
PRIMARY KEY key_column
SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 USER 'default' TABLE 'table_for_dict' PASSWORD ''))
LIFETIME(MIN 1 MAX 10)
LAYOUT(FLAT());
SHOW DICTIONARIES FROM ordinary_db;
DROP DATABASE IF EXISTS ordinary_db;