ClaireLytt commented on PR #39093:
URL: https://github.com/apache/shardingsphere/pull/39093#issuecomment-5127714905

   @terrymanu 
   Thanks for the review. The two P1s are addressed as follows:
   **P1 — Aliased table-variable targets were still extracted as physical 
tables**
   
   **Problem:** For `UPDATE target ... FROM @MyTableVar AS target`, 
`@MyTableVar` was still extracted from `FROM` as a physical/rewrite table 
because only a direct `@` UPDATE target was excluded.
   
   **Code changes:**
   - `parser/sql/statement/core/.../extractor/TableExtractor.java`
     - `extractTablesFromUpdate()`
     - `findAliasedVariableTableSource()`
     - `findFromTableSegmentByAliasTarget()`
     - `extractTablesFromTableSegment(..., skipSimpleTableSegment)`
   - Tests: `TableExtractorTest`, `UpdateStatementContextTest`
   
   **P1 — Column binding depended on the order of FROM sources**
   
   **Problem:** `isSkipColumnBind()` returned on the first 
`SimpleTableSegmentBinderContext`, so a physical table before a table-variable 
context could cause a false `ColumnNotFoundException`.
   
   **Code changes:**
   - `infra/binder/core/.../expression/type/ColumnSegmentBinder.java`
     - `isSkipColumnBind()`
     - `containsMetadataUnavailableContext()` (new)
   - Tests: `ColumnSegmentBinderTest` (physical-before-variable, 
variable-before-physical, owner-qualified wrong column, DB-link)


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