Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
CREATE TABLE t1(a INT PRIMARY KEY, b INT, vb DATE AS(b) VIRTUAL, KEY(vb)) |
ENGINE=InnoDB;
|
INSERT IGNORE INTO t1 (a,b) VALUES(1,20190132); |
BEGIN; |
DELETE FROM t1; |
# error ER_TRUNCATED_WRONG_VALUE Is wrongly reported here |
INSERT INTO t1 (a,b) VALUES(1,20190123); |
SELECT * FROM t1; |
ROLLBACK; |
SELECT * FROM t1; |
CHECK TABLE t1; |
DROP TABLE t1; |
The expected behavior is a succeeded insert.
See commits aa8a31da (Bug #22990029 GCOLS: INCORRECT BEHAVIOR AFTER DATA INSERTED WITH IGNORE KEYWORD) and 64678c (Bug #22990029: Add a test case).
That fix is better than incorrect behavior, but the expected behavior is to make an insert.
The insert is truing to delete-unmark the record and for that it needed to recompute the value for the deleted record, which was inserted with IGNORE flag. The correct way would be to set the correcvt sql_mode and thd->abort_on_warning values for that recomputation, so that it always succeeds.
See also MDEV-29299 where the case can be also affected
Attachments
Issue Links
- is part of
-
MDEV-29299 SELECT from table with vcol index reports warning
- Closed