From: Sergey Glukhov Date: March 28 2011 8:11am Subject: bzr push into mysql-5.1 branch (sergey.glukhov:3630 to 3631) Bug#11766112 List-Archive: http://lists.mysql.com/commits/133972 X-Bug: 11766112 Message-Id: <201103280813.p2S8DwNG029517@acsmt358.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3631 Sergey Glukhov 2011-03-28 Bug#11766112 59151:UNINITIALIZED VALUES IN EXTRACT_DATE_TIME WITH STR_TO_DATE(SPACE(..) ... Valgrind warining happens due to missing 'end of the string' check. The fix is to check if we reached the end of the string. @ mysql-test/r/func_time.result test case @ mysql-test/t/func_time.test test case @ sql/item_timefunc.cc check if we reached the end of the string after leading spaces skipping. modified: mysql-test/r/func_time.result mysql-test/t/func_time.test sql/item_timefunc.cc 3630 Sven Sandberg 2011-03-25 BUG#11766427, BUG#59539: Filter by server id in mysqlbinlog fails Problem: mysqlbinlog --server-id may filter out Format_description_log_events. If mysqlbinlog does not process the Format_description_log_event, then mysqlbinlog cannot read the rest of the binary log correctly. This can have the effect that mysqlbinlog crashes, generates an error, or generates output that causes mysqld to crash, generate an error, or corrupt data. Fix: Never filter out Format_description_log_events. Also, never filter out Rotate_log_events. @ client/mysqlbinlog.cc Process Format_description_log_events even when the server_id does not match the number given by --server-id. @ mysql-test/t/mysqlbinlog.test Add test case. modified: client/mysqlbinlog.cc mysql-test/r/mysqlbinlog.result mysql-test/t/mysqlbinlog.test === modified file 'mysql-test/r/func_time.result' --- a/mysql-test/r/func_time.result 2011-02-02 18:13:11 +0000 +++ b/mysql-test/r/func_time.result 2011-03-28 07:53:18 +0000 @@ -1375,4 +1375,10 @@ Warning 1292 Truncated incorrect time va Warning 1292 Truncated incorrect time value: '' Warning 1292 Truncated incorrect time value: '' DROP TABLE t1; +# +# Bug#11766112 59151:UNINITIALIZED VALUES IN EXTRACT_DATE_TIME WITH STR_TO_DATE(SPACE(..) ... +# +SELECT STR_TO_DATE(SPACE(2),'1'); +STR_TO_DATE(SPACE(2),'1') +0000-00-00 End of 5.1 tests === modified file 'mysql-test/t/func_time.test' --- a/mysql-test/t/func_time.test 2011-02-02 18:13:11 +0000 +++ b/mysql-test/t/func_time.test 2011-03-28 07:53:18 +0000 @@ -881,4 +881,10 @@ INSERT INTO t1 VALUES (''),(''); SELECT COUNT(*) FROM t1 GROUP BY TIME_TO_SEC(a); DROP TABLE t1; +--echo # +--echo # Bug#11766112 59151:UNINITIALIZED VALUES IN EXTRACT_DATE_TIME WITH STR_TO_DATE(SPACE(..) ... +--echo # + +SELECT STR_TO_DATE(SPACE(2),'1'); + --echo End of 5.1 tests === modified file 'sql/item_timefunc.cc' --- a/sql/item_timefunc.cc 2010-11-12 10:12:15 +0000 +++ b/sql/item_timefunc.cc 2011-03-28 07:53:18 +0000 @@ -294,8 +294,8 @@ static bool extract_date_time(DATE_TIME_ for (; ptr != end && val != val_end; ptr++) { /* Skip pre-space between each argument */ - while (val != val_end && my_isspace(cs, *val)) - val++; + if ((val+= cs->cset->scan(cs, val, val_end, MY_SEQ_SPACES)) >= val_end) + break; if (*ptr == '%' && ptr+1 != end) { No bundle (reason: useless for push emails).