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

UPDATE statement with CAST() reports an error in the transaction #39972

Open
sayJason opened this issue Dec 15, 2022 · 1 comment
Open

UPDATE statement with CAST() reports an error in the transaction #39972

sayJason opened this issue Dec 15, 2022 · 1 comment
Labels
may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.0 may-affects-6.1 may-affects-6.2 may-affects-6.3 may-affects-6.4 severity/moderate sig/execution SIG execution sig/transaction SIG:Transaction type/bug The issue is confirmed as a bug.

Comments

@sayJason
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

/* init */ CREATE TABLE t(c0 INT);
/* init */ INSERT IGNORE INTO t VALUES (2);

/* tx */ BEGIN;
/* tx */ DELETE FROM t WHERE TRUE;
/* tx */ UPDATE t SET c0=0 WHERE (CAST('a' AS SIGNED)); -- report an error
/* tx */ COMMIT;

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

UPDATE statement does not report error:

tidb> DELETE FROM t WHERE TRUE;
Query OK, 1 row affected (0.01 sec)

tidb> UPDATE t SET c0=0 WHERE (CAST('a' AS SIGNED));
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0  Changed: 0  Warnings: 0

3. What did you see instead (Required)

Executing UPDATE statement after the DELETE statement in tx reports an error:

tidb> UPDATE t SET c0=0 WHERE (CAST('a' AS SIGNED));
ERROR 1292 (22007): Truncated incorrect INTEGER value: 'a'

4. What is your TiDB version? (Required)

Release Version: v6.4.0
Edition: Community
Git Commit Hash: cf36a9ce2fe1039db3cf3444d51930b887df18a1
Git Branch: heads/refs/tags/v6.4.0
UTC Build Time: 2022-11-13 05:25:30
GoVersion: go1.19.2
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikv
@sayJason sayJason added the type/bug The issue is confirmed as a bug. label Dec 15, 2022
@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.0 may-affects-6.1 may-affects-6.2 may-affects-6.3 may-affects-6.4 labels Dec 18, 2022
@zanmato1984
Copy link
Contributor

It is quite argueable that if we should delay error reporting to the actual row evaluation or report it early (current behavior), so lowering the severity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.0 may-affects-6.1 may-affects-6.2 may-affects-6.3 may-affects-6.4 severity/moderate sig/execution SIG execution sig/transaction SIG:Transaction type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

4 participants