opt: fix ResolvedType() for aggregateInfo in the optbuilder
Prior to this commit, it was possible that calling ResolvedType() on an aggregateInfo object returned the wrong type. This was because aggregateInfo did not implement ResolvedType(), and was therefore passing the call to the embedded tree.FuncExpr, which may have been stripped of its original type information. This commit fixes the problem by adding an implementation of ResolvedType() to aggregateInfo, which simply returns the type of the aggregation column represented by the struct. Fixes #46914 Release note (bug fix): Fixed an internal error that could happen during planning for some queries with aggregate functions embedded in complex scalar expressions.
Showing with 40 additions and 0 deletions