diff options
author | holyfoot/hf@mysql.com/hfmain.(none) <> | 2007-11-10 16:54:25 +0400 |
---|---|---|
committer | holyfoot/hf@mysql.com/hfmain.(none) <> | 2007-11-10 16:54:25 +0400 |
commit | afb9ecaff910e80debb366a64f5f42fa53dfefc7 (patch) | |
tree | 042b5f08067377404d6862d4d8e64a3149453bb7 /sql/sql_table.cc | |
parent | 29ea825e574aaeb3ebd3e02b44a105b26da899ec (diff) | |
download | mariadb-git-afb9ecaff910e80debb366a64f5f42fa53dfefc7.tar.gz |
Bug #32063 "create table like" works case-significant only in "embedded" server (libmysqld)
in mysql_creata_like_table() we 'downcase' the complete path to the
.frm file. It works fine in standalone case as there usually
we only have './' as a path to the datahome, but doesn't work in
the embedded server where we add the real path there, so if a
directory has uppercase letters in it's name, it won't be found.
Fixed by 'downcasing' only database/table pair.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 0316d6a3c10..a1df7e21b73 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2429,12 +2429,12 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table, strxmov(src_path, (*tmp_table)->path, reg_ext, NullS); else { - strxmov(src_path, mysql_data_home, "/", src_db, "/", src_table, - reg_ext, NullS); + char *tablename_pos= strxmov(src_path, mysql_data_home, "/", NullS); + strxmov(tablename_pos, src_db, "/", src_table, reg_ext, NullS); + if (lower_case_table_names) + my_casedn_str(files_charset_info, tablename_pos); /* Resolve symlinks (for windows) */ fn_format(src_path, src_path, "", "", MYF(MY_UNPACK_FILENAME)); - if (lower_case_table_names) - my_casedn_str(files_charset_info, src_path); if (access(src_path, F_OK)) { my_error(ER_BAD_TABLE_ERROR, MYF(0), src_table); |