Bug #46270 connection.GetSchema("Columns") fails on MySQL 4.1
Submitted: 17 Jul 2009 17:43 Modified: 30 Jul 2009 13:53
Reporter: Florian Heinemann Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:6.0.4 OS:Any
Assigned to: Reggie Burnett CPU Architecture:Any

[17 Jul 2009 17:43] Florian Heinemann
Description:
Using the latest .NET Connector 6.0.4 and a MySQL 4.1 server you receive an exception when trying to execute

connection.GetSchema("Columns", ...);

The exception is:

'connection.GetSchema("Columns")' threw an exception of type 'System.ArgumentException'	System.Data.DataTable {System.ArgumentException}
base	{"Input string was not in a correct format.Couldn't store <'Select'> in NUMERIC_PRECISION Column.  Expected type is UInt64."}	System.Exception {System.ArgumentException}

The same error occurs with 6.0.3 and different versions of the 4.1 server.

It seems to depend on the table selected. But you receive the error when selecting the tables 'columns_priv' and 'db' of the bundled 'mysql' database.

How to repeat:
- Clean Installation of MySQL 4.1
- .NET Connector 6.0.4
- Execute for example: 

DataTable columnTable = connection.GetSchema("Columns", new string[] { null, "mysql", "columns_priv", null});

My connection string is:

"Host=localhost;User Id=root;Password=;Port=3306;Initial Catalog=mysql;Compress=False;Convert Zero Datetime=true"
[20 Jul 2009 8:54] Tonci Grgin
Hi Florian and thanks for your report.

Verified just as described in private static void SchemaProvider.ParseColumnRow(DataRow row), Ln 222. Statement log shows:
[20.7.2009 10:22:24] - Executing command QUERY with text ='SHOW TABLE STATUS FROM `mysql` LIKE 'columns_priv''
and an interesting thing (I also have databse named "--mysql---"):
[20.7.2009 10:22:24] - Executing command QUERY with text ='SHOW FULL COLUMNS FROM `--mysql---`.`columns_priv`'
even though I did not specify any wildcards: DataTable dtcols = conn.GetSchema("Columns", new string[] { null, "mysql", "columns_priv", null });
[28 Jul 2009 21:21] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/79479

698 Reggie Burnett	2009-07-28
      - fixed "column" schema collection so that it will return set and enum datatypes correctly (bug #46270)
[28 Jul 2009 21:22] Reggie Burnett
fixed in 5.2.8+
[29 Jul 2009 22:02] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/79576

699 Reggie Burnett	2009-07-29
      fixed "column" schema collection so that it will return set and enum datatypes correctly (bug #46270)
[29 Jul 2009 22:10] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/79577

699 Reggie Burnett	2009-07-29
      fixed "column" schema collection so that it will return set and enum datatypes correctly (bug #46270)
[30 Jul 2009 13:53] Tony Bedford
Entries were added to the 5.2.8, 6.0.5 and 6.1.1 changelogs:

When using MySQL Connector/NET 6.0.4 and a MySQL Server 4.1 an exception was generated when trying to execute:

connection.GetSchema("Columns", ...);

The exception generated was:

'connection.GetSchema("Columns")' threw an exception of type
'System.ArgumentException'System.Data.DataTable {System.ArgumentException}
base{"Input string was not in a correct format.Couldn't store <'Select'> in
NUMERIC_PRECISION Column.  Expected type is UInt64."}System.Exception
{System.ArgumentException}