Bug #61078 If there are dots in the database name, functions and procedures can't be called
Submitted: 6 May 2011 12:11 Modified: 17 May 2011 21:45
Reporter: Bas van Meurs Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S2 (Serious)
Version:5.1.56, 5.1.57 OS:Windows
Assigned to: CPU Architecture:Any
Tags: 1305, dots, functions, procedures

[6 May 2011 12:11] Bas van Meurs
Description:
I know it's not good practice to use dots in the database names, but I have a situation in which we have an existing MySQL installation on a Windows server with databases with dots in their names.

When I added some stored procedures to it, I got the following error:

CALL `info.stad.some`.create_qry

Error Code: 1305
PROCEDURE info.stad.some.create_qry does not exist

I tried exporting the database, and then created a new one info_stad_some. The stored procedure worked fine here.

Should I consider this a bug in MySQL?

Regards,
Bas

How to repeat:
CREATE SCHEMA `test.db` ;
DELIMITER $$
CREATE PROCEDURE `test.db`.`new_routine` ()
BEGIN
END$$
DELIMITER ;
CALL `test.db`.new_routine()

Gives:

Error Code: 1305
PROCEDURE test.db.new_routine does not exist
[7 May 2011 6:39] MySQL Verification Team
It works fine on 5.5.11 but fails with the given error on 5.1.56.
Look at my results;
-----------
mysql> CREATE SCHEMA `test.db` ;
Query OK, 1 row affected (0.00 sec)

mysql> DELIMITER $$
mysql> CREATE PROCEDURE `test.db`.`new_routine` ()
    -> BEGIN
    -> END$$
Query OK, 0 rows affected (0.16 sec)

mysql> DELIMITER ;
mysql> CALL `test.db`.new_routine();
Query OK, 0 rows affected (0.00 sec)

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.5.11    |
+-----------+
1 row in set (0.00 sec)
-------------------------------
[7 May 2011 7:15] MySQL Verification Team
this is fixed sinse 5.5.3 but I don't seem to be able to find a bug report yet.
[9 May 2011 19:48] Valeriy Kravchuk
I also can not find exact bug report that explains fix in 5.5 (see bug #23683 also).
[6 Jun 2011 12:12] Dmitry Lenev
Hello!

For the record this issue has been fixed in 5.5 by the same patch as bug #30977 "CONCURRENT STATEMENT USING STORED FUNCTION AND DROP FUNCTION BREAKS SBR". See also bug#56510 "ERROR 42000: FUNCTION DOES NOT EXIST IF NOT-PRIV USER RECONNECTS".