Bug 8507 - Ubuntu - MySqlConnection.Open resulting in System.OverflowException
Summary: Ubuntu - MySqlConnection.Open resulting in System.OverflowException
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Data (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-11-19 14:42 UTC by rehcra
Modified: 2012-11-24 05:23 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 8507 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description rehcra 2012-11-19 14:42:06 UTC
In trying to get the demo from http://www.mono-project.com/MySQL, I tested the following code on: 

Ubuntu 11.10, Mono 2.10.5, Mysql Connector/Net 6.6
Ubuntu 12.04.1 LTS, Mono 3.0.1, Mysql Connector/Net 6.6

Installed MySQL v2 drivers (after renaming) to the gac. Added provider a line to the machine.config.

Testing a Hello World demo compiles and runs fine. The following code executes and connects on MSVS.

The compile cmd works: mcs TestMysqlConnect.cs -r:System.Data.dll -r:/home/steve/MONO/Assemblies/Mysql/v2/MySql.Data.dll

using System;
using System.Data;
using MySql.Data.MySqlClient;

public class Test
{
   public static void Main(string[] args)
   {
      string connectionString =
      "Server=192.168.111.4;" +
      "Database=LOADTRACKER;" +
      "Port=3306;" +
      "User ID=oec;" +
      "Password=oec;" +
      "Pooling=false";

    Console.WriteLine("Create MySqlConnection");

   IDbConnection dbcon;
   dbcon = new MySqlConnection(connectionString);

    Console.WriteLine("dbcon.Open();");

   dbcon.Open();

   IDbCommand dbcmd = dbcon.CreateCommand();

    Console.WriteLine("dbcon.CreateCommand();");

   // requires a table to be created named employee
   // with columns firstname and lastname
   // such as,
   //        CREATE TABLE employee (
   //           firstname varchar(32),
   //           lastname varchar(32));
   string sql =
       "SELECT Account, Security " +
       "FROM accesslist";
   dbcmd.CommandText = sql;
   IDataReader reader = dbcmd.ExecuteReader();
   while(reader.Read()) {
        string acct = (string) reader["Account"];
        string sec = (string) reader["Security"];

        Console.WriteLine("Acct: " + acct + " (" + sec + ")");
   }
   // clean up
   reader.Close();
   reader = null;
   dbcmd.Dispose();
   dbcmd = null;
   dbcon.Close();
   dbcon = null;
   }
}

Executing this code produces:

$mono ./TestMysqlConnect.exe
Create MySqlConnection
dbcon.Open();

Unhandled Exception: System.OverflowException: Number overflow.
  at (wrapper managed-to-native) object:__icall_wrapper_mono_array_new_specific (intptr,int)
  at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.HandleAuthChange (MySql.Data.MySqlClient.MySqlPacket packet) [0x00000] in <filename unknown>:0
  at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.Authenticate (Boolean reset) [0x00000] in <filename unknown>:0
  at MySql.Data.MySqlClient.NativeDriver.Authenticate (System.String authMethod, Boolean reset) [0x00000] in <filename unknown>:0
  at MySql.Data.MySqlClient.NativeDriver.Open () [0x00000] in <filename unknown>:0
  at MySql.Data.MySqlClient.Driver.Open () [0x00000] in <filename unknown>:0
  at MySql.Data.MySqlClient.Driver.Create (MySql.Data.MySqlClient.MySqlConnectionStringBuilder settings) [0x00000] in <filename unknown>:0
  at MySql.Data.MySqlClient.MySqlConnection.Open () [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.OverflowException: Number overflow.
  at (wrapper managed-to-native) object:__icall_wrapper_mono_array_new_specific (intptr,int)
  at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.HandleAuthChange (MySql.Data.MySqlClient.MySqlPacket packet) [0x00000] in <filename unknown>:0
  at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.Authenticate (Boolean reset) [0x00000] in <filename unknown>:0
  at MySql.Data.MySqlClient.NativeDriver.Authenticate (System.String authMethod, Boolean reset) [0x00000] in <filename unknown>:0
  at MySql.Data.MySqlClient.NativeDriver.Open () [0x00000] in <filename unknown>:0
  at MySql.Data.MySqlClient.Driver.Open () [0x00000] in <filename unknown>:0
  at MySql.Data.MySqlClient.Driver.Create (MySql.Data.MySqlClient.MySqlConnectionStringBuilder settings) [0x00000] in <filename unknown>:0
  at MySql.Data.MySqlClient.MySqlConnection.Open () [0x00000] in <filename unknown>:0

Interestingly, if I provide a bad user/password, I get the expected exception of:

[ERROR] FATAL UNHANDLED EXCEPTION: MySql.Data.MySqlClient.MySqlException: Authentication to host '192.168.111.4' for user 'root' using method 'mysql_native_password' failed with message: Access denied for user 'root'@'linux' (using password: YES) ---> MySql.Data.MySqlClient.MySqlException: Access denied for user 'root'@'linux' (using password: YES)

I posted this to StackExchange (http://stackoverflow.com/questions/13349039/mono-on-ubuntu-mysqlconnection-open-resulting-in-system-overflowexception), and the only response, suggested I file a bug report here.

Thank you.
Comment 1 Zoltan Varga 2012-11-24 05:23:42 UTC
-> sys.data.