I generate UUIDs by using UUID_TO_BIN(UUID(), true)
and storing them as BINARY(16)
.
However, when fetching the values:
<code>var uuid = dataReader.GetGuid(name);
Console.WriteLine(uuid.ToString());
</code>
<code>var uuid = dataReader.GetGuid(name);
Console.WriteLine(uuid.ToString());
</code>
var uuid = dataReader.GetGuid(name);
Console.WriteLine(uuid.ToString());
I do get an uuid string printed, but it is not the same string as when running SELECT BIN_TO_UUID("col")
on the column.
What am I doing wrong?
- I tried setting
OldGuids
in connection string totrue
but still got the same incorrect uuid back. - I am using MySql.Data .NET Connector version 8.3.0. And server is version 8.0.36.
- Reason I’m using
UUID_TO_BIN(UUID(), true)
and storing them asBINARY(16)
is that, according to my readings, I thought this was the most efficient way to store uuids and using them as primary keys.
Thanks