From: Date: August 15 2008 8:13am Subject: bzr push into mysql-5.1-bugteam branch (ramil:2698 to 2700) Bug#37537, Bug#37337 List-Archive: http://lists.mysql.com/commits/51695 X-Bug: 37537 Message-Id: <200808150613.m7F6DOXe005623@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 2700 Ramil Kalimullin 2008-08-15 Fix for bug#37537: myisamchk fails with Assertion failure with partitioned table Problem: missed "break" in a switch leads to unexpected assertion failure of 'myisamchk compressed_table'. Fix: add the break. modified: storage/myisam/mi_check.c 2699 Ramil Kalimullin 2008-08-15 Fix for bug#37337: Function returns different results Problem: REGEXP in functions/PSs may return wrong results due to improper initialization. Fix: initialize required REGEXP params. modified: mysql-test/r/func_regexp.result mysql-test/t/func_regexp.test sql/item_cmpfunc.cc 2698 Matthias Leich 2008-08-13 [merge] Merge modified: libmysqld/lib_sql.cc === modified file 'mysql-test/r/func_regexp.result' --- a/mysql-test/r/func_regexp.result 2008-02-12 19:09:16 +0000 +++ b/mysql-test/r/func_regexp.result 2008-08-15 05:53:25 +0000 @@ -115,3 +115,21 @@ SELECT 1 REGEXP NULL; 1 REGEXP NULL NULL End of 5.0 tests +CREATE TABLE t1(a INT, b CHAR(4)); +INSERT INTO t1 VALUES (1, '6.1'), (1, '7.0'), (1, '8.0'); +PREPARE stmt1 FROM "SELECT a FROM t1 WHERE a=1 AND '7.0' REGEXP b LIMIT 1"; +EXECUTE stmt1; +a +1 +EXECUTE stmt1; +a +1 +EXECUTE stmt1; +a +1 +EXECUTE stmt1; +a +1 +DEALLOCATE PREPARE stmt1; +DROP TABLE t1; +End of 5.1 tests === modified file 'mysql-test/t/func_regexp.test' --- a/mysql-test/t/func_regexp.test 2007-11-06 12:03:58 +0000 +++ b/mysql-test/t/func_regexp.test 2008-08-15 05:53:25 +0000 @@ -65,3 +65,20 @@ drop table t1; SELECT 1 REGEXP NULL; --echo End of 5.0 tests + + +# +# Bug #37337: Function returns different results +# +CREATE TABLE t1(a INT, b CHAR(4)); +INSERT INTO t1 VALUES (1, '6.1'), (1, '7.0'), (1, '8.0'); +PREPARE stmt1 FROM "SELECT a FROM t1 WHERE a=1 AND '7.0' REGEXP b LIMIT 1"; +EXECUTE stmt1; +EXECUTE stmt1; +EXECUTE stmt1; +EXECUTE stmt1; +DEALLOCATE PREPARE stmt1; +DROP TABLE t1; + + +--echo End of 5.1 tests === modified file 'sql/item_cmpfunc.cc' --- a/sql/item_cmpfunc.cc 2008-07-31 09:50:24 +0000 +++ b/sql/item_cmpfunc.cc 2008-08-15 05:53:25 +0000 @@ -4592,6 +4592,7 @@ void Item_func_regex::cleanup() { my_regfree(&preg); regex_compiled=0; + prev_regexp.length(0); } DBUG_VOID_RETURN; } === modified file 'storage/myisam/mi_check.c' --- a/storage/myisam/mi_check.c 2008-08-11 18:02:03 +0000 +++ b/storage/myisam/mi_check.c 2008-08-15 05:55:20 +0000 @@ -1211,6 +1211,7 @@ int chk_data_link(MI_CHECK *param, MI_IN param->glob_crc+= mi_checksum(info,record); link_used+= (block_info.filepos - start_recpos); used+= (pos-start_recpos); + break; case BLOCK_RECORD: assert(0); /* Impossible */ } /* switch */