From: drh <> Date: Tue, 24 Oct 2023 17:45:11 +0000 (+0000) Subject: Test cases for COLLATE and NULLS FIRST/LAST in the ORDER BY for an X-Git-Tag: version-3.44.0~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=85b1f5c2f6a05ba151496122fc62b10d560498ca;p=thirdparty%2Fsqlite.git Test cases for COLLATE and NULLS FIRST/LAST in the ORDER BY for an aggregate function. FossilOrigin-Name: 641f928feb8b6cfd64cb03992bc18c1653960b6eaeb35145d17df494727c7a11 --- diff --git a/manifest b/manifest index 8c2d2c043e..9af5eb1bf6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C New\s#ifdefs\sto\sfix\scertain\scompile-time\soptions. -D 2023-10-24T16:16:27.059 +C Test\scases\sfor\sCOLLATE\sand\sNULLS\sFIRST/LAST\sin\sthe\sORDER\sBY\sfor\san\naggregate\sfunction. +D 2023-10-24T17:45:11.642 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -817,7 +817,7 @@ F test/affinity3.test f094773025eddf31135c7ad4cde722b7696f8eb07b97511f98585addf2 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 F test/aggfault.test 777f269d0da5b0c2524c7ff6d99ae9a93db4f1b1839a914dd2a12e3035c29829 F test/aggnested.test 2e738bfe2980df301a782f6e7bbf9459266f64f7e72f58f3b5c843bf897c568c -F test/aggorderby.test d110490c62d29318fa56831cd67bc49b07789592f1cdd7881725735ecd05308a +F test/aggorderby.test 4a4b2d49532124fbb799a2c014e5134d0e6db2345b19286d027e227e0f383dfa F test/alias.test 4529fbc152f190268a15f9384a5651bbbabc9d87 F test/all.test 2ecb8bbd52416642e41c9081182a8df05d42c75637afd4488aace78cc4b69e13 F test/alter.test 403a7f8842457044a994d0ffb42963d6e84fcfbf5e8f54556063b25d966cd454 @@ -2138,8 +2138,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 e952db86faaafd2ef8558175ebcae6834d0b0002813cc78c7ae7da713604cbec -R 235d95e16d499ec1c60f3973e144465a +P 688c6279ef1d4ff8d58e83a1c73ca0221ab8570a7cd89459946a86afdad6ec1c +R 3064fd7ebff205f56ff9b901509432de U drh -Z b1a1ae289b7963d5b110e3f6be1d2e73 +Z 43199bfadf9e01e03c769a5bbfeebed2 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 9c840ba0ce..bcf1742392 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -688c6279ef1d4ff8d58e83a1c73ca0221ab8570a7cd89459946a86afdad6ec1c \ No newline at end of file +641f928feb8b6cfd64cb03992bc18c1653960b6eaeb35145d17df494727c7a11 \ No newline at end of file diff --git a/test/aggorderby.test b/test/aggorderby.test index bf77a7d4cf..61adb9ae14 100644 --- a/test/aggorderby.test +++ b/test/aggorderby.test @@ -76,4 +76,30 @@ do_execsql_test aggorderby-5.3 { SELECT (SELECT string_agg(a,'#' ORDER BY d) FROM t3) FROM t1; } {aaa#aaa bbb#bbb} +# COLLATE works on the ORDER BY. +# +do_execsql_test aggorderby-6.0 { + WITH c(x) AS (VALUES('abc'),('DEF'),('xyz'),('ABC'),('XYZ')) + SELECT string_agg(x,',' ORDER BY x COLLATE nocase), + string_agg(x,',' ORDER BY x) FROM c; +} {abc,ABC,DEF,xyz,XYZ ABC,DEF,XYZ,abc,xyz} +do_execsql_test aggorderby-6.1 { + WITH c(x,y) AS (VALUES(1,'a'),(2,'B'),(3,'c'),(4,'D')) + SELECT group_concat(x ORDER BY y COLLATE nocase), + group_concat(x ORDER BY y COLLATE binary) FROM c; +} {1,2,3,4 2,4,1,3} + +# NULLS FIRST and NULLS LAST work on the ORDER BY +# +do_execsql_test aggorderby-7.0 { + WITH c(x) AS (VALUES(1),(NULL),(2.5),(NULL),('three')) + SELECT json_group_array(x ORDER BY x NULLS FIRST), + json_group_array(x ORDER BY x NULLS LAST) FROM c; +} {[null,null,1,2.5,"three"] [1,2.5,"three",null,null]} +do_execsql_test aggorderby-7.1 { + WITH c(x,y) AS (VALUES(1,9),(2,null),(3,5),(4,null),(5,1)) + SELECT json_group_array(x ORDER BY y NULLS FIRST, x), + json_group_array(x ORDER BY y NULLS LAST, x) FROM c; +} {[2,4,5,3,1] [5,3,1,2,4]} + finish_test