diff options
author | drh <> | 2022-11-24 13:19:25 +0000 |
---|---|---|
committer | drh <> | 2022-11-24 13:19:25 +0000 |
commit | b669bb5e2bd130b2a8d8a87304449cfb3b27f9d9 (patch) | |
tree | d9d5c29356caa7adc9417e3d41fe57b9774f0e77 /src/expr.c | |
parent | 4b1555a9fc77dfaca1ee3eab38a2ba424a9d4ad9 (diff) | |
download | sqlite-b669bb5e2bd130b2a8d8a87304449cfb3b27f9d9.tar.gz sqlite-b669bb5e2bd130b2a8d8a87304449cfb3b27f9d9.zip |
New test cases. Fix the logic so that it works for GROUP BY aggregates
that do not require sorting.
FossilOrigin-Name: ef6ebe7922f56c1584a005deedc85ca1070b4fe5082ada8bbf8d06df54f1c9ef
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/expr.c b/src/expr.c index c34a28dc4..2e909dd8c 100644 --- a/src/expr.c +++ b/src/expr.c @@ -4145,6 +4145,11 @@ expr_code_doover: } } return target; + }else if( pExpr->y.pTab==0 ){ + /* This case happens when the argument to an aggregate function + ** is rewritten by aggregateConvertIndexedExprRefToColumn() */ + sqlite3VdbeAddOp3(v, OP_Column, pExpr->iTable, pExpr->iColumn, target); + return target; } /* Otherwise, fall thru into the TK_COLUMN case */ /* no break */ deliberate_fall_through |