Bug #22452 MySql.Data.MySqlClient.MySqlException: Parameter 'ın' is not defined
Submitted: 18 Sep 2006 20:17 Modified: 16 Oct 2006 17:17
Reporter: Ozgur YASAR Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:1.0.7 OS:Microsoft Windows (Windows XP SP2)
Assigned to: CPU Architecture:Any
Tags: MySqlException, not defined, Parameter

[18 Sep 2006 20:17] Ozgur YASAR
Description:
Hi,

On MySql Connector/NET 1.0.7, when you are running on a Turkish operating system, you may have difficulties with sql statements or stored procedures.

I have inspected and debugged the MySql Connector code, While it's trying to parse the parameters, lowers the parameter definition string and splits. But in Turkish culture settings, the char "I" is lowered to "ı" and "İ" is lowered to "i".

Especially in stored procedures, we use "IN p_paramname INT" and it creates problems while parsing like "ın p_paramname ınt".

~
Ozgur YASAR
MCAD.NET

How to repeat:
To repeat, change your regional settings to Turkish and use mysqlcommand and run a stored procedure takes at least one input parameter.

Suggested fix:
To fix, in run time before using mysql classes changing the thread's culture;

System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;

OR by modifying MySql Connector source code;

In GetParameterParts function;

string[] split = Utility.ContextSplit(parameterDef.ToLower(), " \t\r\n", "");

to;

string[] split = Utility.ContextSplit(parameterDef.ToLower(System.Globalization.CultureInfo.InvariantCulture), " \t\r\n", "");
[19 Sep 2006 19:32] 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/12236
[19 Sep 2006 19:32] Reggie Burnett
Fixed in 1.0.8 and 5.0.1
[19 Sep 2006 19:33] 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/12237
[16 Oct 2006 17:17] MC Brown
A note has been added to the 5.0.1 and 1.0.8 changelogs.