1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00
Files
mariadb/mysql-test/suite/archive/repair_text.result
Vladislav Vaintroub 228e5b506b MDEV-24245 REPAIR/OPTIMIZE on ARCHIVE table corrupts blob/text data
pack_row() and unpack_row() both used record_buffer. After unpack_row(),
blob field pointers in record[0] reference data stored in record_buffer.
When pack_row() then writes the new packed row into the same record_buffer,
it overwrites the blob data that those pointers still reference. Subsequent
Field_blob::pack() calls follow the stale pointers and read corrupted data.

This only matters in the optimize/repair loop where the same handler reads
then writes each row. Normal INSERT has no prior unpack_row() on the same
handler.

Fix: in the optimize loop, before writing, copy blob data out of
record_buffer (the same approach already used by get_row_version2),so that
blob pointers no longer reference record_buffer when pack_row() overwrites it.

Free the temporary blob buffer after the loop.
2026-07-24 11:22:12 +02:00

13 lines
284 B
Plaintext

CREATE TABLE t1(
t TEXT NULL DEFAULT NULL
) COLLATE='utf8_general_ci' ENGINE=archive;
INSERT INTO t1(t) VALUES ('Testtext');
REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair status OK
SELECT t = 'Testtext' as Expect_1 from t1;
Expect_1
1
DROP TABLE t1;
# End of 10.6 tests