mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
Fix a harmless assertion fault resulting from [6e6b3729e0549de0] that was
discovered by dbsqlfuzz. Enhance .selecttrace output to show omitted ORDER BY clauses. New dbsqlfuzz test cases added. FossilOrigin-Name: 27a0388ad616f80e8dcc986c247a5c23a8565dae9081b04ff85bac0d357e531b
This commit is contained in:
14
src/select.c
14
src/select.c
@@ -6034,8 +6034,18 @@ int sqlite3Select(
|
||||
pDest->eDest==SRT_Except || pDest->eDest==SRT_Discard ||
|
||||
pDest->eDest==SRT_DistQueue || pDest->eDest==SRT_DistFifo );
|
||||
/* All of these destinations are also able to ignore the ORDER BY clause */
|
||||
sqlite3ExprListDelete(db, p->pOrderBy);
|
||||
p->pOrderBy = 0;
|
||||
if( p->pOrderBy ){
|
||||
#if SELECTTRACE_ENABLED
|
||||
SELECTTRACE(1,pParse,p, ("dropping superfluous ORDER BY:\n"));
|
||||
if( sqlite3SelectTrace & 0x100 ){
|
||||
sqlite3TreeViewExprList(0, p->pOrderBy, 0, "ORDERBY");
|
||||
}
|
||||
#endif
|
||||
sqlite3ParserAddCleanup(pParse,
|
||||
(void(*)(sqlite3*,void*))sqlite3ExprListDelete,
|
||||
p->pOrderBy);
|
||||
p->pOrderBy = 0;
|
||||
}
|
||||
p->selFlags &= ~SF_Distinct;
|
||||
p->selFlags |= SF_NoopOrderBy;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user