diff options
author | unknown <jimw@mysql.com> | 2005-11-23 16:49:07 -0800 |
---|---|---|
committer | unknown <jimw@mysql.com> | 2005-11-23 16:49:07 -0800 |
commit | 046f82e3a52e212cb50f3d32497030fe317d9b25 (patch) | |
tree | e6983101192aea260faa9fcefcfd33221f07b792 /mysql-test/t/func_str.test | |
parent | 2474fcc1c7420a321bae9660fb9e9c7c8c0e9733 (diff) | |
download | mariadb-git-046f82e3a52e212cb50f3d32497030fe317d9b25.tar.gz |
Fix possible corruption of results from SUBSTRING_INDEX(). (Bug #14676)
mysql-test/r/func_str.result:
Add new results
mysql-test/t/func_str.test:
Add new test
sql/item_strfunc.cc:
Mark tmp_value in Item_func_substr_index as const so that we don't
overwrite the contents of another String when getting the delimiter.
Fix typo in variable names (delimeter -> delimiter).
Diffstat (limited to 'mysql-test/t/func_str.test')
-rw-r--r-- | mysql-test/t/func_str.test | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index ac2bf820257..ef20d766bce 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -676,4 +676,12 @@ insert into t1 values (null); select format(d, 2) from t1; drop table t1; +# +# Bug #14676: substring_index() returns incorrect results +# +create table t1 (c varchar(40)); +insert into t1 values ('y,abc'),('y,abc'); +select c, substring_index(lcase(c), @q:=',', -1) as res from t1; +drop table t1; + # End of 5.0 tests |