开发者

SUBSTRING_INDEX() results "omit" character when used inside LOWER()

I found a very strange bug in MySQL that i've reported here:

Bug #60166

  • Can anyone confirm to me that this is a bug, and not an unde开发者_如何学JAVArstanding problem of how work MySQL? (Valeriy Kravchuk: Thank you for the bug report. Verified just as described)
  • What is the reason of this bug???
  • Is there anybody to provide some advice to solve this issue other than that I described in the bug report?
  • And if somebody can help me to install MySQL UDF on Windows with MySQL 5.5.8 despites the Bug #45549, I'll will be very gratefull!

Anyway, in regard of the Bug #42404, SUBSTRING_INDEX() seems to have a very strange behavior.

Thanks by advance for any help!

[EDIT]

Here, the possibles solutions already given by me in the 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 this buggy function (see the more than one year old bug #42404), and:

    • Use preg_* UDF from http://www.mysqludf.org/ But for now,This solution is unavailable on Windows / Mysql 5.5.8 because of the 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));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜