Bug #109141 Insert of data into a table results in System.ArgumentException
Submitted: 18 Nov 2022 18:41 Modified: 17 Apr 8:29
Reporter: Shane Leipper Email Updates:
Status: Can't repeat Impact on me:
Category:Connector / NET Severity:S2 (Serious)
Version: OS:Any
Assigned to: CPU Architecture:Any

[18 Nov 2022 18:41] Shane Leipper
Executing a insert using C# MySql.Data package results in failure to insert the data. The attached project MySqlBug.zip contains a docker compose file that sets up the infrastructure using images:


There are 2 C# xUnit based tests that use the standard MySql.Data nuget package; one using a direct connection to MySQL database the other to ProxySQL, the latter fails with:

System.ArgumentException : Source array was not long enough. Check the source index, length, and the array's lower bounds. (Parameter 'sourceArray')

Stack Trace: 

Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length)
OkPacket.ctor(MySqlPacket packet)
NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
Driver.GetResult(Int32 statementId, Int32& affectedRows, Int64& insertedId)
Driver.NextResult(Int32 statementId, Boolean force)
MySqlCommand.ExecuteReader(CommandBehavior behavior)
MySqlConnection.BeginTransaction(IsolationLevel iso, String scope)
Audit.InsertAudits(String connectionString) line 32
ProxySqlBugTests.InsertViaProxySql_ExpectPass() line 50

--- End of stack trace from previous location ---

How to repeat:
See attached project
[18 Nov 2022 18:42] Shane Leipper
Project used to reproduce the issue

Attachment: MySqlBug.zip (application/x-zip-compressed, text), 5.68 KiB.

[22 Nov 2022 12:13] Shane Leipper
For further information this works in 8.0.26 but starts failing for 8.0.27 upwards
[30 Nov 2022 3:43] hiroaki ihori
Same situation. This error is reported just by starting a transaction.
[21 Mar 10:30] Shane Leipper
Change severity.
[21 Mar 13:07] MySQL Verification Team
Hello Shane,

Thank you for the bug report and details.
I tried to reproduce your issue on windows 10 with Connector/NET 8.0.32 using project provided but I am not seeing any issues at my end.

Ashwini Patil
[17 Apr 8:29] Shane Leipper
I updated the project to use but this issue is still occurring. The test InsertViaProxySql_ExpectPass fails.

That said updating ProxySQL image to proxysql/proxysql:2.5.1 does result in the test passing so maybe you updated that also.