From: drh Date: Sun, 28 Aug 2005 01:34:21 +0000 (+0000) Subject: Add an assert to verify that floating point values and integers use the X-Git-Tag: version-3.6.10~3524 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=de941c605e44bb7977ee138c599da6c9f8bdc6c2;p=thirdparty%2Fsqlite.git Add an assert to verify that floating point values and integers use the same byte order. Add a comment to the SELECT code generator. (CVS 2635) FossilOrigin-Name: 07b4892149a436dbd904c781b46e3b9a82a7a744 --- diff --git a/manifest b/manifest index 7e76c7f4b7..8c2f834836 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Version\s3.2.5\s(CVS\s2634) -D 2005-08-27T17:23:00 +C Add\san\sassert\sto\sverify\sthat\sfloating\spoint\svalues\sand\sintegers\suse\sthe\nsame\sbyte\sorder.\s\sAdd\sa\scomment\sto\sthe\sSELECT\scode\sgenerator.\s(CVS\s2635) +D 2005-08-28T01:34:22 F Makefile.in 12784cdce5ffc8dfb707300c34e4f1eb3b8a14f1 F Makefile.linux-gcc 06be33b2a9ad4f005a5f42b22c4a19dab3cbb5c7 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -63,7 +63,7 @@ F src/pragma.c 69413fbdc0c6aaa493a776ea52c1b3e6cf35dfb2 F src/prepare.c 86f0d8e744b8d956eff6bc40e29049efee017610 F src/printf.c cea584c5888688c650d856563aadc4296b5afac7 F src/random.c 90adff4e73a3b249eb4f1fc2a6ff9cf78c7233a4 -F src/select.c f441648eb191dcf1e67ae61475ea3b40a0eeb787 +F src/select.c f8a9993bcd953eb325c8c3f32985cc52b2947354 F src/shell.c 7fb744da457b0d11e0af7f6a2f6b000fc09fe588 F src/sqlite.h.in a3b75a6b2e66865fba4ec1b698d00c7d95fe27a2 F src/sqliteInt.h e5fb91af1d607f3bc84bfb7da8534fd3298a38b0 @@ -84,7 +84,7 @@ F src/vdbe.c 69f33e22c7d0a64b23fbb69e6da95a1bb6869032 F src/vdbe.h 3b29a9af6c7a64ed692bef1fc5f61338f40d2f67 F src/vdbeInt.h 89a7fa5dc35477bd30ea27b0bf38e9e5c2903812 F src/vdbeapi.c f1adebb5e3fe4724ed0e1a82c4a61809d7e15e9e -F src/vdbeaux.c ae051fd18bd2fc642910fbc95d6763d730936511 +F src/vdbeaux.c bbed7e89b6efaa6fdd81d1bbb72a1c4834d8c198 F src/vdbefifo.c 9efb94c8c3f4c979ebd0028219483f88e57584f5 F src/vdbemem.c 4732fd4d1a75dc38549493d7f9a81d02bf7c59b5 F src/where.c 485041aa51fb33f43b346e018f7c01422847f364 @@ -299,7 +299,7 @@ F www/tclsqlite.tcl 3df553505b6efcad08f91e9b975deb2e6c9bb955 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 70db46d3efa4c7da4b99f7385afff03f778ab9c4 -R b90d675c88300e4d011d239aacff2fb2 +P b2415a749ca5352e5bb4ad08df0c947ec8b02d18 +R 5339976d2615e276ce68459b7c71258d U drh -Z c5358f59f56a3f45e765dee66b85df85 +Z 9a98b7343aacdaafe59eae7e941aec3f diff --git a/manifest.uuid b/manifest.uuid index f174b359ed..2517d3ad15 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b2415a749ca5352e5bb4ad08df0c947ec8b02d18 \ No newline at end of file +07b4892149a436dbd904c781b46e3b9a82a7a744 \ No newline at end of file diff --git a/src/select.c b/src/select.c index ba633d6e95..33c5f24491 100644 --- a/src/select.c +++ b/src/select.c @@ -12,7 +12,7 @@ ** This file contains C code routines that are called by the parser ** to handle SELECT statements in SQLite. ** -** $Id: select.c,v 1.254 2005/08/14 20:47:16 drh Exp $ +** $Id: select.c,v 1.255 2005/08/28 01:34:22 drh Exp $ */ #include "sqliteInt.h" @@ -484,6 +484,10 @@ static int selectInnerLoop( sqlite3VdbeAddOp(v, OP_Pop, 1, 0); addr2 = sqlite3VdbeAddOp(v, OP_Goto, 0, 0); if( pOrderBy ){ + /* At first glance you would think we could optimize out the + ** ORDER BY in this case since the order of entries in the set + ** does not matter. But there might be a LIMIT clause, in which + ** case the order does matter */ pushOntoSorter(pParse, v, pOrderBy); }else{ char aff = (iParm>>16)&0xFF; diff --git a/src/vdbeaux.c b/src/vdbeaux.c index d9541a3fee..41a2a0c519 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -1716,6 +1716,12 @@ int sqlite3VdbeSerialGet( case 7: { /* IEEE floating point */ u64 x = (buf[0]<<24) | (buf[1]<<16) | (buf[2]<<8) | buf[3]; u32 y = (buf[4]<<24) | (buf[5]<<16) | (buf[6]<<8) | buf[7]; +#ifndef NDEBUG + /* Verify that integers and floating point values use the same + ** byte order. The byte order differs on some (broken) architectures. */ + static const u64 t1 = ((u64)0x3ff00000)<<32; + assert( 1.0==*(double*)&t1 ); +#endif x = (x<<32) | y; if( serial_type==6 ){ pMem->i = *(i64*)&x;