Bug #94089 UDFs metadata will also be present on the information_schema.routines table
Submitted: 28 Jan 2019 7:03 Modified: 24 Apr 2019 1:45
Reporter: JianJun Shi Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.7 & 8.0.13 OS:Linux
Assigned to: CPU Architecture:Any

[28 Jan 2019 7:03] JianJun Shi
"25.22 The INFORMATION_SCHEMA ROUTINES Table" chapter in the "MySQL 8.0 Reference Manual" and "MySQL 5.7 Reference Manual" was described as following:

The ROUTINES table does not include built-in SQL functions or user-defined functions

Actually, user-defined functions' metadata will also be present on the information_schema.routines table.

How to repeat:
use test;
create function RENAME_USER_DEFINER_036() returns int(10) deterministic return(select 1+2*3/4);
select * from information_schema.routines where ROUTINE_SCHEMA='test' and ROUTINE_NAME='RENAME_USER_DEFINER_036';
[30 Jan 2019 9:59] Bogdan Kecman

Verified as described. I changed the category to "documentation" as I think the way it works is preferable, just needs to be properly documented.

kind regards
[24 Apr 2019 1:45] Paul Dubois
Posted by developer:
A user-defined function (UDF) is a function written in C++ and loaded with

The CREATE FUNCTION shown in the "How to Repeat" section is an example
of a stored function.

As https://dev.mysql.com/doc/refman/8.0/en/routines-table.html says:
"The ROUTINES table provides information about stored routines (stored procedures and stored functions)."

So although the ROUTINES table (correctly) shows information about the example
function, that function is not a UDF.