1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Return an error if a "RANGE" window-frame uses "<expr> PRECEDING" or "<expr>

FOLLOWING".

FossilOrigin-Name: 786c87ba4150509e141baab32c51e64bbd3ce323735e0f47d65ed54d14215bc4
This commit is contained in:
dan
2018-07-05 18:34:53 +00:00
parent 683b0fffee
commit 7a606e1ab2
4 changed files with 28 additions and 9 deletions

View File

@@ -837,7 +837,15 @@ Window *sqlite3WindowAlloc(
int eStart, Expr *pStart,
int eEnd, Expr *pEnd
){
Window *pWin = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
Window *pWin = 0;
if( eType==TK_RANGE && (pStart || pEnd) ){
sqlite3ErrorMsg(pParse, "RANGE %s is only supported with UNBOUNDED",
(pStart ? "PRECEDING" : "FOLLOWING")
);
}else{
pWin = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
}
if( pWin ){
assert( eType );