mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 09:02:00 +00:00
Merge pull request #11706 from ClickHouse/add_column_check
Add column if not exists tests
This commit is contained in:
commit
ac93f2795c
@ -0,0 +1,4 @@
|
||||
CREATE TABLE default.add_table\n(\n `key` UInt64,\n `value1` String\n)\nENGINE = MergeTree()\nORDER BY key\nSETTINGS index_granularity = 8192
|
||||
CREATE TABLE default.add_table\n(\n `key` UInt64,\n `value1` String\n)\nENGINE = MergeTree()\nORDER BY key\nSETTINGS index_granularity = 8192
|
||||
CREATE TABLE default.add_table\n(\n `key` UInt64,\n `value1` String\n)\nENGINE = MergeTree()\nORDER BY key\nSETTINGS index_granularity = 8192
|
||||
CREATE TABLE default.add_table\n(\n `key` UInt64,\n `value1` String,\n `value2` UInt64\n)\nENGINE = MergeTree()\nORDER BY key\nSETTINGS index_granularity = 8192
|
27
tests/queries/0_stateless/01318_alter_add_column_exists.sql
Normal file
27
tests/queries/0_stateless/01318_alter_add_column_exists.sql
Normal file
@ -0,0 +1,27 @@
|
||||
DROP TABLE IF EXISTS add_table;
|
||||
|
||||
CREATE TABLE add_table
|
||||
(
|
||||
key UInt64,
|
||||
value1 String
|
||||
)
|
||||
ENGINE = MergeTree()
|
||||
ORDER BY key;
|
||||
|
||||
SHOW CREATE TABLE add_table;
|
||||
|
||||
ALTER TABLE add_table ADD COLUMN IF NOT EXISTS value1 UInt64;
|
||||
|
||||
SHOW CREATE TABLE add_table;
|
||||
|
||||
ALTER TABLE add_table ADD COLUMN IF NOT EXISTS key String, ADD COLUMN IF NOT EXISTS value1 UInt64;
|
||||
|
||||
SHOW CREATE TABLE add_table;
|
||||
|
||||
ALTER TABLE add_table ADD COLUMN IF NOT EXISTS value1 UInt64, ADD COLUMN IF NOT EXISTS value2 UInt64;
|
||||
|
||||
SHOW CREATE TABLE add_table;
|
||||
|
||||
ALTER TABLE add_table ADD COLUMN value3 UInt64, ADD COLUMN IF NOT EXISTS value3 UInt32; --{serverError 44}
|
||||
|
||||
DROP TABLE IF EXISTS add_table;
|
Loading…
Reference in New Issue
Block a user