diff options
-rw-r--r-- | mysql-test/r/udf.result | 11 | ||||
-rw-r--r-- | mysql-test/t/udf.test | 17 | ||||
-rw-r--r-- | sql/sql_udf.cc | 2 |
3 files changed, 29 insertions, 1 deletions
diff --git a/mysql-test/r/udf.result b/mysql-test/r/udf.result index eb5d771bcfe..64b7111bbc8 100644 --- a/mysql-test/r/udf.result +++ b/mysql-test/r/udf.result @@ -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, diff --git a/mysql-test/t/udf.test b/mysql-test/t/udf.test index 52ae424e423..65cbc7ae3ae 100644 --- a/mysql-test/t/udf.test +++ b/mysql-test/t/udf.test @@ -188,6 +188,23 @@ DROP FUNCTION reverse_lookup; DROP FUNCTION avgcost; # +# Bug #15439: UDF name case handling forces DELETE FROM mysql.func to remove +# the UDF +# +select * from mysql.func; +--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB +eval CREATE FUNCTION is_const RETURNS STRING SONAME "$UDF_EXAMPLE_LIB"; + +select IS_const(3); + +drop function IS_const; + +select * from mysql.func; + +--error 1305 +select is_const(3); + +# # Bug#18761: constant expression as UDF parameters not passed in as constant # --replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 163801e2f1e..5bbfa522d58 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -536,7 +536,7 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name) tables.table_name= tables.alias= (char*) "func"; if (!(table = open_ltable(thd,&tables,TL_WRITE))) goto err; - table->field[0]->store(udf_name->str, udf_name->length, system_charset_info); + table->field[0]->store(udf->name.str, udf->name.length, &my_charset_bin); table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (!table->file->index_read_idx(table->record[0], 0, (byte*) table->field[0]->ptr, |