cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
29.96k stars 3.79k forks source link

sql: fix literal integer expression typing #74090

Open mgartner opened 2 years ago

mgartner commented 2 years ago

A recent change in #73762 ensures that a literal integer does not exceed the minimum or maximum value of its type. This caused a subtle regression in default expressions. The table below should be successfully created, even though the default value exceeds the columns maximum value.

CREATE TABLE t (i INT2 DEFAULT 99999999)

Currently we type the default expression as an INT2, but to make this behavior work, I think we'll have to type the expression as an INT8.

Jira issue: CRDB-11913

github-actions[bot] commented 1 year ago

We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!