MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Ian Greenhoe Date:September 11 2006 10:03am
Subject:bk commit into 5.0 tree (igreenhoe:1.2272) BUG#16323
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of greenman. When greenman does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-09-11 03:02:48-07:00, igreenhoe@stripped +5 -0
  Fix for bug #16323 (lower_case_table_names breaks case sensitive directories)
  
  Problem:  Code is lowercasing *everything* in some paths, instead
  of just the database/table name.
  
  Solution:  Only lowercase database/table name.  Added fn to help with
  conversion.

  include/my_sys.h@stripped, 2006-09-11 03:02:43-07:00, igreenhoe@stripped +1 -0
    Added fn to lowercase path to table file without modifying the base

  mysys/Makefile.am@stripped, 2006-09-11 03:02:43-07:00, igreenhoe@stripped +1 -0
    Added file to contain fn

  mysys/mf_lowercasetable.c@stripped, 2006-09-11 03:02:43-07:00, igreenhoe@stripped +39 -0
    Added function "to_lower_case_table_path" which handles table name
    conversion to lc correctly

  mysys/mf_lowercasetable.c@stripped, 2006-09-11 03:02:43-07:00, igreenhoe@stripped +0 -0

  sql/handler.cc@stripped, 2006-09-11 03:02:43-07:00, igreenhoe@stripped +3 -3
    changed to use fn that handles base part of path correctly

  sql/sql_table.cc@stripped, 2006-09-11 03:02:43-07:00, igreenhoe@stripped +1 -5
    nuked conversion to lowercase on mysql_tmpdir
    changed to use fn that handles base part of path correctly

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	igreenhoe
# Host:	anubis.greendragongames.com
# Root:	/home/greenman/workspace-mysql/mysql/Bug-5.0-16323

--- 1.184/include/my_sys.h	2006-09-11 03:03:06 -07:00
+++ 1.185/include/my_sys.h	2006-09-11 03:03:06 -07:00
@@ -665,6 +665,7 @@
 extern my_bool has_path(const char *name);
 extern char *convert_dirname(char *to, const char *from, const char *from_end);
 extern void to_unix_path(my_string name);
+extern void to_lower_case_table_path(my_string name, CHARSET_INFO *files_charset_info);
 extern my_string fn_ext(const char *name);
 extern my_string fn_same(my_string toname,const char *name,int flag);
 extern my_string fn_format(my_string to,const char *name,const char *dir,

--- 1.70/mysys/Makefile.am	2006-09-11 03:03:06 -07:00
+++ 1.71/mysys/Makefile.am	2006-09-11 03:03:06 -07:00
@@ -40,6 +40,7 @@
 			mf_format.c mf_same.c mf_dirname.c mf_fn_ext.c \
 			my_symlink.c my_symlink2.c \
 			mf_pack.c mf_unixpath.c mf_strip.c \
+			mf_lowercasetable.c \
 			mf_wcomp.c mf_wfile.c my_gethwaddr.c \
 			mf_qsort.c mf_qsort2.c mf_sort.c \
 			ptr_cmp.c mf_radix.c queues.c \

--- 1.217/sql/handler.cc	2006-09-11 03:03:06 -07:00
+++ 1.218/sql/handler.cc	2006-09-11 03:03:06 -07:00
@@ -1327,7 +1327,7 @@
   {
     /* Ensure that table handler get path in lower case */
     strmov(tmp_path, path);
-    my_casedn_str(files_charset_info, tmp_path);
+    to_lower_case_table_path(tmp_path, files_charset_info);
     path= tmp_path;
   }
   if ((error= file->delete_table(path)) && generate_warning)
@@ -2192,7 +2192,7 @@
   {
     /* Ensure that handler gets name in lower case */
     strmov(name_buff, name);
-    my_casedn_str(files_charset_info, name_buff);
+    to_lower_case_table_path(name_buff, files_charset_info);
     name= name_buff;
   }
 
@@ -2256,7 +2256,7 @@
       !(table.file->table_flags() & HA_FILE_BASED))
   {
     /* Ensure that handler gets name in lower case */
-    my_casedn_str(files_charset_info, path);
+    to_lower_case_table_path(path, files_charset_info);
   }
   error=table.file->create(path,&table,&create_info);
   VOID(closefrm(&table));

--- 1.321/sql/sql_table.cc	2006-09-11 03:03:06 -07:00
+++ 1.322/sql/sql_table.cc	2006-09-11 03:03:06 -07:00
@@ -1654,8 +1654,6 @@
     my_snprintf(path, sizeof(path), "%s%s%lx_%lx_%x%s",
 		mysql_tmpdir, tmp_file_prefix, current_pid, thd->thread_id,
 		thd->tmp_table++, reg_ext);
-    if (lower_case_table_names)
-      my_casedn_str(files_charset_info, path);
     create_info->table_options|=HA_CREATE_DELAY_KEY_WRITE;
   }
   else  
@@ -2721,7 +2719,7 @@
     /* 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);
+      to_lower_case_table_path(src_path, files_charset_info);
     if (access(src_path, F_OK))
     {
       my_error(ER_BAD_TABLE_ERROR, MYF(0), src_table);
@@ -2751,8 +2749,6 @@
     my_snprintf(dst_path, sizeof(dst_path), "%s%s%lx_%lx_%x%s",
 		mysql_tmpdir, tmp_file_prefix, current_pid,
 		thd->thread_id, thd->tmp_table++, reg_ext);
-    if (lower_case_table_names)
-      my_casedn_str(files_charset_info, dst_path);
     create_info->table_options|= HA_CREATE_DELAY_KEY_WRITE;
   }
   else
--- New file ---
+++ mysys/mf_lowercasetable.c	06/09/11 03:02:43
/* Copyright (C) 2000 MySQL AB

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */

#include "mysys_priv.h"

        /* convert filename database/table component to lowercase */

void to_lower_case_table_path(my_string name, CHARSET_INFO *files_charset_info)
{
  char orig;
  uint pos1, pos2;

  /* Find start of table name */
  pos1 = dirname_length(name);

  /* Find start of database name */
  orig = name[pos1];
  name[pos1] = 0;

  pos2 = dirname_length(name);

  name[pos1] = orig;

  /* Last, do the conversion */
  my_casedn_str(files_charset_info, name + pos2);
}

Thread
bk commit into 5.0 tree (igreenhoe:1.2272) BUG#16323Ian Greenhoe11 Sep