-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mysql 5.6, output MysqlParameter, binary(16) -> Guid conversion issue #1528
Comments
The default GUID format is |
Neither LittleEndianBinary16 nor Binary16 specified in the connection string works. |
Another workaround is to not specify the var p = new MySqlParameter { ParameterName = "v_OrigId", Direction = ParameterDirection.Output };
command.Parameters.Add(p); |
When MySqlConnector needs to return We could adjust the statement to be However, |
Signed-off-by: Bradley Grainger <[email protected]>
Signed-off-by: Bradley Grainger <[email protected]>
Signed-off-by: Bradley Grainger <[email protected]>
Software versions
MySqlConnector version: 2.3.7
Server type (MySQL, MariaDB, Aurora, etc.) and version: Mysql 5.6
.NET version: any
Describe the bug
Mysql 5.6 stores guids in binary format. binary(16)
When you define a guid output parameter mysqlconnector cannot convert byte[] received from mysql to Guid.
Because it tries to convert it via ToString -> Parse
Exception
Code sample
stored proc sample:
v_OrigID is guid stored in binary(16)
Expected behavior
it is expected when byte[] is recieved from Mysql side and the output parameter type is Guid
then mysqlconnector should create guid from byte[] like New Guid(byte[]) instead of converting the object to string and parsing back to Guid.
The text was updated successfully, but these errors were encountered: