Created
September 28, 2016 19:42
-
-
Save ronaldbradford/24654e5405af1907e0c6e3260e4b3dd0 to your computer and use it in GitHub Desktop.
This file contains 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
SELECT IS_UUID(1); | |
SET @uuid='aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee'; | |
SELECT IS_UUID(@uuid) AS is_uuid; | |
SELECT IS_UUID(REPLACE(@uuid,'-','')) AS is_uuid; | |
SELECT @uuid_bin := UUID_TO_BIN(@uuid) AS uuid_bin, LENGTH(@uuid_bin) AS len; | |
SELECT @old_uuid_bin := UNHEX(REPLACE(@uuid,'-','')) AS old_uuid_bin, LENGTH(@old_uuid_bin) AS len; | |
SELECT @uuid_bin = @old_uuid_bin; | |
SELECT BIN_TO_UUID(@uuid_bin) AS uuid, HEX(@old_uuid_bin) AS uuid_old; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment