From 549a55e4a268694141ff4299550b76d82f6780b0 Mon Sep 17 00:00:00 2001 From: Maksim Kita Date: Tue, 31 May 2022 22:54:46 +0200 Subject: [PATCH] Added functional tests --- tests/config/test_function.xml | 18 ++++++++++++++++++ ...e_user_defined_function_parameter.reference | 2 ++ ...cutable_user_defined_function_parameter.sql | 6 ++++++ 3 files changed, 26 insertions(+) create mode 100644 tests/queries/0_stateless/02315_executable_user_defined_function_parameter.reference create mode 100644 tests/queries/0_stateless/02315_executable_user_defined_function_parameter.sql diff --git a/tests/config/test_function.xml b/tests/config/test_function.xml index 928cbd75c78..d412879f4b6 100644 --- a/tests/config/test_function.xml +++ b/tests/config/test_function.xml @@ -13,4 +13,22 @@ cd /; clickhouse-local --input-format TabSeparated --output-format TabSeparated --structure 'x UInt64, y UInt64' --query "SELECT x + y FROM table" 0 + + executable + test_function_with_parameter + UInt64 + + UInt64 + + + UInt64 + + + test_parameter + UInt64 + + TabSeparated + cd /; clickhouse-local --input-format TabSeparated --output-format TabSeparated --structure 'x UInt64, y UInt64' --query "SELECT x + y + {test_parameter} FROM table" + 0 + diff --git a/tests/queries/0_stateless/02315_executable_user_defined_function_parameter.reference b/tests/queries/0_stateless/02315_executable_user_defined_function_parameter.reference new file mode 100644 index 00000000000..fd3c81a4d76 --- /dev/null +++ b/tests/queries/0_stateless/02315_executable_user_defined_function_parameter.reference @@ -0,0 +1,2 @@ +5 +5 diff --git a/tests/queries/0_stateless/02315_executable_user_defined_function_parameter.sql b/tests/queries/0_stateless/02315_executable_user_defined_function_parameter.sql new file mode 100644 index 00000000000..f6e5678e612 --- /dev/null +++ b/tests/queries/0_stateless/02315_executable_user_defined_function_parameter.sql @@ -0,0 +1,6 @@ +SELECT test_function_with_parameter('test')(1, 2); --{serverError 53} +SELECT test_function_with_parameter(2, 2)(1, 2); --{serverError 36} +SELECT test_function_with_parameter(1, 2); --{serverError 36} + +SELECT test_function_with_parameter(2)(1, 2); +SELECT test_function_with_parameter('2')(1, 2);