aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2022-11-25 13:15:48 +0000
committerdrh <>2022-11-25 13:15:48 +0000
commitf5d0656f167b4b9b7730e0af0caefcb7893b4432 (patch)
tree140fabd193c25c90adb339ed8142383fccb8b3d5 /src
parent7960da03466d96209f53defe088fc16916ba26fc (diff)
downloadsqlite-f5d0656f167b4b9b7730e0af0caefcb7893b4432.tar.gz
sqlite-f5d0656f167b4b9b7730e0af0caefcb7893b4432.zip
Improve the robustness of the updateAccumulator() routine against OOM.
FossilOrigin-Name: d2844f577b69fdc16a0a2568c0958fc3d8aff33e9a0ef80e0f58e92f01097432
Diffstat (limited to 'src')
-rw-r--r--src/select.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/select.c b/src/select.c
index e76198772..215acd6a0 100644
--- a/src/select.c
+++ b/src/select.c
@@ -6430,8 +6430,8 @@ static void finalizeAggFunctions(Parse *pParse, AggInfo *pAggInfo){
/*
-** Update the accumulator memory cells for an aggregate based on
-** the current cursor position.
+** Generate code that will update the accumulator memory cells for an
+** aggregate based on the current cursor position.
**
** If regAcc is non-zero and there are no min() or max() aggregates
** in pAggInfo, then only populate the pAggInfo->nAccumulator accumulator
@@ -6452,6 +6452,7 @@ static void updateAccumulator(
struct AggInfo_col *pC;
assert( pAggInfo->iFirstReg>0 );
+ if( pParse->nErr ) return;
pAggInfo->directMode = 1;
for(i=0, pF=pAggInfo->aFunc; i<pAggInfo->nFunc; i++, pF++){
int nArg;