2023-08-04 11:09:59 +00:00
|
|
|
-- Tags: no-parallel
|
2021-09-12 12:35:27 +00:00
|
|
|
|
2020-07-16 21:41:26 +00:00
|
|
|
DROP DATABASE IF EXISTS test_01191;
|
|
|
|
CREATE DATABASE test_01191 ENGINE=Atomic;
|
|
|
|
|
2020-07-17 13:11:44 +00:00
|
|
|
CREATE TABLE test_01191._ (n UInt64, s String) ENGINE = Memory();
|
2021-11-23 17:51:53 +00:00
|
|
|
CREATE TABLE test_01191.t (n UInt64, s String) ENGINE = Memory();
|
2020-07-16 21:41:26 +00:00
|
|
|
|
|
|
|
CREATE DICTIONARY test_01191.dict (n UInt64, s String)
|
|
|
|
PRIMARY KEY n
|
|
|
|
LAYOUT(DIRECT())
|
2020-12-04 02:15:44 +00:00
|
|
|
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE '_' DB 'test_01191'));
|
2020-07-16 21:41:26 +00:00
|
|
|
|
2020-07-17 13:11:44 +00:00
|
|
|
INSERT INTO test_01191._ VALUES (42, 'test');
|
2020-07-16 21:41:26 +00:00
|
|
|
|
|
|
|
SELECT name, status FROM system.dictionaries WHERE database='test_01191';
|
|
|
|
SELECT name, engine FROM system.tables WHERE database='test_01191' ORDER BY name;
|
|
|
|
|
2024-05-30 12:27:25 +00:00
|
|
|
RENAME DICTIONARY test_01191.table TO test_01191.table1; -- {serverError UNKNOWN_TABLE}
|
2024-06-18 19:08:24 +00:00
|
|
|
EXCHANGE DICTIONARIES test_01191._ AND test_01191.dict; -- {serverError INFINITE_LOOP}
|
2021-11-23 17:51:53 +00:00
|
|
|
EXCHANGE TABLES test_01191.t AND test_01191.dict;
|
|
|
|
SELECT name, status FROM system.dictionaries WHERE database='test_01191';
|
|
|
|
SELECT name, engine FROM system.tables WHERE database='test_01191' ORDER BY name;
|
|
|
|
SELECT dictGet(test_01191.t, 's', toUInt64(42));
|
|
|
|
EXCHANGE TABLES test_01191.dict AND test_01191.t;
|
2024-05-30 12:27:25 +00:00
|
|
|
RENAME DICTIONARY test_01191.t TO test_01191.dict1; -- {serverError INCORRECT_QUERY}
|
|
|
|
DROP DICTIONARY test_01191.t; -- {serverError INCORRECT_QUERY}
|
2021-11-23 17:51:53 +00:00
|
|
|
DROP TABLE test_01191.t;
|
2021-04-22 14:09:30 +00:00
|
|
|
|
|
|
|
CREATE DATABASE dummy_db ENGINE=Atomic;
|
|
|
|
RENAME DICTIONARY test_01191.dict TO dummy_db.dict1;
|
|
|
|
RENAME DICTIONARY dummy_db.dict1 TO test_01191.dict;
|
|
|
|
DROP DATABASE dummy_db;
|
2020-07-16 21:41:26 +00:00
|
|
|
|
|
|
|
RENAME DICTIONARY test_01191.dict TO test_01191.dict1;
|
|
|
|
|
|
|
|
SELECT name, status FROM system.dictionaries WHERE database='test_01191';
|
|
|
|
SELECT name, engine FROM system.tables WHERE database='test_01191' ORDER BY name;
|
|
|
|
SELECT dictGet(test_01191.dict1, 's', toUInt64(42));
|
|
|
|
|
|
|
|
RENAME DICTIONARY test_01191.dict1 TO test_01191.dict2;
|
|
|
|
|
|
|
|
SELECT name, status FROM system.dictionaries WHERE database='test_01191';
|
|
|
|
SELECT name, engine FROM system.tables WHERE database='test_01191' ORDER BY name;
|
|
|
|
SELECT dictGet(test_01191.dict2, 's', toUInt64(42));
|
|
|
|
|
|
|
|
DROP DATABASE test_01191;
|