Re: UUID column type
That's because the UUID() function returns the uuid value in text format, not binary or other native type. You would have to parse that into binary in order to store it as such. Casting it will simply store the characters for the text into the binary "string," not convert it since the source is just a string. For casting to make sense, MySQL would have to provide a native UUID datatype.
I was assuming you were using this table in conjunction with an application and pumping the data in/out in binary. To freely convert string and binary UUID representations in a stored procedure, you'll need to write a pair of conversion functions to parse and decode. To encode it to binary, I'd suggest something like the following:
CONCAT(UNHEX(LEFT(my_uuid,8)),UNHEX(MID(my_uuid,10,4)),UNHEX(MID(my_uuid,15,4)),UNHEX(MID(my_uuid,20,4)),UNHEX(RIGHT(my_uuid,12)))
Converting back to text is similar using HEX() and then inserting the hyphens at the appropriate points.
Clear as mud?