aboutsummaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authordan <Dan Kennedy>2021-03-06 14:46:24 +0000
committerdan <Dan Kennedy>2021-03-06 14:46:24 +0000
commit7f8653a2576e5f9381dba0ebc385be62627cc977 (patch)
tree940595776e7bf5e9a9f377fb65609d9680088904 /src/window.c
parentfa9011ec70ca6f2be38942c996d78d936cca644e (diff)
downloadsqlite-7f8653a2576e5f9381dba0ebc385be62627cc977.tar.gz
sqlite-7f8653a2576e5f9381dba0ebc385be62627cc977.zip
Ensure the correct collation sequence is used for comparisons when delimiting a RANGE window.
FossilOrigin-Name: 01eae68e85b31b7a9f08733459765bbd9bf9dad592bf64f10fc2fa32e02a89c2
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c
index 09572ec03..26a82a9e3 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2065,6 +2065,7 @@ static void windowCodeRangeTest(
int regString = ++pParse->nMem; /* Reg. for constant value '' */
int arith = OP_Add; /* OP_Add or OP_Subtract */
int addrGe; /* Jump destination */
+ CollSeq *pColl;
assert( op==OP_Ge || op==OP_Gt || op==OP_Le );
assert( pOrderBy && pOrderBy->nExpr==1 );
@@ -2155,6 +2156,8 @@ static void windowCodeRangeTest(
** control skips over this test if the BIGNULL flag is set and either
** reg1 or reg2 contain a NULL value. */
sqlite3VdbeAddOp3(v, op, reg2, lbl, reg1); VdbeCoverage(v);
+ pColl = sqlite3ExprNNCollSeq(pParse, pOrderBy->a[0].pExpr);
+ sqlite3VdbeAppendP4(v, (void*)pColl, P4_COLLSEQ);
sqlite3VdbeChangeP5(v, SQLITE_NULLEQ);
assert( op==OP_Ge || op==OP_Gt || op==OP_Lt || op==OP_Le );