Bug #52365 Database setting in connection string is case-sensitive for calling stored proce
Submitted: 25 Mar 2010 14:33 Modified: 8 May 2010 10:24
Reporter: Vince McDonald Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S4 (Feature request)
Version:6.2.2.0 OS:Windows (XP Home)
Assigned to: CPU Architecture:Any

[25 Mar 2010 14:33] Vince McDonald
Description:
The database portion of the connection string is case-sensitive.  This caused me a problem because I'd originally defined my database with a mixed-case name "MRMembers", which is stored in MySQL as "mrmembers".  The behavior is particularly unexpected since MySQL is case-insensitive on Windows.

Environment details:
Windows XP Home, .NET 2.0, C#, programming against local MySql server 5.1.45 using
Connector/NET 6.2.2.0.

I haven't tested this when issuing dynamic SQL commands, since I exclusively use stored procedures in my programming.

The following article makes no mention about case-sensitivity of the connection string:
http://dev.mysql.com/doc/refman/5.1/en/connector-net-connection-options.html

I'd originally thought that this was related to bug # 49352, to which I'd originally posted.  It appears to be the same as bug #s 40751 and 41120.  Since this has already been termed "not a bug" in #41120, I'm logging this as a feature request.

How to repeat:
I'll add a Windows Forms sample project in a subsequent update.

- Modify the connection string in the app.config file of the attached application to supply your own password for the root user.  Note that one connection string connects to database "test", while the other connects to database "Test".
- Use the script in MySqlSProcTest.sql to create the sptest_One stored procedure on the test database.
- Run the application.
- Click the second button on the form:  Call sptest_One() on DB "Test"
- A dialog box appears with the following message:
Exception occurred:  MySql.Data.MySqlClient.MySqlException
Procedure or function '`sptest_One`' cannot be found in database '`Test`'.

You can click the first button (Call sptest_One() on DB "test") to confirm that the stored procedure is accessible; this will show a dialog box with the results of the stored procedure.  The only difference between the two buttons is which connection string is used.

Suggested fix:
These suggestions are mutually exclusive.

- Modify the above documentation to mention that the letter-case used for the database portion of the connection string must match exactly as it is stored in MySQL.
- Modify Connector/NET so that it will send the proper case for the database, or so that it will match the database name in a case-insensitive fashion.
[25 Mar 2010 14:34] Vince McDonald
Windows Forms application illustrating case-sensitivity of database in connection string

Attachment: MySqlSProcTest.zip (application/x-zip-compressed, text), 15.05 KiB.

[6 Apr 2010 7:50] Tonci Grgin
Hi Vince and thanks for your report.

I do agree with you but for the sake of completeness, I need you to tell me what is the value of lower_case_table_names variable on your test server (http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_lower_case_tabl...).
[6 Apr 2010 16:10] Vince McDonald
Thanks for your reply, Tonci.

The lower_case_table_names variable is set to 1.  I'm looking to see how to change this to test a value of 2 for the variable and its impact on my sample, since a value of 0 isn't meaningful on Windows.
[8 Apr 2010 10:24] Tonci Grgin
Vince, check the manual. Should be possible to change in my.ini and via server variable.

Waiting on your test result.
[8 May 2010 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".