cockroachdb / cockroachdb/cockroach
roachtest: no validation when creating `tree.DDate` via binary operation
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
Here is a simple diff that reproduces the problem:
```
diff --git a/pkg/sql/logictest/testdata/logic_test/distsql_datetime b/pkg/sql/logictest/testdata/logic_test/distsql_datetime
index 07a972375aa..99955b72b92 100644
--- a/pkg/sql/logictest/testdata/logic_test/distsql_datetime
+++ b/pkg/sql/logictest/testdata/logic_test/distsql_datetime
@@ -13,3 +13,6 @@ ALTER TABLE ts EXPERIMENTAL_RELOCATE SELECT ARRAY[i%5+1], i FROM generate_series
# year 0 on the remote nodes (#56554).
statement ok
SELECT t - (SELECT '0001-01-01 00:00:00'::TIMESTAMP - a::INTERVAL FROM ts ORDER BY a LIMIT 1) FROM ts
+
+statement ok
+SELECT ('4714-11-24 BC':::DATE::DATE + 97)::DATE FROM ts;
```
```
expected success, but found
(XX000) internal error: '4713-02-29 BC':::DATE: parsing as type date: field day value 29 is out of range
expr.go:269: in deserializeExpr()
DETAIL: stack trace:
pkg/sql/execinfra/execexpr/expr.go:269: deserializeExpr()
```
Jira issue: CRDB-51190
Contributor guide
Assessment
This issue has not been assessed yet.