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

Missing decimal M and D check #21063

Closed
blacktear23 opened this issue Nov 15, 2020 · 2 comments
Closed

Missing decimal M and D check #21063

blacktear23 opened this issue Nov 15, 2020 · 2 comments
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.

Comments

@blacktear23
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> create table td(d decimal(10, 5));
Query OK, 0 rows affected (0.01 sec)

mysql> select * from td where d = cast(0 as decimal(10,20));
Empty set (0.00 sec)

mysql> select * from td where d = cast(0 as decimal(1000,20));
Empty set (0.00 sec)

2. What did you expect to see? (Required)

mysql> create table td(d decimal(10, 5));
Query OK, 0 rows affected (0.01 sec)

mysql> select * from td where d = cast(0 as decimal(10,20));
ERROR 1427 (42000): For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '').

mysql> select * from td where d = cast(0 as decimal(1000,20));
ERROR 1426 (42000): Too big precision 1000 specified for column '0'. Maximum is 65.
mysql>

3. What did you see instead (Required)

mysql> create table td(d decimal(10, 5));
Query OK, 0 rows affected (0.01 sec)

mysql> select * from td where d = cast(0 as decimal(10,20));
Empty set (0.00 sec)

mysql> select * from td where d = cast(0 as decimal(1000,20));
Empty set (0.00 sec)

4. What is your TiDB version? (Required)

tidb_version(): Release Version: v4.0.0-beta.2-1568-ga35e3fd5c-dirty
Edition: Community
Git Commit Hash: a35e3fd5c7b3a7be73d35a7314e1eb6542950715
Git Branch: refactor-parser-config-update
UTC Build Time: 2020-11-13 12:41:20
GoVersion: go1.15.2
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
@wjhuang2016
Copy link
Member

Closed by #21845

SIG Infra Kanban automation moved this from Issue Backlog: Need Triage to Done Jun 3, 2021
@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

6 participants