Bug #61249 Procedure or function '`xxxxxxxxxxxxxxxx`' cannot be found in database "XXXXXX"
Submitted: 21 May 2011 0:25 Modified: 23 May 2011 7:06
Reporter: Gonzalo Garcia Correas Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:5.2.7 OS:Windows
Assigned to: Bogdan Degtyariov CPU Architecture:Any
Tags: Connector.Net 5.2.7, MySQL 5.0, stored procedure not founded

[21 May 2011 0:25] Gonzalo Garcia Correas
Description:
Using Visual Studio 2005 and MySQL 5.0, and trying to execute a stored procedure, show this error:  'Procedure or function '`xxxxxxxxxxxxxxxx`' cannot be found in database `XXXXXX`'.
The store procedure exists, and if using the MySQL Connector.Net 5.0.9 can be executed, but I need the 5.2.7.
Any solution?

Sorry by my English :-(.

How to repeat:
My code: 
  Public Function buscarModelo(ByVal nroTaco As Integer) As String
        ' ------------------------------------------
        Dim modelo As String = ""
        Conectar()
        Dim miSQL As New MySqlCommand("PROC4", Conexion)
        miSQL.CommandType = CommandType.StoredProcedure
        miSQL.Parameters.AddWithValue("@NROTAC", nroTaco).Direction = ParameterDirection.Input
        miSQL.Parameters.AddWithValue("@MODEL", modelo).Direction = ParameterDirection.InputOutput
        Try
            miSQL.ExecuteNonQuery()
            modelo = miSQL.Parameters("@MODEL").Value
        Catch ex As MySqlException
            oLogWriter.Escribir("Excepción MySQL en buscarModelo()" & vbNewLine & ex.Message & vbNewLine & ex.StackTrace.ToString)
            modelo = ""
        Catch ex As Exception
            oLogWriter.Escribir("Excepción en buscarModelo()" & vbNewLine & ex.Message & vbNewLine & ex.StackTrace.ToString)
            modelo = ""
        End Try
    End Function
Conexion is a MysqlConnection object as class variable.
[21 May 2011 0:38] Gonzalo Garcia Correas
OMG!

The answer was so easy....!

The name of database MUST be in lowercase, always...
[21 May 2011 6:58] Valeriy Kravchuk
So, can we assume this is not a bug?
[21 May 2011 17:35] Gonzalo Garcia Correas
No. It is not a bug. The connector is poorly documented in the reference manual.
It says nothing about such details.
[21 May 2011 17:39] Gonzalo Garcia Correas
Since the first version and to 5.0.9 of the connector, was indistinct put the names of the database in uppercase or lowercase.
Changed that, but not written in the reference manual, making it impossible to know, until find such errors.
[22 May 2011 10:30] Valeriy Kravchuk
Do you work with the same MySQL server on the same platform with versions 5.0.9 and 5.2.7 of Connector/Net?

Please, send the results of:

show variables like 'lower%';

from MySQL server where you see the problem.
[22 May 2011 14:08] Gonzalo Garcia Correas
If MySQL server is the same.
In fact, the project. Net was the same. In the project the only thing that changed was the Connector.Net MySQL 5.0.9 to 5.2.7.
I tried to change back to 5.0.9 and everything was working well, which makes clear that the problem is not on the server or the project.
The test was performed and gave the same results, and three different PCs, one with Windows XP Pro, one with Windows Vista and one with Widows 7. In all cases using MySQL server 5.0.67, and had the same problem.
About the variables listed, the result is this:

mysql> show variables like 'lower%';
+------------------------+-------+
| Variable_name          | Value |
+------------------------+-------+
| lower_case_file_system | ON    |
| lower_case_table_names | 1     |
+------------------------+-------+
2 rows in set (0.12 sec)

but as I said, the problem is independent of this, since I am working with Windows based systems.
[23 May 2011 7:06] Bogdan Degtyariov
The 5.2 branch of Connector/NET is discontinued, so no further patches or fixes will be added to it. On the other hand, the upper/lower case for database names worked perfectly for me in the current GA Connector/NET 6.3.6. I am closing this bug.

Please feel free to reopen it if you believe there is still a problem in 6.3.
[29 Jun 2011 6:09] Robert Freeland
Today we upgraded our server from MySQL 5.1.30 to MySQL 5.1.57. Our applications started throwing the "cannot be found" error whenever accessing stored procedures, though SELECTs worked fine. We changed the database name to lower case in our connection strings, but the stored procedures were STILL invisible. We then installed the newest version of Connector.Net and replaced the old MySQL.Data.dll from 2007 with the new one from April 2011. That worked, but only if the database name remains in lower case. So there are THREE variables at play here: database version, connector version, and database name casing in the connection string. IMHO it should be considered a bug -- things that used to work shouldn't just stop working for no good reason.