From 56d4eb21db828bbf1725b7523d8e3a4809e058c5 Mon Sep 17 00:00:00 2001 From: Praveenkumar Hulakund Date: Tue, 27 Mar 2012 12:42:11 +0530 Subject: Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE Analysis: ------------------------------- According to the Manual (http://dev.mysql.com/doc/refman/5.1/en/identifier-case-sensitivity.html): "Column, index, stored routine, and event names are not case sensitive on any platform, nor are column aliases." In other words, 'lower_case_table_names' does not affect the behaviour of those identifiers. On the other hand, trigger names are case sensitive on some platforms, and case insensitive on others. 'lower_case_table_names' does not affect the behaviour of trigger names either. The bug was that SHOW statements did case sensitive comparison for stored procedure / stored function / event names. Fix: Modified the code so that comparison in case insensitive for routines and events for "SHOW" operation. --- sql/sql_show.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sql/sql_show.cc') diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 2c85e29f985..ab3217dbe48 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -4323,7 +4323,8 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table, (sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND) == 0) { restore_record(table, s->default_values); - if (!wild || !wild[0] || !wild_compare(sp_name.c_ptr_safe(), wild, 0)) + if (!wild || !wild[0] || !wild_case_compare(system_charset_info, + sp_name.c_ptr_safe(), wild)) { int enum_idx= (int) proc_table->field[5]->val_int(); table->field[3]->store(sp_name.ptr(), sp_name.length(), cs); @@ -5325,7 +5326,7 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table) DBUG_RETURN(1); } - if (!(!wild || !wild[0] || !wild_compare(et.name.str, wild, 0))) + if (!(!wild || !wild[0] || !wild_case_compare(scs, et.name.str, wild))) DBUG_RETURN(0); /* -- cgit v1.2.1