2018-11-06 13:26:43 +00:00
|
|
|
CREATE DATABASE IF NOT EXISTS test;
|
|
|
|
DROP TABLE IF EXISTS test.check_query_comment_column;
|
2018-10-14 15:30:06 +00:00
|
|
|
|
2018-11-06 13:26:43 +00:00
|
|
|
CREATE TABLE test.check_query_comment_column
|
2018-10-14 15:30:06 +00:00
|
|
|
(
|
|
|
|
first_column UInt8 DEFAULT 1 COMMENT 'first comment',
|
|
|
|
second_column UInt8 MATERIALIZED first_column COMMENT 'second comment',
|
|
|
|
third_column UInt8 ALIAS second_column COMMENT 'third comment',
|
|
|
|
fourth_column UInt8 COMMENT 'fourth comment',
|
|
|
|
fifth_column UInt8
|
|
|
|
) ENGINE = TinyLog;
|
|
|
|
|
2018-11-06 13:26:43 +00:00
|
|
|
SHOW CREATE TABLE test.check_query_comment_column;
|
2018-10-14 15:30:06 +00:00
|
|
|
|
|
|
|
SELECT table, name, comment
|
|
|
|
FROM system.columns
|
2018-11-06 13:26:43 +00:00
|
|
|
WHERE table = 'check_query_comment_column' AND database = 'test'
|
2018-10-14 15:30:06 +00:00
|
|
|
FORMAT PrettyCompactNoEscapes;
|
|
|
|
|
2018-11-06 13:26:43 +00:00
|
|
|
ALTER TABLE test.check_query_comment_column
|
2018-10-14 15:30:06 +00:00
|
|
|
COMMENT COLUMN first_column 'another first column',
|
|
|
|
COMMENT COLUMN second_column 'another second column',
|
|
|
|
COMMENT COLUMN third_column 'another third column',
|
|
|
|
COMMENT COLUMN fourth_column 'another fourth column',
|
|
|
|
COMMENT COLUMN fifth_column 'another fifth column';
|
|
|
|
|
2018-11-06 13:26:43 +00:00
|
|
|
SHOW CREATE TABLE test.check_query_comment_column;
|
2018-10-14 15:30:06 +00:00
|
|
|
|
|
|
|
SELECT table, name, comment
|
|
|
|
FROM system.columns
|
2018-11-06 13:26:43 +00:00
|
|
|
WHERE table = 'check_query_comment_column' AND database = 'test'
|
2018-10-14 15:30:06 +00:00
|
|
|
FORMAT PrettyCompactNoEscapes;
|
|
|
|
|
2018-11-06 13:26:43 +00:00
|
|
|
DROP TABLE IF EXISTS test.check_query_comment_column;
|
2018-10-14 15:30:06 +00:00
|
|
|
|
|
|
|
|
2018-11-06 13:26:43 +00:00
|
|
|
CREATE TABLE test.check_query_comment_column
|
2018-10-14 15:30:06 +00:00
|
|
|
(
|
|
|
|
first_column Date COMMENT 'first comment',
|
|
|
|
second_column UInt8 COMMENT 'second comment',
|
|
|
|
third_column UInt8 COMMENT 'third comment'
|
|
|
|
) ENGINE = MergeTree(first_column, (second_column, second_column), 8192);
|
|
|
|
|
2018-11-06 13:26:43 +00:00
|
|
|
SHOW CREATE TABLE test.check_query_comment_column;
|
2018-10-14 15:30:06 +00:00
|
|
|
|
|
|
|
SELECT table, name, comment
|
|
|
|
FROM system.columns
|
2018-11-06 13:26:43 +00:00
|
|
|
WHERE table = 'check_query_comment_column' AND database = 'test'
|
2018-10-14 15:30:06 +00:00
|
|
|
FORMAT PrettyCompactNoEscapes;
|
|
|
|
|
2018-11-06 13:26:43 +00:00
|
|
|
ALTER TABLE test.check_query_comment_column
|
2018-10-14 15:30:06 +00:00
|
|
|
COMMENT COLUMN first_column 'another first comment',
|
|
|
|
COMMENT COLUMN second_column 'another second comment',
|
|
|
|
COMMENT COLUMN third_column 'another third comment';
|
|
|
|
|
2018-11-06 13:26:43 +00:00
|
|
|
SHOW CREATE TABLE test.check_query_comment_column;
|
2018-10-14 15:30:06 +00:00
|
|
|
|
|
|
|
SELECT table, name, comment
|
|
|
|
FROM system.columns
|
2018-11-06 13:26:43 +00:00
|
|
|
WHERE table = 'check_query_comment_column' and database = 'test'
|
|
|
|
FORMAT PrettyCompactNoEscapes;
|
|
|
|
|
2018-11-13 12:08:07 +00:00
|
|
|
DROP TABLE IF test.check_query_comment_column;
|
|
|
|
|
|
|
|
CREATE TABLE test.check_query_comment_column
|
|
|
|
(
|
|
|
|
first_column UInt8 COMMENT 'first comment'
|
|
|
|
) ENGINE = TinyLog;
|
|
|
|
|
|
|
|
ALTER TABLE test.check_query_comment_column MODIFY COLUMN first_column COMMENT 'another comment';
|
|
|
|
|
|
|
|
SELECT table, name, comment
|
|
|
|
FROM system.columns
|
|
|
|
WHERE table = 'check_query_comment_column' and database = 'test'
|
|
|
|
FORMAT PrettyCompactNoEscapes;
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS test.check_query_comment_column;
|