• unknown's avatar
    Bug #15439: UDF name case handling forces DELETE FROM mysql.func to remove · acf0636e
    unknown authored
                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. 
    
    
    mysql-test/r/udf.result:
      Bug #15439: UDF name case handling forces DELETE FROM mysql.func to remove
                  the UDF
       - test case
    mysql-test/t/udf.test:
      Bug #15439: UDF name case handling forces DELETE FROM mysql.func to remove
                  the UDF
       - test case
    sql/sql_udf.cc:
      Bug #15439: UDF name case handling forces DELETE FROM mysql.func to remove
                  the UDF
       - use the exact function name in deleting from mysql.proc.
    acf0636e
sql_udf.cc 14.2 KB