mysql - SUBSTRING_INDEX() results "omit" character when used inside LOWER() -
i found strange bug in mysql i've reported here:
can confirm me bug, , not understanding problem of how work mysql?(valeriy kravchuk: thank bug report. verified described)- what reason of bug???
- is there provide advice solve issue other described in bug report?
- and if can me install mysql udf on windows mysql 5.5.8 despites bug #45549, i'll very gratefull!
anyway, in regard of bug #42404, substring_index() seems have strange behavior.
thanks advance help!
[edit]
here, possibles solutions given me in bug report:
suggested fix:
use:
mysql> select substring_index(lower(@user_at_host), '@', -1);
instead of:
mysql> select lower(substring_index(@user_at_host, '@', -1));
avoid using of buggy function (see more 1 year old bug #42404), and:
- use preg_* udf http://www.mysqludf.org/ now,this solution unavailable on windows / mysql 5.5.8 because of 8 month old bug #45549
select substring_index(lower(@user_at_host), '@', -1);
or
select lower(substring(@user_at_host, locate('@', @user_at_host)+1));
Comments
Post a Comment