mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug#49501 Inefficient information_schema check (system collation)
added check_length optimization for I_S_NAME comparison
This commit is contained in:
@ -826,8 +826,7 @@ bool mysqld_show_create_db(THD *thd, char *dbname,
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
#endif
|
||||
if (!my_strcasecmp(system_charset_info, dbname,
|
||||
INFORMATION_SCHEMA_NAME.str))
|
||||
if (is_schema_db(dbname, strlen(dbname)))
|
||||
{
|
||||
dbname= INFORMATION_SCHEMA_NAME.str;
|
||||
create.default_table_charset= system_charset_info;
|
||||
@ -2780,8 +2779,8 @@ int make_db_list(THD *thd, List<LEX_STRING> *files,
|
||||
*/
|
||||
if (lookup_field_vals->db_value.str)
|
||||
{
|
||||
if (!my_strcasecmp(system_charset_info, INFORMATION_SCHEMA_NAME.str,
|
||||
lookup_field_vals->db_value.str))
|
||||
if (is_schema_db(lookup_field_vals->db_value.str,
|
||||
lookup_field_vals->db_value.length))
|
||||
{
|
||||
*with_i_schema= 1;
|
||||
if (files->push_back(i_s_name_copy))
|
||||
@ -5228,7 +5227,7 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table)
|
||||
*/
|
||||
if (thd->lex->sql_command != SQLCOM_SHOW_EVENTS &&
|
||||
check_access(thd, EVENT_ACL, et.dbname.str, 0, 0, 1,
|
||||
is_schema_db(et.dbname.str)))
|
||||
is_schema_db(et.dbname.str, et.dbname.length)))
|
||||
DBUG_RETURN(0);
|
||||
|
||||
/* ->field[0] is EVENT_CATALOG and is by default NULL */
|
||||
|
Reference in New Issue
Block a user