]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add new test file windowE.test, to test the window functions modules response to...
authordan <Dan Kennedy>
Tue, 18 Oct 2022 15:02:08 +0000 (15:02 +0000)
committerdan <Dan Kennedy>
Tue, 18 Oct 2022 15:02:08 +0000 (15:02 +0000)
FossilOrigin-Name: 740a2eb0928d54fdf735a8e573c6a61a34dbd295b46e5b6ef39e957fd2623293

manifest
manifest.uuid
test/windowE.test [new file with mode: 0644]

index c13ee1adf02464e99a95e45ef07015ffcae2726a..cb6da43b7283d65d80a189693535ba864e72a00d 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Correct\ssort\sorder\sfor\sserial-type\s10\sentries\sin\sthe\sdatabase\sfile.\s\sThis\nis\sa\scontinuation\sof\s[4fb77e96fa89a23a].
-D 2022-10-18T13:27:31.501
+C Add\snew\stest\sfile\swindowE.test,\sto\stest\sthe\swindow\sfunctions\smodules\sresponse\sto\san\sinconsistent\scollation\ssequence.
+D 2022-10-18T15:02:08.725
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -1905,6 +1905,7 @@ F test/windowA.test 6d63dc1260daa17141a55007600581778523a8b420629f1282d2acfc36af
 F test/windowB.test f2fb42b864b0cf431c956407583e9478a74c3642bdf8737fdcb6ff4a40298b07
 F test/windowC.test 6fd75f5bb2f1343d34e470e36e68f0ff638d8a42f6aa7d99471261b31a0d42f2
 F test/windowD.test 65cf5a765fb8072450e8a0de2979ce7f09a38d87724fe1280c6444073e3da49b
+F test/windowE.test 6ba0c8048e4cc02b942e56640f8fcd50fd7ca72c876656c40f6baf42e316684c
 F test/windowerr.tcl f5acd6fbc210d7b5546c0e879d157888455cd4a17a1d3f28f07c1c8a387019e0
 F test/windowerr.test a8b752402109c15aa1c5efe1b93ccb0ce1ef84fa964ae1cd6684dd0b3cc1819b
 F test/windowfault.test 15094c1529424e62f798bc679e3fe9dfab6e8ba2f7dfe8c923b6248c31660a7c
@@ -2035,8 +2036,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 4fb77e96fa89a23a9365320c4190834edd6c09cfaf1ca30b34ce19b747ebbec0
-R 5c6e987358d9e0bba6df4dc33586711a
-U drh
-Z 8c0c9fb2c03809d55de676732eaf3a4b
+P 904b54625d985e742888e06ba792cab316b9ec9d6669d9cf509bac48030373ca
+R 609c010622cb8a1edf242ffa07ea33a0
+U dan
+Z 47ec91d5045ad14459bc2cd80292963b
 # Remove this line to create a well-formed Fossil manifest.
index 250cad019b263d2f57c1341327f660e207d2ac36..d617a968ca8af3f2b67d2fe529d1d58a1a389d49 100644 (file)
@@ -1 +1 @@
-904b54625d985e742888e06ba792cab316b9ec9d6669d9cf509bac48030373ca
\ No newline at end of file
+740a2eb0928d54fdf735a8e573c6a61a34dbd295b46e5b6ef39e957fd2623293
\ No newline at end of file
diff --git a/test/windowE.test b/test/windowE.test
new file mode 100644 (file)
index 0000000..f20bcda
--- /dev/null
@@ -0,0 +1,58 @@
+# 2022 October 18
+#
+# The author disclaims copyright to this source code.  In place of
+# a legal notice, here is a blessing:
+#
+#    May you do good and not evil.
+#    May you find forgiveness for yourself and forgive others.
+#    May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set testprefix windowE
+
+proc custom {a b} { return [string compare $a $b] }
+db collate custom custom
+
+do_execsql_test 1.0 {
+  CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT COLLATE custom);
+  INSERT INTO t1 VALUES(1, 'one');
+  INSERT INTO t1 VALUES(2, 'two');
+  INSERT INTO t1 VALUES(3, 'three');
+  INSERT INTO t1 VALUES(4, 'four');
+  INSERT INTO t1 VALUES(5, 'five');
+  INSERT INTO t1 VALUES(6, 'six');
+  CREATE INDEX t1b ON t1(b);
+}
+
+do_execsql_test 1.1 {
+  SELECT * FROM t1
+} {
+  1 one 2 two 3 three 4 four 5 five 6 six
+}
+
+do_execsql_test 1.2 {
+  SELECT group_concat(a,',') OVER win FROM t1 
+  WINDOW win AS (
+    ORDER BY b RANGE BETWEEN 1 PRECEDING AND 2 PRECEDING
+  )
+} {
+  5 4 1 6 3 2
+}
+
+proc custom {a b} { return [string compare $b $a] }
+
+do_execsql_test 1.3 {
+  SELECT group_concat(a,',') OVER win FROM t1 
+  WINDOW win AS (
+    ORDER BY b RANGE BETWEEN 1 PRECEDING AND 2 PRECEDING
+  )
+} {
+  5 5,4 5,4,1 5,4,1,6 5,4,1,6,3 5,4,1,6,3,2
+}
+
+finish_test
+