schizophrenicmaniac commented on PR #40294:
URL: https://github.com/apache/shardingsphere/pull/40294#issuecomment-6594588875

   @terrymanu Thanks, all four are fixed in the latest commit.
   
   With a datasource hint the statement isn't bound, so `d.id` kept `d` as its 
table and failed. The origin lookup now runs for any column without a bound 
original table, not only temporary ones. If the inner projection can't be 
traced any further, it is used as is, so `id` resolves against `foo_tbl` like 
it did before.
   
   Names are now compared the way Firebird stores them: unquoted names are 
upper-cased and quoted names are kept exact, on both the source and the 
reference side. So `a` and `A` both resolve to `"A"` in `c("a","A")`, and `"a"` 
still resolves to `"a"`. The case-insensitive match is only the last fallback.
   
   For `*` and `alias.*` over a CTE, the columns are now rebuilt from the CTE's 
column list and anchor select, the same way as for derived tables, so `"a"` and 
`"A"` are both kept. An unqualified `*` over a join is expanded source by 
source: CTEs and derived tables are rebuilt, and physical tables keep the 
binder's columns. Joins with USING or NATURAL still use the binder's list, 
because it reorders the columns there.
   
   The `Map.Entry` variable is now `entry`. I added tests for `SELECT d.id` 
with a datasource hint, `SELECT d.a` over `"a"`/`"A"`, `SELECT a, A FROM c`, 
`SELECT c.* FROM c`, and `SELECT * FROM c JOIN foo_tbl ON 1 = 1`.


-- 
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]

Reply via email to