Skip to content

Instantly share code, notes, and snippets.

@Lunaxod
Lunaxod / mysql_uuid.sql
Last active Mar 27, 2020 — forked from merkushin/mysql_uuid.sql
MySQL UUID v3 v4 v5 Stored Functions
View mysql_uuid.sql
DROP FUNCTION IF EXISTS uuid_from_bin;
DROP FUNCTION IF EXISTS uuid_to_bin;
DROP FUNCTION IF EXISTS uuid_v5;
DROP FUNCTION IF EXISTS uuid_v4;
DROP FUNCTION IF EXISTS uuid_v3;
DELIMITER //
CREATE FUNCTION uuid_from_bin(b BINARY(16))
RETURNS CHAR(36)