From 6ee35a22ee1e09d72e8600a412f95cdb83f7b8f1 Mon Sep 17 00:00:00 2001 From: npt-1707 Date: Thu, 12 Mar 2026 00:42:47 +0800 Subject: [PATCH] vendor/sqlite3/sqlite3.c: Fix a crash that could occur if a sub-select that uses both DISTINCT and window functions also used an ORDER BY that is the same as its select list. --- vendor/sqlite3/sqlite3.c | 1 + 1 file changed, 1 insertion(+) diff --git a/vendor/sqlite3/sqlite3.c b/vendor/sqlite3/sqlite3.c index 4729f45..83cf3ac 100644 --- a/vendor/sqlite3/sqlite3.c +++ b/vendor/sqlite3/sqlite3.c @@ -130307,6 +130307,7 @@ SQLITE_PRIVATE int sqlite3Select( */ if( (p->selFlags & (SF_Distinct|SF_Aggregate))==SF_Distinct && sqlite3ExprListCompare(sSort.pOrderBy, pEList, -1)==0 + && p->pWin==0 ){ p->selFlags &= ~SF_Distinct; pGroupBy = p->pGroupBy = sqlite3ExprListDup(db, pEList, 0);