[MDEV-13981] Implement SQL2014 compliant LIKE (utf8mb4_unicode_ci produces different result '=' vs. LIKE) Created: 2017-10-02 Updated: 2017-10-02 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Character Sets |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Roman Stingler (Inactive) | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
the problem is that the mentiond collation doesn't return the expected result in the LIKE query
it just happens with the ß character, other umlauts are fine
Also the expected behaviour on the general collation is fine
|
| Comments |
| Comment by Alexander Barkov [ 2017-10-02 ] | |||
|
This is not a bug. This implementation is intentional. This is a quote from SQL2011, section <like predicate>:
This clearly states that comparison is done one-character-to-one-character.
can never return true. However, I just noticed that in the latest Standard version (SQL2014), this section was changed to:
So since SQL2014, it's supposed to return true for:
But still:
is supposed to return false. Looks weird for me. | |||
| Comment by Axel Schwenke [ 2017-10-02 ] | |||
|
Notice that the MySQL manual has an example just like the above to demonstrate that LIKE and operator == may return different results under certain circumstances. | |||
| Comment by Roman Stingler (Inactive) [ 2017-10-02 ] | |||
|
Programmers should ask themselves if it an expected behaviour. Firstly I have a collation which treats ß like ss, but only in certain circumstances and only in a specific way and ...... | |||
| Comment by Alexander Barkov [ 2017-10-02 ] | |||
|
Sorry, I misread the quote from SQL2014. It actually says that both:
are true. | |||
| Comment by Alexander Barkov [ 2017-10-02 ] | |||
|
Sounds like a reasonable feature request: implement SQL2014 compliant LIKE. |