Bug #100683 Procedure cannot be found.
Submitted: 28 Aug 2020 19:54 Modified: 4 Feb 2021 23:33
Reporter: Kirk Hall Email Updates:
Status: Closed Impact on me:
Category:Connector / NET Severity:S2 (Serious)
Version:8.0.21 OS:Windows
Assigned to: CPU Architecture:x86
Tags: regression

[28 Aug 2020 19:54] Kirk Hall
Starting from 8.0.21, stored procedure calls using ExecuteReader are failing with the following error:

Procedure or function '' cannot be found in database.

I have verified the stored procedure exists and is accessible to the user.

The same code works flawlessly with 8.0.20 and earlier.

In the MySQL80 Client Connections list, the following statement shows that the connector is searching for a empty string (LIKE '').

SELECT * FROM information_schema.routines WHERE 1=1 AND routine_schema LIKE 'rxcel' AND routine_name LIKE ''

How to repeat:
The following code produces the error:

using MySqlConnection sqlConnection = new MySqlConnection(connectionString);
using MySqlCommand cmd = new MySqlCommand();
cmd.Connection = sqlConnection;
cmd.CommandText = storedProcedureName;
cmd.CommandType = CommandType.StoredProcedure;
using MySqlDataReader dr = cmd.ExecuteReader();

In my test case, the stored procedure is named "rxcel.sdtAppRoutine" and it has no parameters.

The code fails on the execution of ExecuteReader.

A Stack Trace follows:

   at MySql.Data.MySqlClient.ProcedureCache.GetProcData(MySqlConnection connection, String spName)
   at MySql.Data.MySqlClient.ProcedureCache.AddNew(MySqlConnection connection, String spName)
   at MySql.Data.MySqlClient.ProcedureCache.GetProcedure(MySqlConnection conn, String spName, String cacheKey)
   at MySql.Data.MySqlClient.StoredProcedure.GetParameters(String procName)
   at MySql.Data.MySqlClient.StoredProcedure.CheckParameters(String spName)
   at MySql.Data.MySqlClient.StoredProcedure.Resolve(Boolean preparing)
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader()
[30 Aug 2020 17:09] MySQL Verification Team
Thank you for the bug report. Please provide the repeatable test case (SQL scripts (for procedure,etc), the C# file client). Thanks.
[31 Aug 2020 6:57] MySQL Verification Team
Thank you for the report.
[25 Sep 2020 5:38] MySQL Verification Team
Bug #100949 marked as duplicate of this one
[27 Oct 2020 11:49] MySQL Verification Team
Bug #101336 marked as duplicate of this one
[4 Feb 2021 23:33] Gustavo Cuatepotzo
This bug has been fixed since 8.0.22 version