summaryrefslogtreecommitdiffstats
path: root/test/tabfunc01.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/tabfunc01.test')
-rw-r--r--test/tabfunc01.test26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/tabfunc01.test b/test/tabfunc01.test
index 8e90c54..3a62b81 100644
--- a/test/tabfunc01.test
+++ b/test/tabfunc01.test
@@ -322,6 +322,32 @@ ifcapable altertable {
} {1 {table pragma_compile_options may not be altered}}
}
+#-----------------------------------------------------------------------------
+# 2024-04-26 LIMIT and OFFSET passed into virtual tables
+# https://sqlite.org/forum/forumpost/c243b8f856
+#
+do_execsql_test tabfunc01-900 {
+ SELECT * FROM (
+ SELECT * FROM generate_series(1,10)
+ UNION ALL
+ SELECT * FROM generate_series(101,104)
+ ) LIMIT 10 OFFSET 5;
+} {6 7 8 9 10 101 102 103 104}
+do_execsql_test tabfunc01-910 {
+ SELECT * FROM (
+ SELECT * FROM generate_series(1,10)
+ UNION ALL
+ SELECT * FROM generate_series(101,104)
+ ) LIMIT -1 OFFSET 5;
+} {6 7 8 9 10 101 102 103 104}
+do_execsql_test tabfunc01-920 {
+ SELECT * FROM (
+ SELECT * FROM generate_series(1,10)
+ UNION ALL
+ SELECT * FROM generate_series(101,104)
+ ) LIMIT -1 OFFSET 0;
+} {1 2 3 4 5 6 7 8 9 10 101 102 103 104}
+
# Free up memory allocations
intarray_addr