Commit 99369b10 authored by Sergey Glukhov's avatar Sergey Glukhov

fixed archive test. It might be OOM error on boxes with low amount of memory.

It leads to crash because there is no OOM check in ha_archive::unpack_row().
The fix:
added OOM error check
parent eecf7e84
...@@ -12695,22 +12695,3 @@ a b ...@@ -12695,22 +12695,3 @@ a b
1 NULL 1 NULL
2 NULL 2 NULL
DROP TABLE t1; DROP TABLE t1;
#
# BUG#32880 - Repairing Archive table fails with internal error 144
#
# Test with an existing table which is corrupted
# Copy t1 from std_data
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` blob
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check error Corrupt
REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair error Corrupt
DROP TABLE t1;
This diff was suppressed by a .gitattributes entry.
...@@ -1599,18 +1599,3 @@ INSERT INTO t1 VALUES (NULL, NULL),(NULL, NULL); ...@@ -1599,18 +1599,3 @@ INSERT INTO t1 VALUES (NULL, NULL),(NULL, NULL);
FLUSH TABLE t1; FLUSH TABLE t1;
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # BUG#32880 - Repairing Archive table fails with internal error 144
--echo #
--echo
--echo # Test with an existing table which is corrupted
--echo # Copy t1 from std_data
let $MYSQLD_DATADIR= `select @@datadir`;
copy_file std_data/bug32880.frm $MYSQLD_DATADIR/test/t1.frm;
copy_file std_data/bug32880.ARZ $MYSQLD_DATADIR/test/t1.ARZ;
copy_file std_data/bug32880.ARN $MYSQLD_DATADIR/test/t1.ARN;
SHOW CREATE TABLE t1;
CHECK TABLE t1;
REPAIR TABLE t1;
DROP TABLE t1;
...@@ -1071,7 +1071,11 @@ int ha_archive::unpack_row(azio_stream *file_to_read, uchar *record) ...@@ -1071,7 +1071,11 @@ int ha_archive::unpack_row(azio_stream *file_to_read, uchar *record)
row_len= uint4korr(size_buffer); row_len= uint4korr(size_buffer);
DBUG_PRINT("ha_archive",("Unpack row length %u -> %u", row_len, DBUG_PRINT("ha_archive",("Unpack row length %u -> %u", row_len,
(unsigned int)table->s->reclength)); (unsigned int)table->s->reclength));
fix_rec_buff(row_len);
if (fix_rec_buff(row_len))
{
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
}
DBUG_ASSERT(row_len <= record_buffer->length); DBUG_ASSERT(row_len <= record_buffer->length);
read= azread(file_to_read, record_buffer->buffer, row_len, &error); read= azread(file_to_read, record_buffer->buffer, row_len, &error);
......
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