From: Alexander Barkov Date: January 17 2011 9:31am Subject: bzr push into mysql-5.1 branch (alexander.barkov:3555 to 3556) Bug#59149 List-Archive: http://lists.mysql.com/commits/128913 X-Bug: 59149 Message-Id: <201101170931.p0H9VlFs002688@bar.myoffice.izhnet.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3556 Alexander Barkov 2011-01-17 Bug#59149 valgrind warnings with "like .. escape .." function Problem: when processing a query like: SELECT '' LIKE '1' ESCAPE COUNT(1); escape_item->val_str() was never executed and the "escape" class member stayed initialized, which led to valgrind uninitialized memory error. Note, a query with some tables in "FROM" clause returns ER_WRONG_ARGUMENTS in the same situation: SELECT '' LIKE '1' ESCAPE COUNT(1) FROM t1; ERROR 1210 (HY000): Incorrect arguments to ESCAPE Fix: disallowing using aggregate functions in ESCAPE clause, even if there are no tables used. There is no much use of that anyway. modified: mysql-test/r/func_like.result mysql-test/t/func_like.test sql/item_sum.h 3555 Nirbhay Choubey 2011-01-16 Bug#58221 : mysqladmin --sleep=x --count=x keeps looping When mysqldadmin is run with sleep and count options, it goes into an infinite loop and keeps executing the specified command. This happened because the statement, responsible for decrementing the count value, was missing. Fixed by adding a statement which will decrement the count value for each iteration. @ client/mysqladmin.cc Bug#58221 : mysqladmin --sleep=x --count=x keeps looping Added a condition to check and decrement the count value stored in nr_iterations per iteration. @ mysql-test/r/mysqladmin.result Added a testcase for Bug#58221. @ mysql-test/t/mysqladmin.test Added a testcase for Bug#58221. modified: client/mysqladmin.cc mysql-test/r/mysqladmin.result mysql-test/t/mysqladmin.test === modified file 'mysql-test/r/func_like.result' --- a/mysql-test/r/func_like.result 2010-11-08 10:55:43 +0000 +++ b/mysql-test/r/func_like.result 2011-01-17 09:30:22 +0000 @@ -182,4 +182,9 @@ INSERT INTO t2 VALUES (1), (2), (3); SELECT 1 FROM t2 JOIN t1 ON 1 LIKE a GROUP BY a; 1 DROP TABLE t1, t2; +# +# Bug#59149 valgrind warnings with "like .. escape .." function +# +SELECT '' LIKE '1' ESCAPE COUNT(1); +ERROR HY000: Incorrect arguments to ESCAPE End of 5.1 tests === modified file 'mysql-test/t/func_like.test' --- a/mysql-test/t/func_like.test 2010-11-08 10:55:43 +0000 +++ b/mysql-test/t/func_like.test 2011-01-17 09:30:22 +0000 @@ -126,5 +126,10 @@ INSERT INTO t2 VALUES (1), (2), (3); SELECT 1 FROM t2 JOIN t1 ON 1 LIKE a GROUP BY a; DROP TABLE t1, t2; +--echo # +--echo # Bug#59149 valgrind warnings with "like .. escape .." function +--echo # +--error ER_WRONG_ARGUMENTS +SELECT '' LIKE '1' ESCAPE COUNT(1); --echo End of 5.1 tests === modified file 'sql/item_sum.h' --- a/sql/item_sum.h 2010-12-21 11:34:11 +0000 +++ b/sql/item_sum.h 2011-01-17 09:30:22 +0000 @@ -339,6 +339,7 @@ public: forced_const= TRUE; } virtual bool const_item() const { return forced_const; } + virtual bool const_during_execution() const { return false; } virtual void print(String *str, enum_query_type query_type); void fix_num_length_and_dec(); No bundle (reason: useless for push emails).