-C First\spass\sat\soptimizing\smax()/min()\sas\sdescribed\sin\s#2853.\sSome\srefinements\sto\scome.\s(CVS\s4687)
-D 2008-01-05T17:39:30
+C Fix\sa\smemory\sleak\sintroduced\swith\s#4687.\s(CVS\s4688)
+D 2008-01-05T18:44:29
F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
F Makefile.in 30789bf70614bad659351660d76b8e533f3340e9
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/prepare.c f1bb8eb642082e618a359c08e3e107490eafe0e3
F src/printf.c eb27822ba2eec669161409ca31279a24c26ac910
F src/random.c 4a22746501bf36b0a088c66e38dde5daba6a35da
-F src/select.c 33c60380c81283c16414040d034b76f1732ffb4e
+F src/select.c fcde4b33ef106b64685ce842dc05e56e1c1116eb
F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96
F src/shell.c 5391e889384d2062249f668110d64ed16f601c4b
F src/sqlite.h.in 2a7e3776534bbe6ff2cdc058f3abebe91e7e429f
F src/vdbe.h bb128757b84280504a1243c450fd13ead248ede5
F src/vdbeInt.h 31bd686595356284d5484592e2dc6e58025aa346
F src/vdbeapi.c f14174843bf4be2c9afdf2ef48b61e7c3ac62d7c
-F src/vdbeaux.c b5437d3afb5552675603ed73058b3a7184dc81df
+F src/vdbeaux.c 75b7d3e42c94310f28f6f7d3e08b69797fbe8a78
F src/vdbeblob.c b90f7494c408d47ce6835000b01e40b371e27baf
F src/vdbefifo.c 334c838c8f42d61a94813d136019ee566b5dc2f6
F src/vdbemem.c 123994fcd344993d2fb050a83b91b341bbbd08b4
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 66396d2f0289e36b5fc0af5078c08d1b17f342ae
-R b1dacf0522dc83de3d6ddccfc407074e
+P c449e04f1870b1ff726c95c0bf1c6c6a22ca588a
+R 7feff0f8e24ec4a4191ddc4ce03d03a2
U danielk1977
-Z 85372970e5aef600b6f97b67c85860f6
+Z 92958faf5e34756c3b8dada9d72fd997
-c449e04f1870b1ff726c95c0bf1c6c6a22ca588a
\ No newline at end of file
+2b98b0fca82e285ae6b38384587aafa27985fa34
\ No newline at end of file
** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite.
**
-** $Id: select.c,v 1.387 2008/01/05 17:39:30 danielk1977 Exp $
+** $Id: select.c,v 1.388 2008/01/05 18:44:29 danielk1977 Exp $
*/
#include "sqliteInt.h"
} /* endif pGroupBy */
else {
ExprList *pMinMax = 0;
+ ExprList *pDel = 0;
u8 flag;
flag = minMaxQuery(pParse, p);
pMinMax->a[0].sortOrder = ((flag==ORDERBY_MIN)?0:1);
pMinMax->a[0].pExpr->op = TK_COLUMN;
}
+ pDel = pMinMax;
}
/* This case runs if the aggregate has no GROUP BY clause. The
*/
resetAccumulator(pParse, &sAggInfo);
pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, &pMinMax, flag);
- if( pWInfo==0 ) goto select_end;
+ if( pWInfo==0 ){
+ sqlite3ExprListDelete(pMinMax);
+ goto select_end;
+ }
updateAccumulator(pParse, &sAggInfo);
if( !pMinMax && flag ){
sqlite3VdbeAddOp2(v, OP_Goto, 0, pWInfo->iBreak);
selectInnerLoop(pParse, p, p->pEList, 0, 0, 0, -1,
pDest, addrEnd, addrEnd, aff);
- sqlite3ExprListDelete(pMinMax);
+ sqlite3ExprListDelete(pDel);
}
sqlite3VdbeResolveLabel(v, addrEnd);
va_list ap;
assert( p->nOp>0 || p->aOp==0 );
assert( p->aOp==0 || p->aOp[p->nOp-1].zComment==0 || p->db->mallocFailed );
- va_start(ap, zFormat);
- p->aOp[p->nOp-1].zComment = sqlite3VMPrintf(p->db, zFormat, ap);
- va_end(ap);
+ if( p->nOp ){
+ va_start(ap, zFormat);
+ p->aOp[p->nOp-1].zComment = sqlite3VMPrintf(p->db, zFormat, ap);
+ va_end(ap);
+ }
}
#endif