matrixorigin / matrixorigin/matrixone
[Bug]: PERIOD_ADD/PERIOD_DIFF invalid month handling differs from MySQL
- Dominant language
- Go
- Stars
- 1.9k
- Forks
- 311
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 768
Description
## Bug Report
### MatrixOne Version
Latest `origin/main` verified locally at `200bfa7e0efb`.
### Reproduce Steps
```sql
set session sql_mode = '';
select period_add(202413, 1) as add_bad_month,
period_diff(202413, 202312) as diff_bad_month;
```
### Expected Behavior
MySQL rejects invalid period months:
```text
ERROR 1210 (HY000): Incorrect arguments to period_add
```
### Actual Behavior
MatrixOne returns `NULL` values instead of raising the MySQL-compatible error:
```text
add_bad_month diff_bad_month
NULL NULL
```
### Notes
Found during MySQL compatibility Module 5 exploration. Existing #24504 is a broad old feature request for unsupported datetime functions on 3.0-dev; on latest main `PERIOD_ADD` / `PERIOD_DIFF` exist, so this is now a behavior compatibility bug for invalid period arguments.
Contributor guide
Assessment
This issue has not been assessed yet.