Tikv inconsistent warning code and message with tidb
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
```
**Case1**
set tidb_opt_projection_push_down = 'on';
CREATE TABLE t1(a CHAR(1) CHARACTER SET utf8mb4);
INSERT INTO t1 VALUES('a');
SELECT CONCAT(a, x'ff') FROM t1;
--Expect
Error 3854 (HY000): Cannot convert string '\xFF' from binary to utf8mb4
--Actual
Error 1105 (HY000): Cannot convert string '\xFF' from binary to utf8mb4
**Case2**
set tidb_opt_projection_push_down = 'on';
CREATE TABLE t1(f1 LONGTEXT CHARACTER SET utf8mb4);
INSERT INTO t1 VALUES ('a');
SELECT @a:= CAST(f1 AS SIGNED) FROM t1
UNION ALL
SELECT CAST(f1 AS SIGNED) FROM t1;
--Expect
@a:= CAST(f1 AS SIGNED)
0
0
Level Code Message
Warning 1292 Truncated incorrect INTEGER value: 'a'
Warning 1292 Truncated incorrect INTEGER value: 'a'
--Actual
@a:= CAST(f1 AS SIGNED)
0
0
Level Code Message
Warning 1292 Truncated incorrect INTEGER value: 'a'
Warning 1292 evaluation failed: Truncated incorrect INTEGER value: 'a'```
### 1. What is your TiDB version? (Required)
| Release Version: v7.4.0-alpha-2012-gfe01d11df6-dirty
Edition: Community
Git Commit Hash: https://github.com/pingcap/tidb/commit/fe01d11df67ca60573b028ed4c9bc52db9a17a7e
Git Branch: div_increase_prec
UTC Build Time: 2024-03-15 08:10:07
Contributor guide
Assessment
This issue has not been assessed yet.