Commit b5a54e8a authored by Michael Roosz's avatar Michael Roosz Committed by Thirunarayanan B

MDEV-30321: blob data corrupted by row_merge_write_blob_to_tmp_file()

parent 65683807
...@@ -387,4 +387,19 @@ Table Op Msg_type Msg_text ...@@ -387,4 +387,19 @@ Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
DROP TABLE t1; DROP TABLE t1;
SET GLOBAL INNODB_DEFAULT_ROW_FORMAT= @format; SET GLOBAL INNODB_DEFAULT_ROW_FORMAT= @format;
#
# MDEV-30321 blob data corrupted by row_merge_write_blob_to_tmp_file()
#
CREATE TABLE t1 (
`id` int(11) NOT NULL,
`data` LONGBLOB NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
INSERT INTO t1 VALUES
(1, REPEAT('X', @@innodb_sort_buffer_size)),
(2, REPEAT('X', @@innodb_sort_buffer_size));
SELECT COUNT(*) AS nb_corrupted_rows FROM t1 WHERE data != REPEAT('X', @@innodb_sort_buffer_size);
nb_corrupted_rows
0
DROP TABLE t1;
# End of 10.7 tests # End of 10.7 tests
...@@ -405,4 +405,21 @@ CHECK TABLE t1; ...@@ -405,4 +405,21 @@ CHECK TABLE t1;
DROP TABLE t1; DROP TABLE t1;
SET GLOBAL INNODB_DEFAULT_ROW_FORMAT= @format; SET GLOBAL INNODB_DEFAULT_ROW_FORMAT= @format;
--echo #
--echo # MDEV-30321 blob data corrupted by row_merge_write_blob_to_tmp_file()
--echo #
CREATE TABLE t1 (
`id` int(11) NOT NULL,
`data` LONGBLOB NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
INSERT INTO t1 VALUES
(1, REPEAT('X', @@innodb_sort_buffer_size)),
(2, REPEAT('X', @@innodb_sort_buffer_size));
SELECT COUNT(*) AS nb_corrupted_rows FROM t1 WHERE data != REPEAT('X', @@innodb_sort_buffer_size);
DROP TABLE t1;
--echo # End of 10.7 tests --echo # End of 10.7 tests
...@@ -1066,7 +1066,7 @@ static dberr_t row_merge_write_blob_to_tmp_file( ...@@ -1066,7 +1066,7 @@ static dberr_t row_merge_write_blob_to_tmp_file(
uint32_t len= field->len; uint32_t len= field->len;
dberr_t err= os_file_write( dberr_t err= os_file_write(
IORequestWrite, "(bulk insert)", blob_file->fd, IORequestWrite, "(bulk insert)", blob_file->fd,
field->data, blob_file->offset * srv_page_size, len); field->data, blob_file->offset, len);
if (err != DB_SUCCESS) if (err != DB_SUCCESS)
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment