mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Bug #15439: UDF name case handling forces DELETE FROM mysql.func to remove
the UDF When deleting a user defined function MySQL must remove it from both the in-memory hash table and the mysql.proc system table. Finding (and removal therefore) from the internal hash table is case insensitive (or whatever the default charset is), whereas finding and removal from the system table is case sensitive. As a result if you supply a function name that is not in the same character case to DROP FUNCTION the server will remove the function only from the in-memory hash table and will keep the row in mysql.proc system table. This will cause inconsistency between the two structures (that is fixed only by restarting the server). Fixed by using the name in the precise case (from the in-memory hash table) to delete the row in the mysql.proc system table.
This commit is contained in:
@ -194,6 +194,17 @@ DROP FUNCTION sequence;
|
||||
DROP FUNCTION lookup;
|
||||
DROP FUNCTION reverse_lookup;
|
||||
DROP FUNCTION avgcost;
|
||||
select * from mysql.func;
|
||||
name ret dl type
|
||||
CREATE FUNCTION is_const RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
|
||||
select IS_const(3);
|
||||
IS_const(3)
|
||||
const
|
||||
drop function IS_const;
|
||||
select * from mysql.func;
|
||||
name ret dl type
|
||||
select is_const(3);
|
||||
ERROR 42000: FUNCTION test.is_const does not exist
|
||||
CREATE FUNCTION is_const RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
|
||||
select
|
||||
is_const(3) as const,
|
||||
|
Reference in New Issue
Block a user