diff options
author | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2009-04-23 12:43:42 +0500 |
---|---|---|
committer | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2009-04-23 12:43:42 +0500 |
commit | 5f9e40a5f8a469d87fb41002c18f3a41e9c4d6b3 (patch) | |
tree | 298f925620b41190de3964ef5aeb3d4c2359c97c /mysql-test/t/func_str.test | |
parent | e0526914b6acb91f8cf15bd536ad40e226158d1b (diff) | |
download | mariadb-git-5f9e40a5f8a469d87fb41002c18f3a41e9c4d6b3.tar.gz |
Bug#44358 valgrind errors with decode() function
The warning happens because string argument is not zero ended.
The fix is to add new parameter 'length' to SQL_CRYPT() and
use ptr() instead of c_ptr().
mysql-test/r/func_str.result:
test result
mysql-test/t/func_str.test:
test case
sql/item_strfunc.cc:
Added new parameter 'length' to SQL_CRYPT
sql/sql_crypt.cc:
Added new parameter 'length' to SQL_CRYPT
sql/sql_crypt.h:
Added new parameter 'length' to SQL_CRYPT
Diffstat (limited to 'mysql-test/t/func_str.test')
-rw-r--r-- | mysql-test/t/func_str.test | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index b71dbe91467..ef406d2aeca 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1283,3 +1283,15 @@ SELECT DATE_FORMAT(c, GET_FORMAT(DATE, 'eur')) h, CONCAT(UPPER(aa),', ', aa) i F DROP TABLE t1; --echo End of 5.0 tests + +# +# Bug#44358 valgrind errors with decode() function +# +--disable_warnings +drop table if exists t1; +--enable_warnings +create table t1(f1 tinyint default null)engine=myisam; +insert into t1 values (-1),(null); +explain select 1 as a from t1,(select decode(f1,f1) as b from t1) a; +explain select 1 as a from t1,(select encode(f1,f1) as b from t1) a; +drop table t1; |