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

Wrong precision using prepare statement and tiflash #21804

Closed
marsishandsome opened this issue Dec 15, 2020 · 2 comments · Fixed by #21849
Closed

Wrong precision using prepare statement and tiflash #21804

marsishandsome opened this issue Dec 15, 2020 · 2 comments · Fixed by #21849
Assignees
Labels
severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@marsishandsome
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t ( c_int int, c_str varchar(40), c_datetime datetime, c_timestamp timestamp, c_double double, c_decimal decimal(12, 6)   , unique key(c_str)   , unique key(c_timestamp) );
alter table t set tiflash replica 1;
prepare s7 from 'select c_int, c_str, c_double, c_decimal, c_datetime, c_timestamp from t where c_decimal < ?';
set @v1 = 9.330;
execute s7 using @v1;

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

MySQL [test]> execute s7 using @v1 ;
Empty set (0.01 sec)

3. What did you see instead (Required)

MySQL [test]> execute s7 using @v1 ;
ERROR 1105 (HY000): Wrong precision:18446744073709551615

4. What is your TiDB version? (Required)

Release Version: v4.0.0-beta.2-1804-g06cd92e05
Edition: Community
Git Commit Hash: 06cd92e05f0dfff1a139c1e5baca2ee24fb387b2
Git Branch: master
UTC Build Time: 2020-12-12 13:49:05
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
@LittleFall
Copy link
Contributor

LittleFall commented Dec 16, 2020

TiFlash Code, function createDecimal(UInt64 prec, UInt64 scale), for parameter prec, a -1 is passed in, but the legal value range is [1,65].

Because the column info of expr has a flen -1.

Need further investigation.

@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/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants