fudianchn commented on issue #35623: URL: https://github.com/apache/shardingsphere/issues/35623#issuecomment-5081900623
已提交修复,补齐 #35621 合并时留作 FIXME 的 BINARY 分片条件 rewrite。 **根因**:`ConditionValueCompareOperatorGenerator#generate` 用 `predicate.getLeft() instanceof ColumnSegment` 选 value 侧;对 `BINARY account_id = 100`(或 `account_id = BINARY 100`),列/值被 `UnaryOperationExpression(BINARY, …)` 包裹而非 `ColumnSegment`,导致误选 BINARY 一元式为 value 侧、取不到值 → 无分片条件 → 全路由广播。列抽取不受影响(`ColumnExtractor` 已 unwrap)。 **修复**:选 value 侧前先从两侧剥离前导 BINARY 一元式(新增 `unwrapBinaryOperator`),仅剥离 BINARY(不动 -/+/~,不影响负值路由)。对应 `select.xml:532-551` 的 4 个 FIXME 用例(均期望 `t_account_0`)。 补了 2 个单测(master 上失败、修复后通过),通过 Spotless/Checkstyle/PMD/SpotBugs。 -- 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]
