From: drh Date: Thu, 11 May 2006 13:25:39 +0000 (+0000) Subject: Fix comments on the implementation of the SUM() function. (CVS 3183) X-Git-Tag: version-3.6.10~2984 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c806d8570e58ba019ec1ada5f849bc8d72ae6b3e;p=thirdparty%2Fsqlite.git Fix comments on the implementation of the SUM() function. (CVS 3183) FossilOrigin-Name: a8909f3e5fc67ac1ba7d1abd7fb0f4004fec5984 --- diff --git a/manifest b/manifest index 014376ad92..d8cb5b58f0 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Out-of-memory\schecks\sadded\sto\stclsqlite.c\sand\sshell.c.\s\sTickets\s#1805\sand\s#1806.\s(CVS\s3182) -D 2006-05-10T14:39:14 +C Fix\scomments\son\sthe\simplementation\sof\sthe\sSUM()\sfunction.\s(CVS\s3183) +D 2006-05-11T13:25:39 F Makefile.in 5d8dff443383918b700e495de42ec65bc1c8865b F Makefile.linux-gcc 74ba0eadf88748a9ce3fd03d2a3ede2e6715baec F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -43,7 +43,7 @@ F src/date.c cd2bd5d1ebc6fa12d6312f69789ae5b0a2766f2e F src/delete.c 2dea1a83e6ef534346e74fd03114d3a7b16f08fc F src/experimental.c 1b2d1a6cd62ecc39610e97670332ca073c50792b F src/expr.c c85d7bee7d8e3184e00166c2c2ab6edd57b60486 -F src/func.c 7dac3a08b99d997591a65c3e730c49169c4d19cb +F src/func.c acbbf533b55221f26760798d99b37de3ac5678fe F src/hash.c 449f3d6620193aa557f5d86cbc5cc6b87702b185 F src/hash.h 1b3f7e2609141fd571f62199fc38687d262e9564 F src/insert.c 1ae4b8ff5549497808e1b57b9243abcb599fd02f @@ -355,7 +355,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 864cac960390a31c240d34ffd62bb084ab780267 -R fd698bfdf84969615fcfbfaf72ad31c9 +P 364031d6e512b992a7147bbc8e046c20c0c5335a +R 9cfa66f5d989cfd0f2aaee034ce3a939 U drh -Z e750a9d73cf64d5d55602faaba0f7878 +Z d937dfe62cc7b6890517312daa4fad61 diff --git a/manifest.uuid b/manifest.uuid index 09753526cd..1fcf8c57fb 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -364031d6e512b992a7147bbc8e046c20c0c5335a \ No newline at end of file +a8909f3e5fc67ac1ba7d1abd7fb0f4004fec5984 \ No newline at end of file diff --git a/src/func.c b/src/func.c index 0cab2ffbd1..5927e8ba0d 100644 --- a/src/func.c +++ b/src/func.c @@ -16,7 +16,7 @@ ** sqliteRegisterBuildinFunctions() found at the bottom of the file. ** All other code has file scope. ** -** $Id: func.c,v 1.127 2006/04/07 13:26:43 drh Exp $ +** $Id: func.c,v 1.128 2006/05/11 13:25:39 drh Exp $ */ #include "sqliteInt.h" #include @@ -840,16 +840,8 @@ struct SumCtx { ** that it returns NULL if it sums over no inputs. TOTAL returns ** 0.0 in that case. In addition, TOTAL always returns a float where ** SUM might return an integer if it never encounters a floating point -** value. -** -** I am told that SUM() should raise an exception if it encounters -** a integer overflow. But after pondering this, I decided that -** behavior leads to brittle programs. So instead, I have coded -** SUM() to revert to using floating point if it encounters an -** integer overflow. The answer may not be exact, but it will be -** close. If the SUM() function returns an integer, the value is -** exact. If SUM() returns a floating point value, it means the -** value might be approximated. +** value. TOTAL never fails, but SUM might through an exception if +** it overflows an integer. */ static void sumStep(sqlite3_context *context, int argc, sqlite3_value **argv){ SumCtx *p;