diff options
Diffstat (limited to 'src/window.c')
-rw-r--r-- | src/window.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/window.c b/src/window.c index 751e17d2a..b31ed156d 100644 --- a/src/window.c +++ b/src/window.c @@ -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); } |