mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Fix the typeof() and length() optimization so that it works for aggregates
as well as scalar queries. FossilOrigin-Name: bc18215a8a660442db6ddeeda4a88df0acffe0f7
This commit is contained in:
@@ -2599,9 +2599,11 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){
|
||||
** loading.
|
||||
*/
|
||||
if( (pDef->flags & (SQLITE_FUNC_LENGTH|SQLITE_FUNC_TYPEOF))!=0 ){
|
||||
u8 op;
|
||||
assert( nFarg==1 );
|
||||
assert( pFarg->a[0].pExpr!=0 );
|
||||
if( pFarg->a[0].pExpr->op==TK_COLUMN ){
|
||||
op = pFarg->a[0].pExpr->op;
|
||||
if( op==TK_COLUMN || op==TK_AGG_COLUMN ){
|
||||
assert( SQLITE_FUNC_LENGTH==OPFLAG_LENGTHARG );
|
||||
assert( SQLITE_FUNC_TYPEOF==OPFLAG_TYPEOFARG );
|
||||
testcase( pDef->flags==SQLITE_FUNC_LENGTH );
|
||||
|
||||
Reference in New Issue
Block a user