aboutsummaryrefslogtreecommitdiff
path: root/src/vdbeaux.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2019-07-13 16:39:38 +0000
committerdan <dan@noemail.net>2019-07-13 16:39:38 +0000
commitdf9d32441a3d2abf62ecfec60f2605dc1630b76b (patch)
tree8f698360de0417d86e248a0c686b3e2aa7d87cf7 /src/vdbeaux.c
parent8616cff6c8541e2837ccb7a2bc5792de5aba962f (diff)
parent4f9adee289fcc8de83054332212c90f389609d4a (diff)
downloadsqlite-df9d32441a3d2abf62ecfec60f2605dc1630b76b.tar.gz
sqlite-df9d32441a3d2abf62ecfec60f2605dc1630b76b.zip
Add support for attaching a FILTER clause to an aggregate function.
FossilOrigin-Name: ee293e5aeac0b05a8b809095610fd8b4fdaf8e68cd368de90ec0d45e3582ffe5
Diffstat (limited to 'src/vdbeaux.c')
-rw-r--r--src/vdbeaux.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index c21d7db40..5781d8f21 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -4607,7 +4607,11 @@ static int vdbeRecordCompareString(
nCmp = MIN( pPKey2->aMem[0].n, nStr );
res = memcmp(&aKey1[szHdr], pPKey2->aMem[0].z, nCmp);
- if( res==0 ){
+ if( res>0 ){
+ res = pPKey2->r2;
+ }else if( res<0 ){
+ res = pPKey2->r1;
+ }else{
res = nStr - pPKey2->aMem[0].n;
if( res==0 ){
if( pPKey2->nField>1 ){
@@ -4621,10 +4625,6 @@ static int vdbeRecordCompareString(
}else{
res = pPKey2->r1;
}
- }else if( res>0 ){
- res = pPKey2->r2;
- }else{
- res = pPKey2->r1;
}
}