aboutsummaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2019-09-04 06:56:43 +0000
committerdan <dan@noemail.net>2019-09-04 06:56:43 +0000
commit1a97c413f8c26670d3bbf122a6eaa88dea0a0b5c (patch)
treedd7d8ea8a48eecee8cf68a3fbdf4ed9d239103ff /src/window.c
parent7dc3547eeb691d5397e9dc55206daab0927937d8 (diff)
downloadsqlite-1a97c413f8c26670d3bbf122a6eaa88dea0a0b5c.tar.gz
sqlite-1a97c413f8c26670d3bbf122a6eaa88dea0a0b5c.zip
Fix handling of NULL, text and blob values in window queries that use "RANGE BETWEEN A FOLLOWING AND B FOLLOWING", or "B PRECEDING AND A PRECEDING", where A>B.
FossilOrigin-Name: cb3e2be674316e1d39968eb6567f1fe1b72f9d89af49640a9e83f944979c4cf0
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/window.c b/src/window.c
index 7cb86e58b..ed2e32079 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2745,7 +2745,7 @@ void sqlite3WindowCodeStep(
windowCheckValue(pParse, regEnd, 1 + (pMWin->eFrmType==TK_RANGE ? 3 : 0));
}
- if( pMWin->eStart==pMWin->eEnd && regStart ){
+ if( pMWin->eFrmType!=TK_RANGE && pMWin->eStart==pMWin->eEnd && regStart ){
int op = ((pMWin->eStart==TK_FOLLOWING) ? OP_Ge : OP_Le);
int addrGe = sqlite3VdbeAddOp3(v, op, regStart, 0, regEnd);
VdbeCoverageNeverNullIf(v, op==OP_Ge); /* NeverNull because bound <expr> */