Last active
August 29, 2015 14:01
-
-
Save midu/b7539b51ceca5ea34299 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> select 'Krąków, Poland'; | |
+------------------+ | |
| Krąków, Poland | | |
+------------------+ | |
| Krąków, Poland | | |
+------------------+ | |
mysql> select binary 'Krąków, Poland'; | |
+---------------------------+ | |
| binary 'Krąków, Poland' | | |
+---------------------------+ | |
| Krąków, Poland | | |
+---------------------------+ | |
mysql> select 'Krąków, Poland' = binary 'Krąków, Poland'; | |
+------------------------------------------------+ | |
| 'Krąków, Poland' = binary 'Krąków, Poland' | | |
+------------------------------------------------+ | |
| 1 | | |
+------------------------------------------------+ | |
-- This is the query Rails executes when validating `validates :address, uniqueness: true` | |
mysql> SELECT 1 AS one FROM `locations` WHERE `locations`.`address` = BINARY 'Krąków, Poland'; | |
Empty set (0.00 sec) | |
mysql> SELECT 1 AS one FROM `locations` WHERE `locations`.`address` = 'Krąków, Poland'; | |
+-----+ | |
| one | | |
+-----+ | |
| 1 | | |
+-----+ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment