Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: fix literal integer expression typing #74090

Open
mgartner opened this issue Dec 20, 2021 · 1 comment
Open

sql: fix literal integer expression typing #74090

mgartner opened this issue Dec 20, 2021 · 1 comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-queries SQL Queries Team X-nostale Marks an issue/pr that should be ignored by the stale bot
Projects

Comments

@mgartner
Copy link
Collaborator

mgartner commented Dec 20, 2021

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

@mgartner mgartner added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Dec 20, 2021
@mgartner mgartner self-assigned this Dec 20, 2021
@mgartner mgartner added this to Triage in SQL Queries via automation Dec 20, 2021
@blathers-crl blathers-crl bot added the T-sql-queries SQL Queries Team label Dec 20, 2021
@mgartner mgartner moved this from Triage to 22.1 December Milestone in SQL Queries Dec 20, 2021
@mgartner mgartner moved this from 22.1 December Milestone to 22.1 Medium Likelihood (60%) in SQL Queries Dec 20, 2021
@mgartner mgartner moved this from 22.1 Medium Likelihood (60%) to 22.1 High Likelihood (90%) in SQL Queries Feb 2, 2022
@mgartner mgartner moved this from 22.1 High Likelihood (90%) to Backlog in SQL Queries Mar 23, 2022
@mgartner mgartner removed their assignment Mar 23, 2022
@github-actions
Copy link

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!

@mgartner mgartner added the X-nostale Marks an issue/pr that should be ignored by the stale bot label Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-queries SQL Queries Team X-nostale Marks an issue/pr that should be ignored by the stale bot
Projects
Status: Backlog
SQL Queries
Backlog (DO NOT ADD NEW ISSUES)
Development

No branches or pull requests

2 participants