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:
|
treebin.Minus: {overloads: []*BinOp{ |
Overloads for + can be found here:
|
treebin.Plus: {overloads: []*BinOp{ |
Jira issue: CRDB-35754
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 - rand 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:cockroach/pkg/sql/sem/tree/eval.go
Line 770 in 58ec968
Overloads for
+can be found here:cockroach/pkg/sql/sem/tree/eval.go
Line 599 in 58ec968
Jira issue: CRDB-35754