Bug #68290 Calling custom functions when dot is in the database name
Submitted: 6 Feb 2013 12:43 Modified: 12 Feb 2013 12:01
Reporter: Jan Aukema Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: User-defined functions ( UDF ) Severity:S3 (Non-critical)
Version:5.1.66 OS:Linux (ubuntu)
Assigned to: CPU Architecture:Any

[6 Feb 2013 12:43] Jan Aukema
Description:
When using a database name with a dot in it, it is not possible to call a user defined function.

There error that is shown is that the function cannot be found. The function is available.

How to repeat:
When creating a database with the name "myfirst.databasename" and a function called "myfunction", the following error will occur when calling the user defined function "myfunction":

FUNCTION myfirst.databasename.myfunction does not exist
[8 Feb 2013 12:11] Erlend Dahl
Example:

DROP DATABASE `a.b`;
CREATE DATABASE `a.b`;
USE `a.b`;
DELIMITER $$

CREATE FUNCTION f(a INTEGER)
RETURNS INTEGER

BEGIN

  RETURN (a+a);

END
$$

DELIMITER ;

SET @a = 10;

SELECT f(@a);
[8 Feb 2013 12:13] Erlend Dahl
With this, I can reproduce on recent 5.1.69, but not on 5.5.31 nor on 5.6.11.

So it seems the problem has been fixed at some point.
[8 Feb 2013 12:14] Erlend Dahl
I will see if I can dig up more information.
[12 Feb 2013 12:01] MySQL Verification Team
duplicate of http://bugs.mysql.com/bug.php?id=61078 which was closed as "won't fix" since the issue is only in 5.1.
[12 Feb 2013 12:07] Erlend Dahl
Fixed along with bug#30977 in 5.5.3.