cockroachdb / cockroachdb/cockroach
opt: lift restrictions on comparison normalizations
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
See: #118307
In #118307 we lifted the restrictions on types of comparison normalization rules. I think it should be possible to lift this restriction for more types. For each pair of types allowed in `l - r` and l + r` expressions, we should determine if an overflow will error. If overflows cause errors, then we can apply the normalization rules to those types.
Overloads for `-` can be found here:https://github.com/cockroachdb/cockroach/blob/58ec968722bab80da5dcb681fd3f066a39ff518e/pkg/sql/sem/tree/eval.go#L770
Overloads for `+` can be found here: https://github.com/cockroachdb/cockroach/blob/58ec968722bab80da5dcb681fd3f066a39ff518e/pkg/sql/sem/tree/eval.go#L599
Jira issue: CRDB-35754
Contributor guide
Assessment
This issue has not been assessed yet.