-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
query result for float type is incompatible with previous version #22791
Comments
MySQL don't support FLOAT(M,D) and DOUBLE(M,D) since 8.0.17 |
@b41sh Got, do we have related document to remind users about this incompatibily doing upgrade. |
@cfzjywxk This is recently modified, the document should not have been modified yet. |
There is still issues with float type. mysql8:
|
/assign |
Im working on this in #22823 The issue I mention in the comment above:
Can be solved without solving the deprecated double(m,n)/float(m,n) compatibility issue mentioned in this issue.
Solving the float(m,n) problem I can do by printing in scientific format (which mysql does not), the same way as: #21692. If this is OK solution, I can implement that and solve both. |
This resolve issue pingcap#22791: query result for float type is incompatible with previous version It seems like this broke in the fix for issue pingcap#21692. In mysql, e-format is only returned when used in the query, for example: select 1e15, will print 1e15 back. However, when stored in a table mysel will print it in decimal form. issue pingcap#21692 resolved this by checking for empty table. However, that fix applies for everything rather than only for e-format. And that caused the new issue pingcap#22791. This resolves both pingcap#22791 and pingcap#21692. It also resolve an issue where for a default width float column we do not round to the mysql default precision.
/cc @XuHuaiyu |
we have a document that says the difference |
Close it since we decide not to fix it. |
Please check whether the issue should be labeled with 'affects-x.y' or 'backport-x.y.z', |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
create table tf(f1 float(10,2));
insert into tf values("-34028234.66");
select * from tf;
2. What did you expect to see? (Required)
This result is the same with tidb version v4.0 and mysql.
3. What did you see instead (Required)
Seems the float type logic is changed in the master branch and incompatibility is introduced.
4. What is your TiDB version? (Required)
master version with commit hash
9cb9b69b61a76e9cc3f8cfa27f86635c2496cf16
The text was updated successfully, but these errors were encountered: