1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Do not convert an expression node that is already TK_REGISTER into a

new TK_REGISTER.  This is a follow-up to [663f5dd32d9db832] that fixes a
bug discovered by dbsqlfuzz.

FossilOrigin-Name: fcb669cfaa8a59ca710504d5aaa1936f65a6da8ff13473ad84458f97a6fd1f49
This commit is contained in:
drh
2024-06-28 17:14:00 +00:00
parent 105c20648e
commit 076bd5758b
4 changed files with 31 additions and 10 deletions

View File

@ -8336,7 +8336,10 @@ int sqlite3Select(
if( iOrderByCol ){
Expr *pX = p->pEList->a[iOrderByCol-1].pExpr;
Expr *pBase = sqlite3ExprSkipCollateAndLikely(pX);
if( ALWAYS(pBase!=0) && pBase->op!=TK_AGG_COLUMN ){
if( ALWAYS(pBase!=0)
&& pBase->op!=TK_AGG_COLUMN
&& pBase->op!=TK_REGISTER
){
sqlite3ExprToRegister(pX, iAMem+j);
}
}