Commit c386daf0 authored by Sergei Golubchik's avatar Sergei Golubchik

post-fix patch for MDEV-5850: MySQL Bug#21317: SHOW CREATE DATABASE does not...

post-fix patch for MDEV-5850: MySQL Bug#21317: SHOW CREATE DATABASE does not obey to lower_case_table_names
parent 9a06e531
......@@ -3997,7 +3997,7 @@ case SQLCOM_PREPARE:
strmov(db_name.str, lex->name.str);
if (check_db_name(&db_name))
{
my_error(ER_WRONG_DB_NAME, MYF(0), db_name);
my_error(ER_WRONG_DB_NAME, MYF(0), db_name.str);
break;
}
res= mysqld_show_create_db(thd, &db_name, &lex->name, &lex->create_info);
......
......@@ -3468,11 +3468,15 @@ bool check_db_name(LEX_STRING *org_name)
return 1;
if (lower_case_table_names == 1 && name != any_db)
org_name->length= my_casedn_str(files_charset_info, name);
{
org_name->length= name_length= my_casedn_str(files_charset_info, name);
if (check_for_path_chars)
org_name->length+= MYSQL50_TABLE_NAME_PREFIX_LENGTH;
}
if (db_name_is_in_ignore_db_dirs_list(name))
return 1;
return check_table_name(name, org_name->length, check_for_path_chars);
return check_table_name(name, name_length, check_for_path_chars);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment