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 0bb1e4eadb IGNITE-21980: Extend test coverage for SQL F861(Top-level
<result offset clause> in <query expression>) (#3780)
0bb1e4eadb is described below
commit 0bb1e4eadbdd67fcf4e36ce39250c21b7a959a8d
Author: Max Zhuravkov <[email protected]>
AuthorDate: Wed May 22 16:49:49 2024 +0300
IGNITE-21980: Extend test coverage for SQL F861(Top-level <result offset
clause> in <query expression>) (#3780)
---
.../src/integrationTest/sql/order/test_offset.test | 50 ++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/modules/sql-engine/src/integrationTest/sql/order/test_offset.test
b/modules/sql-engine/src/integrationTest/sql/order/test_offset.test
new file mode 100644
index 0000000000..929ce38608
--- /dev/null
+++ b/modules/sql-engine/src/integrationTest/sql/order/test_offset.test
@@ -0,0 +1,50 @@
+# name: test/sql/order/test_offset.test
+# description: offset clause tests
+# feature: SQL F861 (Top-level <result offset clause> in <query expression>)
+# group: [order]
+
+statement ok
+PRAGMA enable_verification
+
+statement ok
+CREATE TABLE test (b INTEGER)
+
+statement ok
+INSERT INTO test VALUES (22), (2), (7)
+
+query I
+SELECT b FROM test ORDER BY b DESC OFFSET 1
+----
+7
+2
+
+query I
+SELECT b FROM test ORDER BY b OFFSET 2
+----
+22
+
+query I
+SELECT b FROM test ORDER BY b OFFSET 10
+----
+
+query I
+SELECT * FROM (SELECT b FROM test UNION ALL SELECT b FROM (VALUES (4), (5),
(6)) t(b) ORDER BY b) OFFSET 2
+----
+5
+6
+7
+22
+
+# ROW, ROWS
+
+query I
+SELECT b FROM test ORDER BY b DESC OFFSET 1 ROW
+----
+7
+2
+
+query I
+SELECT b FROM test ORDER BY b DESC OFFSET 1 ROWS
+----
+7
+2