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

The result of 'varbinary + 1' is incorrect #23411

Closed
wan1y opened this issue Mar 18, 2021 · 3 comments
Closed

The result of 'varbinary + 1' is incorrect #23411

wan1y opened this issue Mar 18, 2021 · 3 comments
Labels
severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug. type/stale This issue has not been updated for a long time.

Comments

@wan1y
Copy link

wan1y commented Mar 18, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> create table t1(col1 varbinary(20));
Query OK, 0 rows affected (0.38 sec)

mysql> insert into t1 values(".1pingcap");
Query OK, 1 row affected (0.05 sec)

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

mysql> select col1, col1 + 1 from t1;
+-----------+----------+
| col1      | col1 + 1 |
+-----------+----------+
| .1pingcap |      1.1 |
+-----------+----------+
1 row in set (0.07 sec)

3. What did you see instead (Required)

mysql> select col1, col1 + 1 from t1;
+-----------+----------+
| col1      | col1 + 1 |
+-----------+----------+
| .1pingcap |        1 |
+-----------+----------+
1 row in set (0.06 sec)

4. What is your TiDB version? (Required)

Release Version: v4.0.0-beta.2-2393-g3cfb984
Edition: Community
Git Commit Hash: 3cfb984211901c3416ec539658ac86d2cb64e81f
Git Branch: master
UTC Build Time: 2021-03-18 02:41:26
GoVersion: go1.13.5
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
@wan1y wan1y added the type/bug The issue is confirmed as a bug. label Mar 18, 2021
@jebter jebter added this to the v5.0.0 ga milestone Mar 22, 2021
@zimulala zimulala removed this from the v5.0.0 ga milestone Mar 22, 2021
@wshwsh12
Copy link
Contributor

/assign @wshwsh12

@dentiscalprum dentiscalprum removed their assignment Apr 15, 2021
@ichn-hu
Copy link
Contributor

ichn-hu commented May 10, 2021

Hi @wanliyi , it seems like a corner case caused by invalid parameter, so I would suggest change the severity to moderate, please help change the label if you agree.

@wshwsh12 wshwsh12 removed their assignment Jun 15, 2021
@jebter
Copy link

jebter commented Jun 25, 2024

TiDB root@127.0.0.1:test> create table t1(col1 varbinary(20));
Query OK, 0 rows affected
Time: 0.074s
TiDB root@127.0.0.1:test> insert into t1 values(".1pingcap");
Query OK, 1 row affected
Time: 0.003s
TiDB root@127.0.0.1:test> select col1, col1 + 1 from t1;
+-----------+----------+
| col1      | col1 + 1 |
+-----------+----------+
| .1pingcap | 1.1      |
+-----------+----------+

1 row in set
Time: 0.006s
TiDB root@127.0.0.1:test> select tidb_version() \G
***************************[ 1. row ]***************************
tidb_version() | Release Version: v8.1.0
Edition: Community
Git Commit Hash: 945d07c5d5c7a1ae212f6013adfb187f2de24b23
Git Branch: HEAD
UTC Build Time: 2024-05-21 03:52:40
GoVersion: go1.21.10
Race Enabled: false
Check Table Before Drop: false
Store: tikv

1 row in set
Time: 0.001s

Please try the latest version. I will close it, if there are any updates, you can reopen it.

@jebter jebter closed this as completed Jun 25, 2024
@jebter jebter added the type/stale This issue has not been updated for a long time. label Jun 25, 2024
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. type/stale This issue has not been updated for a long time.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants