List:Commits« Previous MessageNext Message »
From:Ian Greenhoe Date:July 26 2006 3:31am
Subject:bk commit into 4.1 tree (igreenhoe:1.2518) BUG#16635
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 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-07-25 18:31:08-07:00, igreenhoe@stripped +5 -0
  Fix for bug #16635:  Error messages using absolute path names.

  sql/handler.cc@stripped, 2006-07-25 18:31:01-07:00, igreenhoe@stripped
+3 -3
    Added extra parameter to ha_create_table to be used in error printing.

  sql/handler.h@stripped, 2006-07-25 18:31:02-07:00, igreenhoe@stripped +2
-2
    Added extra parameter to ha_create_table to be used in error printing.

  sql/sql_delete.cc@stripped, 2006-07-25 18:31:02-07:00,
igreenhoe@stripped +2 -2
    Added extra parameter to ha_create_table to be used in error printing.
    When not needed, this parameter should equal the first parameter.

  sql/sql_table.cc@stripped, 2006-07-25 18:31:02-07:00, igreenhoe@stripped
+9 -3
    Added extra parameter to ha_create_table to be used in error printing.
    
    Also created new versions of from and to for printing errors when
    renaming a table.

  sql/unireg.cc@stripped, 2006-07-25 18:31:02-07:00, igreenhoe@stripped +5
-1
    Added extra parameter to ha_create_table to be used in error printing.

# 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-4.1-16635

--- 1.171/sql/handler.cc	2006-07-25 18:31:15 -07:00
+++ 1.172/sql/handler.cc	2006-07-25 18:31:15 -07:00
@@ -1305,8 +1305,8 @@
   Returns 1 if something got wrong
 */
 
-int ha_create_table(const char *name, HA_CREATE_INFO *create_info,
-		    bool update_create_info)
+int ha_create_table(const char *name, const char *short_name,
+                    HA_CREATE_INFO *create_info, bool update_create_info)
 {
   int error;
   TABLE table;
@@ -1331,7 +1331,7 @@
   error=table.file->create(name,&table,create_info);
   VOID(closefrm(&table));
   if (error)
-    my_error(ER_CANT_CREATE_TABLE,MYF(ME_BELL+ME_WAITTANG),name,error);
+    my_error(ER_CANT_CREATE_TABLE,MYF(ME_BELL+ME_WAITTANG),short_name,error);
   DBUG_RETURN(error != 0);
 }
 

--- 1.144/sql/handler.h	2006-07-25 18:31:15 -07:00
+++ 1.145/sql/handler.h	2006-07-25 18:31:15 -07:00
@@ -547,8 +547,8 @@
 void ha_close_connection(THD* thd);
 enum db_type ha_checktype(enum db_type database_type);
 my_bool ha_storage_engine_is_enabled(enum db_type database_type);
-int ha_create_table(const char *name, HA_CREATE_INFO *create_info,
-		    bool update_create_info);
+int ha_create_table(const char *name, const char *short_name,
+                    HA_CREATE_INFO *create_info, bool update_create_info);
 int ha_create_table_from_engine(THD* thd, const char *db, const char *name);
 int ha_delete_table(enum db_type db_type, const char *path);
 void ha_drop_database(char* path);

--- 1.139/sql/sql_delete.cc	2006-07-25 18:31:15 -07:00
+++ 1.140/sql/sql_delete.cc	2006-07-25 18:31:15 -07:00
@@ -644,7 +644,7 @@
     if (thd->slave_thread)
       --slave_open_temp_tables;
     *fn_ext(path)=0;				// Remove the .frm extension
-    ha_create_table(path, &create_info,1);
+    ha_create_table(path,path,&create_info,1);
     // We don't need to call invalidate() because this table is not in cache
     if ((error= (int) !(open_temporary_table(thd, path, table_list->db,
 					     table_list->real_name, 1))))
@@ -676,7 +676,7 @@
   }
 
   *fn_ext(path)=0;				// Remove the .frm extension
-  error= ha_create_table(path,&create_info,1) ? -1 : 0;
+  error= ha_create_table(path,path,&create_info,1) ? -1 : 0;
   query_cache_invalidate3(thd, table_list, 0); 
 
 end:

--- 1.307/sql/sql_table.cc	2006-07-25 18:31:15 -07:00
+++ 1.308/sql/sql_table.cc	2006-07-25 18:31:15 -07:00
@@ -1669,6 +1669,7 @@
 		   const char *new_name)
 {
   char from[FN_REFLEN], to[FN_REFLEN], lc_from[FN_REFLEN], lc_to[FN_REFLEN];
+  char from_short[FN_REFLEN], to_short[FN_REFLEN];
   char *from_base= from, *to_base= to;
   char tmp_name[NAME_LEN+1];
   handler *file=get_new_handler((TABLE*) 0, base);
@@ -1678,6 +1679,9 @@
   build_table_path(from, sizeof(from), old_db, old_name, "");
   build_table_path(to, sizeof(to), new_db, new_name, "");
 
+  strxmov(from_short, "./", old_db, "/", old_name, NullS);
+  strxmov(to_short, "./", new_db, "/", new_name, NullS);
+
   /*
     If lower_case_table_names == 2 (case-preserving but case-insensitive
     file system) and the storage is not HA_FILE_BASED, we need to provide
@@ -1709,7 +1713,7 @@
   if (error == HA_ERR_WRONG_COMMAND)
     my_error(ER_NOT_SUPPORTED_YET, MYF(0), "ALTER TABLE");
   else if (error)
-    my_error(ER_ERROR_ON_RENAME, MYF(0), from, to, error);
+    my_error(ER_ERROR_ON_RENAME, MYF(0), from_short, to_short, error);
   DBUG_RETURN(error != 0);
 }
 
@@ -2378,7 +2382,7 @@
 			    Table_ident *table_ident)
 {
   TABLE **tmp_table;
-  char src_path[FN_REFLEN], dst_path[FN_REFLEN];
+  char src_path[FN_REFLEN], dst_path[FN_REFLEN], dst_short[FN_REFLEN];
   char *db= table->db;
   char *table_name= table->real_name;
   char *src_db;
@@ -2441,6 +2445,7 @@
     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);
+    strmov(dst_short, dst_path);
     if (lower_case_table_names)
       my_casedn_str(files_charset_info, dst_path);
     create_info->table_options|= HA_CREATE_DELAY_KEY_WRITE;
@@ -2449,6 +2454,7 @@
   {
     strxmov(dst_path, mysql_data_home, "/", db, "/", table_name,
 	    reg_ext, NullS);
+    strxmov(dst_short, "./", db, "/", table_name, reg_ext, NullS);
     fn_format(dst_path, dst_path, "", "", MYF(MY_UNPACK_FILENAME));
     if (!access(dst_path, F_OK))
       goto table_exists;
@@ -2472,7 +2478,7 @@
     and temporary tables).
   */
   *fn_ext(dst_path)= 0;
-  err= ha_create_table(dst_path, create_info, 1);
+  err= ha_create_table(dst_path, dst_short, create_info, 1);
 
   if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
   {

--- 1.49/sql/unireg.cc	2006-07-25 18:31:15 -07:00
+++ 1.50/sql/unireg.cc	2006-07-25 18:31:15 -07:00
@@ -238,12 +238,16 @@
 		     List<create_field> &create_fields,
 		     uint keys, KEY *key_info)
 {
+  char short_name[FN_REFLEN];
+
   DBUG_ENTER("rea_create_table");
 
   if (mysql_create_frm(thd, file_name, db, table, create_info,
   		       create_fields, keys, key_info, NULL))
     DBUG_RETURN(1);
-  if (ha_create_table(file_name,create_info,0))
+
+  strxmov(short_name, "./", db, "/", table, reg_ext, NullS);
+  if (ha_create_table(file_name,short_name,create_info,0))
   {
     my_delete(file_name,MYF(0));    
     DBUG_RETURN(1);
Thread
bk commit into 4.1 tree (igreenhoe:1.2518) BUG#16635Ian Greenhoe26 Jul