perf: qualify hidden aggregate columns for JOIN FetchRow cache

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-17 06:20:45 +09:00
parent 79e812a24e
commit 53aaa4b69a

View File

@@ -1297,7 +1297,11 @@ METHOD RunSelect() CLASS TSqlExecutor
IF aCols[ i ][ 1 ][ 1 ] == ND_FN .AND. Len( aCols[ i ][ 1 ][ 3 ] ) > 0
xArgExpr := aCols[ i ][ 1 ][ 3 ][ 1 ]
IF xArgExpr[ 1 ] == ND_COL .AND. xArgExpr[ 2 ] != "*"
cBare := SqlExprName( xArgExpr )
/* Use the FULL qualified name (e.g. "o.amount") so
* FetchRow → FindWA resolves to the right workarea
* in JOIN contexts. Bare "amount" would fall through
* to aTables[1] which may be a different table. */
cBare := xArgExpr[ 2 ]
lFound := .F.
FOR j := 1 TO Len( aResultExprs )
IF Upper( aResultExprs[ j ][ 2 ] ) == Upper( cBare )