fudianchn commented on PR #39613:
URL: https://github.com/apache/shardingsphere/pull/39613#issuecomment-5556092073

   Both blocking issues are fixed in 6ceefa0c.
   
   1. Single-route derived projections no longer bypass the drift check. 
`useExpandedProjections` now decides from the returned metadata instead of the 
bound context: the count check is skipped only when a derived alias 
(`ORDER_BY_DERIVED_0`, `AVG_DERIVED_SUM_0`, ...; matched case-insensitively 
because backends such as PostgreSQL fold unquoted aliases to lowercase) appears 
among the returned column labels, which only happens when the rewrite appended 
those columns. Since `ShardingTokenGenerateBuilder` drops the projection token 
generators for single routes, a single-route query with a derived order-by 
projection now falls back to the returned metadata under drift. Multi-route AVG 
/ order-by / group-by keeps the projection-derived description; the AVG and 
appended-column tests model the derived aliases the backend actually returns. 
Regression: 
`assertCreateColumnLabelAndIndexMapFallsBackToResultSetMetaDataWhenDerivedColumnsNotAppended`,
 red on the previous head (stale projection map i
 nstead of the returned `added_col` mapping).
   
   2. The statement is registered only after the response packets were built, 
so a failed wildcard prepare leaves no unreachable registry entry (the client 
cannot close a statement whose ID never reached it). Regression: 
`assertPrepareWildcardSelectFailureLeavesNoRegistryEntry`, red on the previous 
head (registry still contained the statement after the failed prepare).
   
   Verified locally: jdbc 1229, proxy backend core 583, proxy frontend mysql 
199 tests, 0 failures; spotless and checkstyle pass. The branch is rebased onto 
current master (bf953abc); the import-order conflict in the executor test was 
resolved by the new spotless import rules.
   


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