diff options
author | drh <> | 2024-06-28 17:14:00 +0000 |
---|---|---|
committer | drh <> | 2024-06-28 17:14:00 +0000 |
commit | 076bd5758b7a7e06cd2de9677ea9ba077d9dba2f (patch) | |
tree | 29ab9bbb7cddd0a5202078f6f8d46b2f1e2c5baa /src | |
parent | 105c20648e1b05839fd0638686b95f2e3998abcb (diff) | |
download | sqlite-076bd5758b7a7e06cd2de9677ea9ba077d9dba2f.tar.gz sqlite-076bd5758b7a7e06cd2de9677ea9ba077d9dba2f.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/select.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/select.c b/src/select.c index 3bc5858f6..b43861cef 100644 --- a/src/select.c +++ b/src/select.c @@ -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); } } |