]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Restrict the RANDOM() function to have zero arguments. Ticket #3627. (CVS 6229)
authordrh <drh@noemail.net>
Mon, 2 Feb 2009 01:50:39 +0000 (01:50 +0000)
committerdrh <drh@noemail.net>
Mon, 2 Feb 2009 01:50:39 +0000 (01:50 +0000)
FossilOrigin-Name: b8b546b6ed799dc1621ef7b06273249af1042fb2

manifest
manifest.uuid
src/func.c
test/where2.test

index 5c0a0e2af09d968485a78c0c40d99fe45c108537..597a6be6c1327b36ce943a392d7f5d08e25658d4 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sSUBSTR()\sso\sthat\sit\sreturns\sNULL\sif\sany\sargument\sis\sNULL.\nTicket\s#3626.\s(CVS\s6228)
-D 2009-02-01T19:42:38
+C Restrict\sthe\sRANDOM()\sfunction\sto\shave\szero\sarguments.\s\sTicket\s#3627.\s(CVS\s6229)
+D 2009-02-02T01:50:40
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 3871d308188cefcb7c5ab20da4c7b6aad023bc52
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -113,7 +113,7 @@ F src/date.c 870770dde3fb56772ab247dfb6a6eda44d16cfbc
 F src/delete.c 6249005bdd8f85db6ec5f31ddb5c07de023693cc
 F src/expr.c 76dc3dc83b56ab8db50a772714fac49def8bbf12
 F src/fault.c dc88c821842157460750d2d61a8a8b4197d047ff
-F src/func.c 910be7d21b6fa78328504fffc7daf7a09c385b8d
+F src/func.c a3aac94811d3d02ba9f4e79b429d011c3e921910
 F src/global.c ab003581ea4ff193cfe17a00e1303bc51db619a5
 F src/hash.c 5824e6ff7ba78cd34c8d6cd724367713583e5b55
 F src/hash.h 28f38ebb1006a5beedcb013bcdfe31befe7437ae
@@ -658,7 +658,7 @@ F test/vtab_alter.test 3a299749fee97ca3d53bd55717f536e4a2284856
 F test/vtab_err.test 0d4d8eb4def1d053ac7c5050df3024fd47a3fbd8
 F test/vtab_shared.test c19b2555b807ef2ee014c882cdda5bc8d84fcf48
 F test/where.test de337a3fe0a459ec7c93db16a519657a90552330
-F test/where2.test e446f55417f434929522d87164cd1473d54f10e2
+F test/where2.test 45eacc126aabb37959a387aa83e59ce1f1f03820
 F test/where3.test 97d3936e6a443b968f1a61cdcc0f673252000e94
 F test/where4.test e9b9e2f2f98f00379e6031db6a6fca29bae782a2
 F test/where5.test fdf66f96d29a064b63eb543e28da4dfdccd81ad2
@@ -693,7 +693,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 2217339badf1e84edbed1309c39b9f8dfd7646ff
-R 0730f756ab24d1612ff83af32750a0c7
+P 779fce82b7a89b972da488ce8bd35e23ca120c04
+R 451a04d06310737a09d46869e6ee15cb
 U drh
-Z 8488f2bfd0bfcec2e393ed58aeee481e
+Z e2350e0a9b291ec6aab2df9bc3d08f44
index 241f8688f6ffed8538e7df92ddc6ba568a26a686..9c6ac67408cc6d0fafc7e5d58d717054cc8529da 100644 (file)
@@ -1 +1 @@
-779fce82b7a89b972da488ce8bd35e23ca120c04
\ No newline at end of file
+b8b546b6ed799dc1621ef7b06273249af1042fb2
\ No newline at end of file
index 6ef377491fab9b2609a44478a1ab38381a85add9..4d4c8590ff62ed2e790ce95aed389c98716f82ad 100644 (file)
@@ -16,7 +16,7 @@
 ** sqliteRegisterBuildinFunctions() found at the bottom of the file.
 ** All other code has file scope.
 **
-** $Id: func.c,v 1.214 2009/02/01 19:42:38 drh Exp $
+** $Id: func.c,v 1.215 2009/02/02 01:50:40 drh Exp $
 */
 #include "sqliteInt.h"
 #include <stdlib.h>
@@ -1377,7 +1377,7 @@ void sqlite3RegisterGlobalFunctions(void){
     FUNCTION(coalesce,           0, 0, 0, 0                ),
     FUNCTION(hex,                1, 0, 0, hexFunc          ),
     FUNCTION(ifnull,             2, 0, 1, ifnullFunc       ),
-    FUNCTION(random,            -1, 0, 0, randomFunc       ),
+    FUNCTION(random,             0, 0, 0, randomFunc       ),
     FUNCTION(randomblob,         1, 0, 0, randomBlob       ),
     FUNCTION(nullif,             2, 0, 1, nullifFunc       ),
     FUNCTION(sqlite_version,     0, 0, 0, versionFunc      ),
index 3ddc6c033e89ea3b79fa4e0510924e7460fbcd27..5682ed498da0fea068ab726284dd3064cf8d3cd2 100644 (file)
@@ -12,7 +12,7 @@
 # focus of this file is testing the use of indices in WHERE clauses
 # based on recent changes to the optimizer.
 #
-# $Id: where2.test,v 1.14 2008/10/07 23:46:39 drh Exp $
+# $Id: where2.test,v 1.15 2009/02/02 01:50:40 drh Exp $
 
 set testdir [file dirname $argv0]
 source $testdir/tester.tcl
@@ -97,17 +97,17 @@ do_test where2-1.3 {
 #
 do_test where2-2.1 {
   queryplan {
-    SELECT * FROM t1 WHERE w=85 ORDER BY random(5);
+    SELECT * FROM t1 WHERE w=85 ORDER BY random();
   }
 } {85 6 7396 7402 nosort t1 i1w}
 do_test where2-2.2 {
   queryplan {
-    SELECT * FROM t1 WHERE x=6 AND y=7396 ORDER BY random(5);
+    SELECT * FROM t1 WHERE x=6 AND y=7396 ORDER BY random();
   }
 } {85 6 7396 7402 sort t1 i1xy}
 do_test where2-2.3 {
   queryplan {
-    SELECT * FROM t1 WHERE rowid=85 AND x=6 AND y=7396 ORDER BY random(5);
+    SELECT * FROM t1 WHERE rowid=85 AND x=6 AND y=7396 ORDER BY random();
   }
 } {85 6 7396 7402 nosort t1 *}