1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Return an error if DISTINCT is used with a window-function (.i.e.

"count(DISTINCT <expr>) OVER (...)".

FossilOrigin-Name: d59bcc8eea4fcf0ee3c2263d31ee42f9f26c28434d2f0045f2d3329f18791d1c
This commit is contained in:
dan
2018-07-06 07:42:42 +00:00
parent 8f26da6c5b
commit e33f6e7c91
5 changed files with 24 additions and 13 deletions

View File

@@ -867,8 +867,13 @@ Window *sqlite3WindowAlloc(
*/
void sqlite3WindowAttach(Parse *pParse, Expr *p, Window *pWin){
if( p ){
p->pWin = pWin;
if( pWin ) pWin->pOwner = p;
if( pWin ){
p->pWin = pWin;
pWin->pOwner = p;
if( p->flags & EP_Distinct ){
sqlite3ErrorMsg(pParse,"DISTINCT is not supported for window functions");
}
}
}else{
sqlite3WindowDelete(pParse->db, pWin);
}