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

   Both blocking issues are fixed in b5e365b0.
   
   1. Non-rewriting aggregations no longer bypass the drift check. 
`mayRewriteColumnCount` now mirrors `ShardingProjectionsTokenGenerator`: only 
aggregations owning derived aggregation projections (AVG -> SUM + COUNT) and 
derived projections skip the count check, COUNT and SUM keep it. Regression: 
`assertGetColumnCountFallsBackToResultSetMetaDataWhenNonRewritingAggregationProjectionMismatches`
 (wildcard + COUNT(*), 5 expanded vs 6 actual -> 6, was 5 before the change). 
AVG is now modeled with real derived projections: 
`ShardingSphereResultSetMetaDataTest` through the real `ProjectionEngine`, 
`ShardingSphereResultSetUtilsTest` and `MySQLProjectionMetadataResolverTest` 
with explicit AVG_DERIVED_COUNT_0 / AVG_DERIVED_SUM_0.
   
   2. COM_STMT_PREPARE advertises the count it emits. The OK packet column 
count is now taken from the emitted column definition packets instead of 
`projections.size()`, and wildcard projections are excluded from the 
local-metadata shortcut, so they are resolved through the backend probe where 
drift is handled before that shortcut. Executor regression: 
`assertPrepareWildcardSelectWithMetadataDrift` (SELECT * on a 5-column local 
schema with 6 backend columns: OK packet count = 6 and 6 definition packets; 
the OK packet advertised 5 before the change).
   
   Verification: jdbc 585 tests, proxy-frontend-mysql 198 tests passed; 
spotless and checkstyle pass.
   


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