From 766caff3dcaf527f93189b13fb7b9edfae127dec Mon Sep 17 00:00:00 2001 From: Pavel Kartavyy Date: Tue, 15 Nov 2016 17:24:09 +0300 Subject: [PATCH] add tests for hasColumnInTable [#METR-23248] --- .../0_stateless/00386_has_column_in_table.reference | 7 +++++++ .../queries/0_stateless/00386_has_column_in_table.sql | 11 +++++++++++ 2 files changed, 18 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00386_has_column_in_table.reference create mode 100644 dbms/tests/queries/0_stateless/00386_has_column_in_table.sql diff --git a/dbms/tests/queries/0_stateless/00386_has_column_in_table.reference b/dbms/tests/queries/0_stateless/00386_has_column_in_table.reference new file mode 100644 index 00000000000..bbbc503bece --- /dev/null +++ b/dbms/tests/queries/0_stateless/00386_has_column_in_table.reference @@ -0,0 +1,7 @@ +1 +1 +1 +1 +0 +0 +0 diff --git a/dbms/tests/queries/0_stateless/00386_has_column_in_table.sql b/dbms/tests/queries/0_stateless/00386_has_column_in_table.sql new file mode 100644 index 00000000000..4302d1c72ce --- /dev/null +++ b/dbms/tests/queries/0_stateless/00386_has_column_in_table.sql @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS has_column_in_table_test; +CREATE TABLE has_column_in_table_test (i Int64, s String, nest Nested(x UInt8, y UInt32)) ENGINE = Memory; + +SELECT hasColumnInTable('default', 'has_column_in_table_test', 'i'); +SELECT hasColumnInTable('default', 'has_column_in_table_test', 's'); +SELECT hasColumnInTable('default', 'has_column_in_table_test', 'nest.x'); +SELECT hasColumnInTable('default', 'has_column_in_table_test', 'nest.y'); + +SELECT hasColumnInTable('default', 'has_column_in_table_test', 'nest'); +SELECT hasColumnInTable('default', 'has_column_in_table_test', 'nest.not_existing'); +SELECT hasColumnInTable('default', 'has_column_in_table_test', 'not_existing');