1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Fix for bug which caused grant.test fail on darwin7.3. We were converting db and table

names to lower case using latin1 instead of utf-8 in sql_acl.cc if lower_case_table_names 
was on. Also replaced in other such places system_charset_info with files_charset_info
for consistency.


sql/handler.cc:
  Replaced system_charset_info with files_charset_info in places where we are converting 
  names to lower case because of lower_case_table_names for consistency.
sql/sql_acl.cc:
  We should use files_charset_info when converting db/table names to lower case because they
  could be in utf-8 and not in latin1!
sql/sql_cache.cc:
  Added clarifying comments in tricky place after discussion with Sanja.
  Replaced system_charset_info with files_charset_info in places where we 
  are converting names to lower case because of lower_case_table_names for 
  consistency.
sql/sql_db.cc:
  Replaced system_charset_info with files_charset_info in places where we are converting 
  names to lower case because of lower_case_table_names for consistency.
sql/sql_show.cc:
  Replaced system_charset_info with files_charset_info in places where we are converting 
  names to lower case because of lower_case_table_names for consistency.
sql/sql_table.cc:
  Replaced system_charset_info with files_charset_info in places where we are converting 
  names to lower case because of lower_case_table_names for consistency.
This commit is contained in:
unknown
2004-05-22 23:41:58 +04:00
parent 11ee33b181
commit 0e86cf8aba
6 changed files with 32 additions and 17 deletions

View File

@ -1512,13 +1512,28 @@ ulong Query_cache::init_cache()
VOID(hash_init(&queries, &my_charset_bin, def_query_hash_size, 0, 0,
query_cache_query_get_key, 0, 0));
#ifndef FN_NO_CASE_SENCE
/*
If lower_case_table_names!=0 then db and table names are already
converted to lower case and we can use binary collation for their
comparison (no matter if file system case sensitive or not).
If we have case-sensitive file system (like on most Unixes) and
lower_case_table_names == 0 then we should distinguish my_table
and MY_TABLE cases and so again can use binary collation.
*/
VOID(hash_init(&tables, &my_charset_bin, def_table_hash_size, 0, 0,
query_cache_table_get_key, 0, 0));
#else
// windows, OS/2 or other case insensitive file names work around
/*
On windows, OS/2, MacOS X with HFS+ or any other case insensitive
file system if lower_case_table_names!=0 we have same situation as
in previous case, but if lower_case_table_names==0 then we should
not distinguish cases (to be compatible in behavior with underlaying
file system) and so should use case insensitive collation for
comparison.
*/
VOID(hash_init(&tables,
lower_case_table_names ? &my_charset_bin :
system_charset_info,
files_charset_info,
def_table_hash_size, 0, 0,query_cache_table_get_key, 0, 0));
#endif