mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 05:32:52 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
23 lines
1.4 KiB
SQL
23 lines
1.4 KiB
SQL
DROP TABLE IF EXISTS has_column_in_table;
|
|
CREATE TABLE has_column_in_table (i Int64, s String, nest Nested(x UInt8, y UInt32)) ENGINE = Memory;
|
|
|
|
/* existing column */
|
|
SELECT hasColumnInTable(currentDatabase(), 'has_column_in_table', 'i');
|
|
SELECT hasColumnInTable('localhost', currentDatabase(), 'has_column_in_table', 'i');
|
|
SELECT hasColumnInTable(currentDatabase(), 'has_column_in_table', 's');
|
|
SELECT hasColumnInTable('localhost', currentDatabase(), 'has_column_in_table', 's');
|
|
SELECT hasColumnInTable(currentDatabase(), 'has_column_in_table', 'nest.x');
|
|
SELECT hasColumnInTable('localhost', currentDatabase(), 'has_column_in_table', 'nest.x');
|
|
SELECT hasColumnInTable(currentDatabase(), 'has_column_in_table', 'nest.y');
|
|
SELECT hasColumnInTable('localhost', currentDatabase(), 'has_column_in_table', 'nest.y');
|
|
|
|
/* not existing column */
|
|
SELECT hasColumnInTable(currentDatabase(), 'has_column_in_table', 'nest');
|
|
SELECT hasColumnInTable('localhost', currentDatabase(), 'has_column_in_table', 'nest');
|
|
SELECT hasColumnInTable(currentDatabase(), 'has_column_in_table', 'nest.not_existing');
|
|
SELECT hasColumnInTable('localhost', currentDatabase(), 'has_column_in_table', 'nest.not_existing');
|
|
SELECT hasColumnInTable(currentDatabase(), 'has_column_in_table', 'not_existing');
|
|
SELECT hasColumnInTable('localhost', currentDatabase(), 'has_column_in_table', 'not_existing');
|
|
|
|
DROP TABLE has_column_in_table;
|