This is an automated email from the ASF dual-hosted git repository.

jooger pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new 18488a88cf IGNITE-21981: Extend test coverage for SQL F862(<result 
offset clause> in subqueries) (#3816)
18488a88cf is described below

commit 18488a88cf360732467802126670a544271dccc5
Author: Max Zhuravkov <[email protected]>
AuthorDate: Mon May 27 15:51:34 2024 +0300

    IGNITE-21981: Extend test coverage for SQL F862(<result offset clause> in 
subqueries) (#3816)
---
 .../sql/order/test_offset_in_subqueries.test       | 61 ++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git 
a/modules/sql-engine/src/integrationTest/sql/order/test_offset_in_subqueries.test
 
b/modules/sql-engine/src/integrationTest/sql/order/test_offset_in_subqueries.test
new file mode 100644
index 0000000000..562bea2426
--- /dev/null
+++ 
b/modules/sql-engine/src/integrationTest/sql/order/test_offset_in_subqueries.test
@@ -0,0 +1,61 @@
+# name: test/sql/order/test_offset_in_subqueries.test
+# description: offset clause tests
+# feature: SQL F862 (<result offset clause> in subqueries)
+# group: [order]
+
+statement ok
+PRAGMA enable_verification
+
+statement ok
+CREATE TABLE test (b INTEGER)
+
+statement ok
+INSERT INTO test VALUES (22), (2), (7)
+
+# Subquery
+
+query I
+SELECT (SELECT b FROM test ORDER BY b OFFSET 10)
+----
+NULL
+
+query I
+SELECT (SELECT count(*) FROM test OFFSET 0)
+----
+3
+
+query I
+SELECT (SELECT b FROM test ORDER BY b OFFSET 2)
+----
+22
+
+query II
+SELECT (SELECT b FROM test ORDER BY b OFFSET 2), (SELECT count(*) FROM test 
OFFSET 1)
+----
+22     NULL
+
+statement error: Subquery returned more than 1 value
+SELECT (SELECT b FROM test ORDER BY b OFFSET 1)
+
+query II
+SELECT b, (SELECT b FROM test ORDER BY b OFFSET 2) FROM test ORDER BY b ASC
+----
+2      22
+7      22
+22     22
+
+# ROW, ROWS
+
+query II
+SELECT b, (SELECT b FROM test ORDER BY b OFFSET 2 ROW) FROM test ORDER BY b ASC
+----
+2      22
+7      22
+22     22
+
+query II
+SELECT b, (SELECT b FROM test ORDER BY b OFFSET 2 ROWS) FROM test ORDER BY b 
ASC
+----
+2      22
+7      22
+22     22

Reply via email to