Bug #54236 Stored routines from databases with special characters in names can't be called.
Submitted: 4 Jun 2010 14:58 Modified: 7 Jun 2010 7:09
Reporter: Rafa‚ Wrzeszcz Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S2 (Serious)
Version:5.1.47-0.dotdeb.0 OS:Linux (Debian/Lenny)
Assigned to: CPU Architecture:Any
Tags: dbname, FUNCTION, routines, stored

[4 Jun 2010 14:58] Rafa‚ Wrzeszcz
Description:
When you have database with special character in it (allowed from since 5.1.16), for instance `foo.bar` you won't be able to call stored routine from it. It applies both to functions and procedures.

How to repeat:
create database `foo`;

use `foo`;

delimiter |

create function `test`() returns int
begin
    return 1;
end|

delimiter ;

select `test`();
select `foo`.`test`();

create database `foo.bar`;

use `foo.bar`;

delimiter |

create function `test`() returns int
begin
    return 1;
end|

delimiter ;

select `test`();
select `foo.bar`.`test`();

select * from `information_schema`.`routines` where `ROUTINE_SCHEMA` IN ('foo', 'foo.bar');

drop database `foo`;
drop database `foo.bar`;
[7 Jun 2010 7:09] Sveta Smirnova
Thank you for the report.

This was fixed in 5.5 series. Please upgrade.