Comments - REGEXP

8 months, 2 weeks ago Rob McMillin

Why?

MariaDB [nesr]> select 'josé' rlike 'jose';
+----------------------+
| 'josé' rlike 'jose'  |
+----------------------+
|                    0 |
+----------------------+
1 row in set (0.000 sec)

MariaDB [nesr]> select 'josé' = 'jose';
+------------------+
| 'josé' = 'jose'  |
+------------------+
|                1 |
+------------------+
1 row in set (0.000 sec)

MariaDB [nesr]> show variables like 'collat%';
+----------------------+--------------------+
| Variable_name        | Value              |
+----------------------+--------------------+
| collation_connection | utf8mb4_unicode_ci |
| collation_database   | utf8mb4_unicode_ci |
| collation_server     | latin1_swedish_ci  |
+----------------------+--------------------+
3 rows in set (0.001 sec)

 
3 days, 12 hours ago Mike Casey

Why not? Answering a bit late I know... but just in case someone else (like me), has the same question.

https://mariadb.com/kb/en/regular-expressions-overview/ "Comparisons are performed on the byte value, so characters that are treated as equivalent by a collation, but do not have the same byte-value, such as accented characters, could evaluate as unequal."

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.