ClickHouse/tests/queries/0_stateless/02155_dictionary_comment.sql

54 lines
2.2 KiB
MySQL
Raw Normal View History

2021-12-28 16:41:57 +00:00
DROP TABLE IF EXISTS 02155_test_table;
CREATE TABLE 02155_test_table
(
id UInt64,
value String
) ENGINE=TinyLog;
INSERT INTO 02155_test_table VALUES (0, 'Value');
DROP DICTIONARY IF EXISTS 02155_test_dictionary;
CREATE DICTIONARY 02155_test_dictionary
(
id UInt64,
value String
)
PRIMARY KEY id
SOURCE(CLICKHOUSE(TABLE '02155_test_table'))
LAYOUT(DIRECT());
2021-12-28 20:49:41 +00:00
SELECT name, comment FROM system.dictionaries WHERE name == '02155_test_dictionary' AND database == currentDatabase();
2021-12-28 16:41:57 +00:00
ALTER TABLE 02155_test_dictionary COMMENT COLUMN value 'value_column'; --{serverError 48}
ALTER TABLE 02155_test_dictionary MODIFY COMMENT '02155_test_dictionary_comment_0';
2021-12-28 20:49:41 +00:00
SELECT name, comment FROM system.dictionaries WHERE name == '02155_test_dictionary' AND database == currentDatabase();
SELECT name, comment FROM system.tables WHERE name == '02155_test_dictionary' AND database == currentDatabase();
2021-12-28 16:41:57 +00:00
SELECT * FROM 02155_test_dictionary;
2021-12-28 20:49:41 +00:00
SELECT name, comment FROM system.dictionaries WHERE name == '02155_test_dictionary' AND database == currentDatabase();
SELECT name, comment FROM system.tables WHERE name == '02155_test_dictionary' AND database == currentDatabase();
2021-12-28 16:41:57 +00:00
ALTER TABLE 02155_test_dictionary MODIFY COMMENT '02155_test_dictionary_comment_1';
2021-12-28 20:49:41 +00:00
SELECT name, comment FROM system.dictionaries WHERE name == '02155_test_dictionary' AND database == currentDatabase();
SELECT name, comment FROM system.tables WHERE name == '02155_test_dictionary' AND database == currentDatabase();
2021-12-28 16:41:57 +00:00
2021-12-28 20:49:41 +00:00
DROP TABLE IF EXISTS 02155_test_dictionary_view;
2021-12-28 16:41:57 +00:00
CREATE TABLE 02155_test_dictionary_view
(
id UInt64,
value String
2021-12-28 20:49:41 +00:00
) ENGINE=Dictionary(concat(currentDatabase(), '.02155_test_dictionary'));
2021-12-28 16:41:57 +00:00
SELECT * FROM 02155_test_dictionary_view;
ALTER TABLE 02155_test_dictionary_view COMMENT COLUMN value 'value_column'; --{serverError 48}
2021-12-28 20:49:41 +00:00
2021-12-28 16:41:57 +00:00
ALTER TABLE 02155_test_dictionary_view MODIFY COMMENT '02155_test_dictionary_view_comment_0';
2021-12-28 20:49:41 +00:00
SELECT name, comment FROM system.tables WHERE name == '02155_test_dictionary_view' AND database == currentDatabase();
SELECT name, comment FROM system.tables WHERE name == '02155_test_dictionary_view' AND database == currentDatabase();
2021-12-28 16:41:57 +00:00
DROP TABLE 02155_test_dictionary_view;
2021-12-28 20:49:41 +00:00
DROP TABLE 02155_test_table;
2021-12-28 16:41:57 +00:00
DROP DICTIONARY 02155_test_dictionary;