Restrict the RANDOM() function to have zero arguments. Ticket #3627. (CVS 6229)

FossilOrigin-Name: b8b546b6ed799dc1621ef7b06273249af1042fb2
This commit is contained in:
drh 2009-02-02 01:50:39 +00:00
parent 8198d25442
commit 9373b01882
4 changed files with 14 additions and 14 deletions

View File

@ -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

View File

@ -1 +1 @@
779fce82b7a89b972da488ce8bd35e23ca120c04
b8b546b6ed799dc1621ef7b06273249af1042fb2

View 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 ),

View 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 *}