mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-30985 Replica stops with error on ALTER ONLINE with Geometry Types
The bug is inherent for row-based replication as well. To reproduce, a virtual (not stored) field of a blob type computed from another field of a different blob type is required. The following happens during an update or delete row event: 1. A row is unpacked. 2. Virtual fields are updated. Field b1 stores the pointer in Field_blob::value and references it in table->record[0]. 3. record[0] is stored to record[1] in Rows_log_event::find_row. 4. A new record is fetched from handler. (e.g. ha_rnd_next) 5. Virtual columns are updated (only non-stored). 6. Field b1 receives new value. Old value is deallocated (Field_blob::val_str). 7. record_compare is called. record[0] and record[1] are compared. 8. record[1] contains a reference to a freed value. record_compare is used in replication to find a matching record for update or delete. Virtual columns that are not stored should be definitely skipped both for correctness, and for this bug fix. STORED virtual columns, on the other hand, may be required and shouldn't be skipped. Stored columns are not affected, since they are not updated after handler's fetch.
This commit is contained in:
committed by
Sergei Golubchik
parent
3ad0e7edd1
commit
5f206259e5
@ -160,4 +160,19 @@ connection master;
|
||||
DROP TABLE IF EXISTS test.t1;
|
||||
DROP TABLE IF EXISTS test.t2;
|
||||
connection slave;
|
||||
#
|
||||
# MDEV-30985 Replica stops with error on ALTER ONLINE with Geometry Types
|
||||
#
|
||||
connection master;
|
||||
CREATE TABLE t(txt TEXT DEFAULT '111111111', blb LONGBLOB AS (txt));
|
||||
INSERT INTO t () VALUES (),(),();
|
||||
DELETE FROM t;
|
||||
DROP TABLE t;
|
||||
connection slave;
|
||||
connection master;
|
||||
CREATE TABLE t(txt TEXT DEFAULT '111111111', blb LONGBLOB AS (txt) STORED);
|
||||
INSERT INTO t () VALUES (),(),();
|
||||
DELETE FROM t;
|
||||
DROP TABLE t;
|
||||
connection slave;
|
||||
include/rpl_end.inc
|
||||
|
Reference in New Issue
Block a user