]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add a comment to the doubleToInt64() routine that explains why returning
authordrh <drh@noemail.net>
Sun, 29 Mar 2009 15:12:09 +0000 (15:12 +0000)
committerdrh <drh@noemail.net>
Sun, 29 Mar 2009 15:12:09 +0000 (15:12 +0000)
minInt is in fact correct when it seems like maxInt should be returned. (CVS 6405)

FossilOrigin-Name: 7f3be3608542bbc6ac7916e5c3a5436e5f0a552e

manifest
manifest.uuid
src/vdbemem.c

index 6542dd4abae7831ee65da5cc9348b5050c9f0478..3ec35769b5943ff0dac2c420e1afa6d9d6d6acbe 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Turn\soff\sthe\sdebugging\smacros\sin\swhere.c\s-\sleft\son\sby\smistake\sin\sthe\nprevious\scheck-in.\s(CVS\s6404)
-D 2009-03-29T00:15:54
+C Add\sa\scomment\sto\sthe\sdoubleToInt64()\sroutine\sthat\sexplains\swhy\sreturning\nminInt\sis\sin\sfact\scorrect\swhen\sit\sseems\slike\smaxInt\sshould\sbe\sreturned.\s(CVS\s6405)
+D 2009-03-29T15:12:10
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -206,7 +206,7 @@ F src/vdbeInt.h 53a2f4696871712646c77351904576cca6ad9752
 F src/vdbeapi.c 950986b0f765b5b91aab1acb2b405d9450b749d1
 F src/vdbeaux.c 521187e184f642b3978c0ec00a0e165a45518ea6
 F src/vdbeblob.c e67757450ae8581a8b354d9d7e467e41502dfe38
-F src/vdbemem.c 38615b5d4b1b3b5a1221a5623578e5e3864e4888
+F src/vdbemem.c 53ab1c07800340d2ae100cb99537775a25b2efff
 F src/vtab.c f1aba5a6dc1f83b97a39fbbc58ff8cbc76311347
 F src/walker.c 42bd3f00ca2ef5ae842304ec0d59903ef051412d
 F src/where.c 5a421d7265c79dc21c010e3218fd3abd448ec297
@@ -711,7 +711,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 0c438e813c411e8f9e92d6c7405fccb7a36e110a
-R 3dffa6b92b193d1bfe88a15490bd2da5
+P b601a57582051184baa37b807b1e18db93313e13
+R b24c431aeaa41c90ffe92c8a76f50df3
 U drh
-Z b97ea69454df145d98480d67357072fb
+Z a18eb87f581c8e08f864572471035b43
index 64341d9d08408cc939f490d31db7e7ccc961fc88..4208d06b9b7d22da22d2430b35e6a4fa30360546 100644 (file)
@@ -1 +1 @@
-b601a57582051184baa37b807b1e18db93313e13
\ No newline at end of file
+7f3be3608542bbc6ac7916e5c3a5436e5f0a552e
\ No newline at end of file
index 64ffa4ab48f486339ace67acbb4877c503e70501..70feab978227f437d59734c296c2f0883e8e5fd8 100644 (file)
@@ -15,7 +15,7 @@
 ** only within the VDBE.  Interface routines refer to a Mem using the
 ** name sqlite_value
 **
-** $Id: vdbemem.c,v 1.138 2009/03/23 21:37:04 drh Exp $
+** $Id: vdbemem.c,v 1.139 2009/03/29 15:12:10 drh Exp $
 */
 #include "sqliteInt.h"
 #include "vdbeInt.h"
@@ -321,6 +321,10 @@ static i64 doubleToInt64(double r){
   if( r<(double)minInt ){
     return minInt;
   }else if( r>(double)maxInt ){
+    /* minInt is correct here - not maxInt.  It turns out that assigning
+    ** a very large positive number to an integer results in a very large
+    ** negative integer.  This makes no sense, but it is what x86 hardware
+    ** does so for compatibility we will do the same in software. */
     return minInt;
   }else{
     return (i64)r;