Bug #68859 Add UUID data type
Submitted: 3 Apr 2013 19:00 Modified: 29 Apr 2013 18:27
Reporter: Dimitriy A Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Data Types Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any
Tags: Data Type, UUID

[3 Apr 2013 19:00] Dimitriy A
Description:
Please add UUID data type for efficient storage of UUID values. Generally UUID is 32 hexadecimal digits separated by 4 hyphens.

It would be great if a value as a string could be inserted into a field with UUID data type, so that hyphens would be stripped and hexadecimal converted to binary to take up only 16 bytes instead of 32 (without hyphens) to 36 (with hyphens) bytes. Upon reading the value, it would be automatically converted to hexadecimal format.

How to repeat:
N/A

Suggested fix:
N/A
[29 Apr 2013 18:27] Erlend Dahl
Thank you for the feature request.
[2 Jan 2014 16:02] Simon Mudd
Yes, a valid request as the alternative of storing as a binary(16) value means it's very hard from the command line to actually type in or view properly this type of data.
So +1 from me.
[2 Jan 2014 19:21] Ruud H.G. van Tol
Would be nice to have a format-setting per data-type, like CONCAT("\\x",HEX(%s)) for binary types.
[3 Jul 2017 12:28] Alexey Kopytov
MySQL 8.0 introduced UUID_TO_BIN() and BIN_TO_UUID() functions:
https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html

While it's not a dedicated data type with automatic conversion, I guess
those functions address all concerns about storing and retrieving UUID
values mentioned here.