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

MDEV-24583 SELECT aborts after failed REPLACE into table with vcol

table->move_fields wasn't undone in case of error.

1. move_fields is unconditionally undone even when error is occurred
2. cherry-pick an assertion in `ptr_in_record`, which is already in 10.5
This commit is contained in:
Nikita Malyavin
2021-03-24 01:02:26 +03:00
parent f85afa5124
commit 43e879c717
6 changed files with 191 additions and 4 deletions

View File

@@ -67,4 +67,17 @@ connection master;
DROP VIEW v1;
set @@binlog_row_image=default;
DROP TABLE t1;
SET SQL_MODE=default;
CREATE TABLE t1 (pk INT, a VARCHAR(3), b VARCHAR(1) AS (a) VIRTUAL, PRIMARY KEY (pk));
INSERT IGNORE INTO t1 (pk, a) VALUES (1,'foo'),(2,'bar');
Warnings:
Warning 1265 Data truncated for column 'b' at row 1
Warning 1265 Data truncated for column 'b' at row 2
REPLACE INTO t1 (pk) VALUES (2);
ERROR 22001: Data too long for column 'b' at row 1
UPDATE IGNORE t1 SET a = NULL;
Warnings:
Warning 1265 Data truncated for column 'b' at row 1
Warning 1265 Data truncated for column 'b' at row 2
DROP TABLE t1;
include/rpl_end.inc