Bug #109141 Insert of data into a table results in System.ArgumentException
Submitted: 18 Nov 2022 18:41 Modified: 22 Nov 2022 12:13
Reporter: Shane Leipper Email Updates:
Status: Analyzing Impact on me:
Category:Connector / NET Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: MySQL Verification Team 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.