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

   @terrymanu Thanks, all three are fixed in the latest commit.
   
   The label is now taken from the projection's own identifier (its alias, or 
the column name) instead of rebuilding an IdentifierValue from the decoded 
string, so `"[n]"` stays `[n]`.
   
   The origin lookup now matches the exact label first and only falls back to a 
case-insensitive match when nothing matches exactly, so `d."a"` and `d."A"` 
resolve to their own projections and unquoted names still match as before.
   
   For the wildcard, the binder's derived-table context is keyed 
case-insensitively by label, so `"a"` and `"A"` are already collapsed in the 
outer shorthand's actual columns. For `*` or `alias.*` over a derived table 
without a column list, the columns are now rebuilt from the derived table's own 
projections with `SubqueryTableBindUtils.createSubqueryProjections`, the same 
way the binder creates them, so the full sequence is kept. Other shorthands 
still use the binder's expanded columns.
   
   I added tests for `SELECT d."[n]", d.* FROM (SELECT id AS "[n]" FROM 
foo_tbl) d`, `SELECT d."a", d."A"` and `SELECT *` over `(SELECT 1 AS "a", 'foo' 
AS "A" FROM foo_tbl) d`.


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