Bug #75301 SqlNullValueException thrown when calling MySqlConnection::GetSchema
Submitted: 24 Dec 2014 0:11 Modified: 24 Mar 2015 0:08
Reporter: Colin Paterson Email Updates:
Status: In review Impact on me:
Category:Connector / NET Severity:S2 (Serious)
Version: OS:Microsoft Windows
Assigned to: Assigned Account CPU Architecture:Any
Tags: GetSchema Index Columns

[24 Dec 2014 0:11] Colin Paterson
When you call MySqlConnection::GetSchema("IndexColumns") on a database that has a full text index defined a SqlNullValueException is thrown. This works as expected when there are no full text indexes but the exception is thrown when a full text search index is defined.

Exception is

System.Data.SqlTypes.SqlNullValueException was caught
  Message=Data is Null. This method or property cannot be called on Null values.
       at MySql.Data.MySqlClient.MySqlDataReader.GetFieldValue(Int32 index, Boolean checkNull)
       at MySql.Data.MySqlClient.MySqlDataReader.GetString(Int32 i)
       at MySql.Data.MySqlClient.MySqlDataReader.GetString(String column)
       at MySql.Data.MySqlClient.SchemaProvider.GetIndexColumns(String[] restrictions)
       at MySql.Data.MySqlClient.SchemaProvider.GetSchemaInternal(String collection, String[] restrictions)
       at MySql.Data.MySqlClient.ISSchemaProvider.GetSchemaInternal(String collection, String[] restrictions)
       at MySql.Data.MySqlClient.SchemaProvider.GetSchema(String collection, String[] restrictions)
       at MySql.Data.MySqlClient.MySqlConnection.GetSchema(String collectionName, String[] restrictionValues)

How to repeat:
Define a full text search index on any table and then run the following code


Suggested fix:
It shouldn't crash.
[24 Dec 2014 6:50] Chiranjeevi Battula
Hello Colin Paterson,

Thank you for the bug report.
Verified this behavior on Visual Studio 2013 (C#.Net) with  MySQL Connector/Net 6.9.5.

[31 Jul 19:24] Donald Scott
Was there any fix to this?  It has been open for 3 years with a serious severity.