-
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
UPDATE has inconsistent behaviors in a transaction #28092
Comments
The bug is not related to transaction, try the following /* init */ drop table if exists t;
-- init >> 0 rows affected
/* init */ create table t(a blob not null, b text);
-- init >> 0 rows affected
/* init */ insert ignore into t values (null, null), (null, 'abc');
-- init >> 2 rows affected
/* s1 */ update t set b = 'test' where a;
-- s1 >> E1292: Truncated incorrect DOUBLE value: '' When execute the update statement, tidb try to eval |
@zyguan Thanks for your reply, but this bug can only be triggered in transaction in my tests.
And it should follow another statement
|
@CycleYe |
I got it. Thanks for your reply. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
It should be noted that the behavior of "INSERT IGNORE" is confusing, the statement [0] will execute successfully even through there is a NOT NULL constraint on column a. So the initialized table is like:
This is compatible with MySQL.
Now, start a transaction and execute the following statements:
2. What did you expect to see? (Required)
The two UPDATE statements [1] and [2] have the same results
3. What did you see instead (Required)
The first UPDATE [1] executes correctly while the second UPDATE [2] gets an error:
By the way, this error will not happen in MySQL.
4. What is your TiDB version? (Required)
mysql> select version();
The text was updated successfully, but these errors were encountered: