Change the expression code generator to account for the fact that the new

sqlite3AtoF() never returns NaN.  Also, clarification of a comment in
where.c.

FossilOrigin-Name: 75f596a04a74eb3a538c7be5b41756c970a21a1b
This commit is contained in:
drh 2009-08-21 13:22:25 +00:00
parent 9359c7b7ab
commit d00151613a
4 changed files with 26 additions and 17 deletions

View File

@ -1,5 +1,8 @@
C Add\sassert()\sstatements\sto\sos_unix.c\sto\scheck\sthat\sthe\smutex\sis\sheld\swhen\sit\sshould\sbe.
D 2009-08-21T08:29:10
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
C Change\sthe\sexpression\scode\sgenerator\sto\saccount\sfor\sthe\sfact\sthat\sthe\snew\nsqlite3AtoF()\snever\sreturns\sNaN.\s\sAlso,\sclarification\sof\sa\scomment\sin\nwhere.c.
D 2009-08-21T13:22:25
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 73ddeec9dd10b85876c5c2ce1fdce627e1dcc7f8
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@ -114,7 +117,7 @@ F src/callback.c 9bc0ae998f15207d3115224979331c0aafc9bcc3
F src/complete.c 5ad5c6cd4548211867c204c41a126d73a9fbcea0
F src/date.c ab5f7137656652a48434d64f96bdcdc823bb23b3
F src/delete.c dcf07632d8ca3d4086df8b65ea907a47278e6382
F src/expr.c 335d3008417050a6992ecf2c78819f2911a7cb18
F src/expr.c adb61b7de6bf9f51080195ed7dab9282a697ba24
F src/fault.c dc88c821842157460750d2d61a8a8b4197d047ff
F src/func.c e536218d193b8d326aab91120bc4c6f28aa2b606
F src/global.c 271952d199a8cc59d4ce840b3bbbfd2f30c8ba32
@ -214,7 +217,7 @@ F src/vdbeblob.c a3f3e0e877fc64ea50165eec2855f5ada4477611
F src/vdbemem.c c4a5188ff43692f2ca78d3539ad4877e14b70712
F src/vtab.c aedd76e8670d5a5379f93804398d3ba960125547
F src/walker.c 1edca756275f158b80f20eb6f104c8d3fcc96a04
F src/where.c ccd88f21b65baa8da9d62a720ad9e59c5b3eabe7
F src/where.c b9ad2d2db4a7d1cda7bed8a7299eb73fde63b5b1
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/alias.test 4529fbc152f190268a15f9384a5651bbbabc9d87
F test/all.test 14165b3e32715b700b5f0cbf8f6e3833dda0be45
@ -747,7 +750,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
P f084f5a8ba850de627ca8e9de6c81ab1ad9b7a1b
R 86b75a5cb6d64dfb1579ca1b08107e59
U dan
Z 23bb429f975133621e0fd91ccb484fc5
P 11a669b6537d6bac67764fd91a319234345ac504
R 94e34ada24b7bc67fb34c394a020d935
U drh
Z 7ccc9d752ad0ca6d6e2c43e814512aef
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFKjp+UoxKgR168RlERAk1eAKCAALyYlvahPmzq/BF+Xyh+nb94XwCfazBH
BpbVoKhuQkjDxksK+/ovr6g=
=rFJ2
-----END PGP SIGNATURE-----

View File

@ -1 +1 @@
11a669b6537d6bac67764fd91a319234345ac504
75f596a04a74eb3a538c7be5b41756c970a21a1b

View File

@ -1708,13 +1708,10 @@ static void codeReal(Vdbe *v, const char *z, int negateFlag, int iMem){
double value;
char *zV;
sqlite3AtoF(z, &value);
if( sqlite3IsNaN(value) ){
sqlite3VdbeAddOp2(v, OP_Null, 0, iMem);
}else{
if( negateFlag ) value = -value;
zV = dup8bytes(v, (char*)&value);
sqlite3VdbeAddOp4(v, OP_Real, 0, iMem, 0, zV, P4_REAL);
}
assert( !sqlite3IsNaN(value) ); /* The new AtoF never returns NaN */
if( negateFlag ) value = -value;
zV = dup8bytes(v, (char*)&value);
sqlite3VdbeAddOp4(v, OP_Real, 0, iMem, 0, zV, P4_REAL);
}
}

View File

@ -3558,7 +3558,9 @@ WhereInfo *sqlite3WhereBegin(
** FROM clause entry that permits the lowest-cost, "optimal" scan. In
** this context an optimal scan is one that uses the same strategy
** for the given FROM clause entry as would be selected if the entry
** were used as the innermost nested loop.
** were used as the innermost nested loop. In other words, a table
** is chosen such that the cost of running that table cannot be reduced
** by waiting for other tables to run first.
**
** The second iteration is only performed if no optimal scan strategies
** were found by the first. This iteration is used to search for the