diff options
author | Alexander Barkov <alexander.barkov@oracle.com> | 2011-01-17 12:30:22 +0300 |
---|---|---|
committer | Alexander Barkov <alexander.barkov@oracle.com> | 2011-01-17 12:30:22 +0300 |
commit | a2850a2f5323bfe8eaae17746c88986cee37fc76 (patch) | |
tree | 22beb449e4485929acdf9f6b9cbfa2b94cfe1005 /mysql-test/t/func_like.test | |
parent | 208b677637ef9d140c1629a0de4d4963c02ea533 (diff) | |
download | mariadb-git-a2850a2f5323bfe8eaae17746c88986cee37fc76.tar.gz |
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.
Diffstat (limited to 'mysql-test/t/func_like.test')
-rw-r--r-- | mysql-test/t/func_like.test | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mysql-test/t/func_like.test b/mysql-test/t/func_like.test index 1204d04d9a0..f1fe52274b2 100644 --- a/mysql-test/t/func_like.test +++ b/mysql-test/t/func_like.test @@ -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 |