mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
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.
11 lines
265 B
Plaintext
11 lines
265 B
Plaintext
--source include/have_archive.inc
|
|
CREATE TABLE t1(
|
|
t TEXT NULL DEFAULT NULL
|
|
) COLLATE='utf8_general_ci' ENGINE=archive;
|
|
INSERT INTO t1(t) VALUES ('Testtext');
|
|
REPAIR TABLE t1;
|
|
SELECT t = 'Testtext' as Expect_1 from t1;
|
|
DROP TABLE t1;
|
|
|
|
--echo # End of 10.6 tests
|