From: Date: December 9 2008 10:05am Subject: bzr commit into mysql-5.1-bugteam branch (Sergey.Glukhov:2733) Bug#40949 List-Archive: http://lists.mysql.com/commits/61010 X-Bug: 40949 Message-Id: <0KBL00LI6QKNXJ40@fe-emea-10.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT #At file:///home/gluh/MySQL/mysql-5.1-bugteam/ based on revid:alexeyk@stripped 2733 Sergey Glukhov 2008-12-09 Bug#40949 Debug version of MySQL server crashes when run OPTIMIZE on compressed table. reset diagnostics area state after error message is sent modified: mysql-test/r/myisampack.result mysql-test/t/myisampack.test sql/sql_table.cc per-file messages: mysql-test/r/myisampack.result test result mysql-test/t/myisampack.test test case sql/sql_table.cc reset diagnostics area state after error message is sent === modified file 'mysql-test/r/myisampack.result' --- a/mysql-test/r/myisampack.result 2007-11-07 08:55:28 +0000 +++ b/mysql-test/r/myisampack.result 2008-12-09 09:04:28 +0000 @@ -27,3 +27,25 @@ CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1; +drop table if exists t1; +create table t1(f1 int, f2 varchar(255)); +insert into t1 values(1, 'foo'), (2, 'bar'); +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +flush tables; +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize error Table 'test.t1' is read only +Warnings: +Error 1036 Table 't1' is read only +drop table t1; === modified file 'mysql-test/t/myisampack.test' --- a/mysql-test/t/myisampack.test 2007-11-07 08:55:28 +0000 +++ b/mysql-test/t/myisampack.test 2008-12-09 09:04:28 +0000 @@ -31,3 +31,28 @@ FLUSH TABLES; --exec $MYISAMCHK -s --unpack $MYSQLTEST_VARDIR/master-data/test/t1 CHECK TABLE t1 EXTENDED; DROP TABLE t1; + +# +# Bug#40949 Debug version of MySQL server crashes when run OPTIMIZE on compressed table. +# +--disable_warnings +drop table if exists t1; +--enable_warnings +create table t1(f1 int, f2 varchar(255)); +insert into t1 values(1, 'foo'), (2, 'bar'); +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +flush tables; +--exec $MYISAMPACK $MYSQLTEST_VARDIR/master-data/test/t1 +optimize table t1; +drop table t1; === modified file 'sql/sql_table.cc' --- a/sql/sql_table.cc 2008-11-13 13:09:22 +0000 +++ b/sql/sql_table.cc 2008-12-09 09:04:28 +0000 @@ -4319,6 +4319,7 @@ static bool mysql_admin_table(THD* thd, table->table=0; // For query cache if (protocol->write()) goto err; + thd->main_da.reset_diagnostics_area(); continue; /* purecov: end */ }