1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-29753 An error is wrongly reported during INSERT with vcol index

See also commits aa8a31da and 64678c for a Bug #22990029 fix.

In this scenario INSERT chose to check if delete unmarking is available for
a just deleted record. To build an update vector, it needed to calculate
the vcols as well. Since this INSERT was not IGNORE-flagged, recalculation
failed.

Solutiuon: temporarily set abort_on_warning=true, while calculating the
column for delete-unmarked insert.
This commit is contained in:
Nikita Malyavin
2022-10-10 19:41:09 +03:00
parent 3cd2c1e8b6
commit 128356b4b1
7 changed files with 75 additions and 9 deletions

View File

@@ -249,12 +249,15 @@ ENGINE=InnoDB;
INSERT IGNORE INTO t1 (a,b) VALUES(1,20190132);
Warnings:
Warning 1265 Data truncated for column 'vb' at row 1
SELECT * FROM t1;
a b vb
1 20190132 0000-00-00
BEGIN;
DELETE FROM t1;
INSERT INTO t1 (a,b) VALUES(1,20190123);
ERROR 22007: Incorrect date value: '20190132' for column `test`.`t1`.`vb` at row 1
SELECT * FROM t1;
a b vb
1 20190123 2019-01-23
ROLLBACK;
SELECT * FROM t1;
a b vb
@@ -340,4 +343,33 @@ Warnings:
Warning 1365 Division by 0
disconnect stop_purge;
DROP TABLE t, t_odd;
#
# MDEV-29753 An error is wrongly reported during INSERT with vcol index
# See also Bug #22990029
#
CREATE TABLE t(pk INT PRIMARY KEY,
fld1 INT NOT NULL,
fld2 INT AS (100/fld1) VIRTUAL,
KEY(fld1), KEY(fld2));
INSERT IGNORE t(pk, fld1) VALUES(1, 0);
Warnings:
Warning 1365 Division by 0
SELECT * FROM t;
pk fld1 fld2
1 0 NULL
Warnings:
Warning 1365 Division by 0
BEGIN;
DELETE FROM t;
Warnings:
Warning 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
INSERT INTO t (pk, fld1) VALUES(1,1);
SELECT * FROM t;
pk fld1 fld2
1 1 100
# Cleanup
ROLLBACK;
DROP TABLE t;
# End of 10.3 tests