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

unexpected error when apply arithmetical operation on TEXT column #28104

Open
TrocTool opened this issue Sep 16, 2021 · 0 comments
Open

unexpected error when apply arithmetical operation on TEXT column #28104

TrocTool opened this issue Sep 16, 2021 · 0 comments
Labels
severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@TrocTool
Copy link

TrocTool commented Sep 16, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

/* init */ drop table if exists t;
/* init */ create table t(a TEXT);
/* init */ insert into t values('abc');

mysql> update t set a = 'def' where a+1; 
mysql> select * from t; 

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

In MySQL 8.0.26

mysql> update t set a = 'def' where a+1;
Query OK, 1 row affected (0.13 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> select * from t;
+------+
| a    |
+------+
| def  |
+------+
1 row in set (0.00 sec)

3. What did you see instead (Required)

mysql> update t set a = 'def' where a + 1;
ERROR 1292 (22007): Truncated incorrect INTEGER value: 'abc'

mysql> select * from t;
+------+
| a    |
+------+
| abc  |
+------+
1 row in set (0.00 sec)

4. What is your TiDB version? (Required)

mysql> select version();
+--------------------+
| version()          |
+--------------------+
| 5.7.25-TiDB-v5.2.1 |
+--------------------+
1 row in set (0.00 sec)
@TrocTool TrocTool added the type/bug The issue is confirmed as a bug. label Sep 16, 2021
@TrocTool TrocTool changed the title arithmetical operation on TEXT column has inconsistent results in SELECT and UPDATE unexpected error when apply arithmetical operation on TEXT column Sep 23, 2021
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

No branches or pull requests

2 participants