matrixorigin / matrixorigin/matrixone

[Compatibility]: prepared TIME arithmetic rejects numeric parameters

Open
#28,963 0 comments 0 reactions 1 assignee Claimed by @XuPeng-SH View on GitHub
kind/bug needs-triage
Dominant language
Go
Stars
1.9k
Forks
311
Avg merge
1d 3h
Merged PRs (30d)
768

Description

## Reproduction

On current main / PR #28957 head:

```sql
CREATE TABLE t1(t TIME(3));
INSERT INTO t1 VALUES (0.001), (34.5);
PREPARE s1 FROM 'SELECT t * ? FROM t1';
SET @p = 10;
EXECUTE s1;
```

The prepared expression fails during binding with:

```text
invalid argument operator *, bad value [TIME TEXT]
```

The equivalent ordinary SQL expression `SELECT t * 10 FROM t1` succeeds and returns the expected fractional values.

## Scope

This is separate from #28953's historical decimal-literal normalization regression and from the regression-coverage update in #28957. The current base's prepared parameter inference/coercion path treats the parameter as `TEXT` and does not resolve it against the `TIME` operand for arithmetic. Determine the intended prepared/runtime type contract before changing the binder or arithmetic resolver, then add ordinary and prepared regression coverage.

Related: #28953, #28957.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.