schizophrenicmaniac commented on PR #40294: URL: https://github.com/apache/shardingsphere/pull/40294#issuecomment-6384273473
@terrymanu Thanks, both are fixed in the latest commit. `getProjections` now always uses the outer SELECT's expanded projections, so the column count, order and labels come from the outer query. Columns that the binder turns into temporary columns of a derived table are resolved through the same origin lookup used for CTEs. It no longer needs a WITH clause and starts from the outer SELECT's FROM, so `d.n` is traced into the derived table's projection while the scalar subquery stays as its own column. I added your query as a regression test, with `'foo'` as the derived column so it also checks that the two columns keep their order and types. The two test assignments are on one line now, and the production call wraps after a comma. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
