From 6d7b0730362dc8a53a8554a127cb82ab2fc75c5d Mon Sep 17 00:00:00 2001 From: feng lv Date: Sun, 31 Oct 2021 12:18:22 +0000 Subject: [PATCH] add test --- .../02111_modify_table_comment.reference | 4 +++ .../02111_modify_table_comment.sql | 32 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tests/queries/0_stateless/02111_modify_table_comment.reference create mode 100644 tests/queries/0_stateless/02111_modify_table_comment.sql diff --git a/tests/queries/0_stateless/02111_modify_table_comment.reference b/tests/queries/0_stateless/02111_modify_table_comment.reference new file mode 100644 index 00000000000..bc58e6576e3 --- /dev/null +++ b/tests/queries/0_stateless/02111_modify_table_comment.reference @@ -0,0 +1,4 @@ +CREATE TABLE `02111_modify_table_comment`.t\n(\n `n` Int8\n)\nENGINE = MergeTree\nORDER BY n\nSETTINGS index_granularity = 8192\nCOMMENT \'this is a MergeTree table\' +CREATE TABLE `02111_modify_table_comment`.t\n(\n `n` Int8\n)\nENGINE = MergeTree\nORDER BY n\nSETTINGS index_granularity = 8192\nCOMMENT \'MergeTree Table\' +CREATE TABLE `02111_modify_table_comment`.t_merge\n(\n `n` Int8\n)\nENGINE = Merge(\'02111_modify_table_comment\', \'t\')\nCOMMENT \'this is a Merge table\' +CREATE TABLE `02111_modify_table_comment`.t_merge\n(\n `n` Int8\n)\nENGINE = Merge(\'02111_modify_table_comment\', \'t\')\nCOMMENT \'Merge Table\' diff --git a/tests/queries/0_stateless/02111_modify_table_comment.sql b/tests/queries/0_stateless/02111_modify_table_comment.sql new file mode 100644 index 00000000000..378b04517e8 --- /dev/null +++ b/tests/queries/0_stateless/02111_modify_table_comment.sql @@ -0,0 +1,32 @@ +DROP DATABASE IF EXISTS 02111_modify_table_comment; +CREATE DATABASE 02111_modify_table_comment; + +USE 02111_modify_table_comment; + +CREATE TABLE t +( + `n` Int8 +) +ENGINE = MergeTree +ORDER BY n +COMMENT 'this is a MergeTree table'; + +SHOW CREATE t; + +ALTER TABLE t + MODIFY COMMENT 'MergeTree Table'; + +SHOW CREATE t; + +CREATE TABLE t_merge AS t +ENGINE = Merge('02111_modify_table_comment', 't') +COMMENT 'this is a Merge table'; + +SHOW CREATE t_merge; + +ALTER TABLE t_merge + MODIFY COMMENT 'Merge Table'; + +SHOW CREATE t_merge; + +DROP DATABASE 02111_modify_table_comment;