Bug #92982 Wrong GUID type when execute SHOW COLLATION statment
Submitted: 29 Oct 2018 7:59 Modified: 27 Jun 6:07
Reporter: Realanan May Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:6.9.12, 8.0.16 OS:Microsoft Windows
Assigned to: CPU Architecture:x86
Tags: Connect/NET, datatype

[29 Oct 2018 7:59] Realanan May
Description:
I use Connector/NET to connect MySQL Server 8.0.13.
When I call SqlConnection.Open, it raised an exception GUID type convertion failed.
So I use Connector/NET's sourcecode to debug this issue.
I found the connector execute "SHOW COLLATION" statment during connection open, this statment return a field called "Pad_attribute", this only appear in MySQL Server 8 version, not the old 5.6 version. I found that this field is CHAR(36) type, and the connector convert this type to GUID, but the content of this field is not.
I know I can set the "Old Guids" option to true to avoid this problem, but in my project, I use much more CHAR(36) type to GUID, I'v no idea to resolve it.

How to repeat:
Server: MySQL Server 8.0.13, (set the user password to mysql_native_password mode)
Connector: Connector/NET 6.9.12 also newest version.
Use connection string with "Old Guids=True".
When call SqlConnection.Open, the exception will be raised.
[30 Oct 2018 12:45] Umesh Shastry
Hello Realanan May,

Thank you for the report.
I could not repeat the issue at our end using with Visual Studio 2017, Connector/NET 8.0.13. Could you please provide exact sample project which triggers this issue? Thank you.

Also, MySQL Connector/NET 8.0 is highly recommended for use with MySQL Server 8.0, 5.7, 5.6, and 5.5. Please upgrade to MySQL Connector/NET 8.0.

regards,
Umesh
[31 Oct 2018 0:07] Realanan May
Hello Umesh Shastry,
Thank you for your reply.
I tested it again and found the reason. I set the skip-character-set-client-handshake option in server's my.cnf file. When I commented this option, the problem was disappeared.
I also debugged the connector's source code. I found an interesting things. When I set the skip-character-set-client-handshake option, the "SHOW COLLATION" statment will return a resultset with the field "Pad_attribute" in CHAR(36) type. And when I unset the skip-character-set-client-handshake option, the field is CHAR(27) type.
So that's the problem.
Thank you for your reply.

Best regards,
Realanan
[31 Oct 2018 10:51] Umesh Shastry
Thank you for confirming that problem disappeared after commenting out the option. Closing this bug# for now but if don't agree with this then please feel free to add exact sample project which triggers this issue and change the status back to 'Open'. Thank you for your interest in MySQL.

regards,
Umesh
[27 Jun 6:07] Umesh Shastry
Marking this as duplicate of Bug #93399 (sorry, ideally newer one should be marked as duplicate but since Bug #93399 is verified hence marking this as duplicate for now)

regards,
Umesh