Phixsura opened a new pull request, #38698:
URL: https://github.com/apache/shardingsphere/pull/38698
Fixes #23764.
Changes proposed in this pull request:
- Unwrap nested `TypeCastExpression` to its underlying expression at the
top of `InsertClauseShardingConditionEngine.createShardingCondition`. The
existing `instanceof SimpleExpressionSegment / CommonExpressionSegment /
isNowExpression` chain has no branch for `TypeCastExpression` (a
`ComplexExpressionSegment`), so a PostgreSQL `?::int4` cast on the sharding key
was silently dropped and the INSERT broadcast to every shard.
- `InsertClauseShardingConditionEngineTest`: add three regression cases
covering a `TypeCast` over a parameter marker, over a literal, and nested casts
(e.g., `?::int4::text`).
- `e2e-dml-insert.xml`: enable the `?::int4` INSERT case that was
previously commented out with `TODO Fix #23764`.
`ConditionValue` / `WhereClauseShardingConditionEngine` have the same shape
of gap for WHERE-clause type casts, but the reported scenario only exercises
INSERT VALUES; sending that as a separate follow-up.
---
Before committing this PR, I'm sure that I have checked the following
options:
- [x] My code follows the [code of
conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/)
of this project.
- [x] I have self-reviewed the commit code.
- [ ] I have (or in comment I request) added corresponding labels for the
pull request.
- [x] I have passed maven check locally for the affected modules (spotless,
checkstyle, unit tests).
- [x] I have made corresponding changes to the documentation.
- [x] I have added corresponding unit tests for my changes.
- [x] I have updated the Release Notes of the current development version.
For more details, see [Update Release
Note](https://shardingsphere.apache.org/community/en/involved/contribute/contributor/)
--
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]