From d9a9f5c71f4da5ea44d1b4fc3cf22c9ab52b6d5f Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Thu, 26 Mar 2009 18:27:34 +0400 Subject: [PATCH] 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 mysql-test/r/archive.result: remover test case mysql-test/std_data/bug32880.ARN: remover test case mysql-test/std_data/bug32880.ARZ: remover test case mysql-test/std_data/bug32880.frm: remover test case mysql-test/t/archive.test: remover test case --- mysql-test/r/archive.result | 19 ------------------- mysql-test/std_data/bug32880.ARN | Bin 131 -> 0 bytes mysql-test/std_data/bug32880.ARZ | Bin 8744 -> 0 bytes mysql-test/std_data/bug32880.frm | Bin 8578 -> 0 bytes mysql-test/t/archive.test | 15 --------------- storage/archive/ha_archive.cc | 6 +++++- 6 files changed, 5 insertions(+), 35 deletions(-) delete mode 100644 mysql-test/std_data/bug32880.ARN delete mode 100644 mysql-test/std_data/bug32880.ARZ delete mode 100644 mysql-test/std_data/bug32880.frm diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result index 02acccb234e..8c26ea1ff82 100644 --- a/mysql-test/r/archive.result +++ b/mysql-test/r/archive.result @@ -12695,22 +12695,3 @@ a b 1 NULL 2 NULL 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; diff --git a/mysql-test/std_data/bug32880.ARN b/mysql-test/std_data/bug32880.ARN deleted file mode 100644 index 643b0dfbad59af05495571978acc8b5eeaf8b509..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 131 zcmeyz%qYO%$AAi8dqei4wVSWE@5vi;Yx=ZHHrNyljV=3 gvkA%YRCc;{PVKA|P+c6Av6_|P_LJg8GZ+~d03i_-e*gdg diff --git a/mysql-test/std_data/bug32880.ARZ b/mysql-test/std_data/bug32880.ARZ deleted file mode 100644 index 4e151822647f1b7e0f3f2b9952ef543f9a7954ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8744 zcmeI&ze>YE90%}kE^WOwLQ_+U|G-v?pi7-QR7DDkP{ct*5RxuFL%>0bOI#ep7w|I1m=0(}aH((^7}($&Gi!uKHg{qC2`-SL@!GuQDk05EFlmmMEA5AD2YV{h9gHUv8Q z`pMQ~=9GO`*BoHqe5%gZ3yCt2?j*CS`S)`S)UraS12nSrP z3Q&Lo|5iXi<#(HBwzPz!i{q2i%YMFu2?Z!X0SZun0u-PC1t>rP3Q&Lo3nnmf(tdyi zyY=5)*MUG6rY)k1Qoiju8oF*q7p@TX-R3U`3J{U*nGi!1gy)$}HtzK{uI`{H3MtJQ zwTC(|Jpfdsh6=j-!j4H4hF@dZzFK<>&h~=%@NQ@It^K_9ep_1ET#l1|@{+`fS*+Bg Wb>pSU>r>;WvOc)BNhQ>$RK5X*A2h-M diff --git a/mysql-test/std_data/bug32880.frm b/mysql-test/std_data/bug32880.frm deleted file mode 100644 index 66a4c7d7538ef06353e4b38b8699203736844857..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8578 zcmeI&u?oU45C-5s*H%+Hw8i4$($%TXT|`9CO&r|YClT?@dj)_ z@U6LrNs9<546x7zIYNj<3M77Shhm}0?Fy7bp=p46*l?u)1t>rP3Q&Lo6rcbFC_n)U zP~d9?1TMVooxMt9tPbn#?zjm@m{5QM6rcbFC_n)UP=Epypa2CZ@M8jJqo4kN90r0G z6BWoY3J!ZrweF)uBvQ@m4+Alz)0qkB5lfc&CbN^aiFAS@5o`S&<)s4dOTcxmcX$FK Cm=+HJ diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index 0d521f95b38..7139d95ab49 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1599,18 +1599,3 @@ INSERT INTO t1 VALUES (NULL, NULL),(NULL, NULL); FLUSH TABLE t1; SELECT * FROM t1 ORDER BY a; 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; diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index d20ab3bf723..5e2a4ad5da3 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -1071,7 +1071,11 @@ int ha_archive::unpack_row(azio_stream *file_to_read, uchar *record) row_len= uint4korr(size_buffer); DBUG_PRINT("ha_archive",("Unpack row length %u -> %u", row_len, (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); read= azread(file_to_read, record_buffer->buffer, row_len, &error);