From 0faf784d2f39e25396dba32a1667814fdce7f850 Mon Sep 17 00:00:00 2001 From: Dmitry Novik Date: Thu, 28 Dec 2023 16:59:57 +0000 Subject: [PATCH] Add a test for alias in USING clause --- .../02955_analyzer_using_functional_args.reference | 1 + .../02955_analyzer_using_functional_args.sql | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 tests/queries/0_stateless/02955_analyzer_using_functional_args.reference create mode 100644 tests/queries/0_stateless/02955_analyzer_using_functional_args.sql diff --git a/tests/queries/0_stateless/02955_analyzer_using_functional_args.reference b/tests/queries/0_stateless/02955_analyzer_using_functional_args.reference new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/tests/queries/0_stateless/02955_analyzer_using_functional_args.reference @@ -0,0 +1 @@ +1 diff --git a/tests/queries/0_stateless/02955_analyzer_using_functional_args.sql b/tests/queries/0_stateless/02955_analyzer_using_functional_args.sql new file mode 100644 index 00000000000..e4c1fd86b09 --- /dev/null +++ b/tests/queries/0_stateless/02955_analyzer_using_functional_args.sql @@ -0,0 +1,11 @@ +CREATE TABLE t1 (x Int16, y ALIAS x + x * 2) ENGINE=MergeTree() ORDER BY x; +CREATE TABLE t2 (y Int16, z Int16) ENGINE=MergeTree() ORDER BY y; + +INSERT INTO t1 VALUES (1231), (123); +INSERT INTO t2 VALUES (6666, 48); +INSERT INTO t2 VALUES (369, 50); + +SELECT count() FROM t1 INNER JOIN t2 USING (y); + +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2;