pingcap/tidb
GitHub で見る"show warnings" result of decimal truncate differ to mysql
Open
#6,609 opened on 2018年5月22日
help wantedpriority/P4type/compatibility
説明
- What did you do? If possible, provide a recipe for reproducing the error.
SET SQL_WARNINGS=1;
SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
CREATE TABLE `t1` (
`a` decimal(10,2) DEFAULT NULL
);
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
show warnings;
- What did you expect to see? like mysql
mysql> show warnings;
+---------+------+--------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------+
| Warning | 1264 | Out of range value for column 'a' at row 1 |
| Warning | 1264 | Out of range value for column 'a' at row 2 |
+---------+------+--------------------------------------------+
2 rows in set (0.00 sec)
- What did you see instead?
mysql> show warnings;
+---------+------+--------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------+
| Warning | 1690 | DECIMAL value is out of range in '(10, 2)' |
| Warning | 1690 | DECIMAL value is out of range in '(10, 2)' |
+---------+------+--------------------------------------------+
2 rows in set (0.00 sec)
- What version of TiDB are you using (
tidb-server -Vor runselect tidb_version();on TiDB)?
Release Version: v2.0.0-rc.4-215-gc3b006e4-dirty
Git Commit Hash: c3b006e4a4e64042d400909382861a5fd23d029c
Git Branch: dev/time-compare-tz-aware
UTC Build Time: 2018-05-22 02:11:55
GoVersion: go version go1.10.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.0.0-rc.4.1