List:Commits« Previous MessageNext Message »
From:reggie Date:January 9 2006 11:35pm
Subject:bk commit into 5.1 tree (reggie:1.2016)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of reggie. When reggie 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
  1.2016 06/01/09 17:35:25 reggie@stripped +4 -0
  Merge rburnett@stripped:/home/bk/mysql-5.1-new
  into  linux.site:/home/reggie/work/mysql-5.1-rbr_cleanups

  sql/sql_class.cc
    1.233 06/01/09 17:35:20 reggie@stripped +0 -4
    accepted Mat's changes to the template defs

  sql/log_event.h
    1.125 06/01/09 17:31:49 reggie@stripped +0 -0
    Auto merged

  sql/log_event.cc
    1.195 06/01/09 17:31:48 reggie@stripped +0 -0
    Auto merged

  sql/handler.cc
    1.207 06/01/09 17:31:48 reggie@stripped +0 -1
    Auto merged

# 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:	reggie
# Host:	linux.site
# Root:	/home/reggie/work/mysql-5.1-rbr_cleanups/RESYNC

--- 1.194/sql/log_event.cc	2006-01-03 22:37:07 -06:00
+++ 1.195/sql/log_event.cc	2006-01-09 17:31:48 -06:00
@@ -118,13 +118,24 @@
 
 
 /*
-  slave_load_file_stem()
+  Creates a temporary name for load data infile:
+
+  SYNOPSIS
+    slave_load_file_stem()
+    buf		      Store new filename here
+    file_id	      File_id (part of file name)
+    event_server_id   Event_id (part of file name)
+    ext		      Extension for file name
+
+  RETURN
+    Pointer to start of extension
 */
 
 #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
-static inline char* slave_load_file_stem(char*buf, uint file_id,
-					 int event_server_id)
+static char *slave_load_file_stem(char *buf, uint file_id,
+                                  int event_server_id, const char *ext)
 {
+  char *res;
   fn_format(buf,"SQL_LOAD-",slave_load_tmpdir, "", MY_UNPACK_FILENAME);
   to_unix_path(buf);
 
@@ -133,7 +144,9 @@
   *buf++ = '-';
   buf = int10_to_str(event_server_id, buf, 10);
   *buf++ = '-';
-  return int10_to_str(file_id, buf, 10);
+  res= int10_to_str(file_id, buf, 10);
+  strmov(res, ext);                             // Add extension last
+  return res;                                   // Pointer to extension
 }
 #endif
 
@@ -928,7 +941,6 @@
     /* Pretty-print event common header if header is exactly 19 bytes */
     if (print_event_info->common_header_len == LOG_EVENT_MINIMAL_HEADER_LEN)
     {
-      DBUG_ASSERT(hexdump_from == (unsigned long) hexdump_from);
       fprintf(file, "# Position  Timestamp   Type   Master ID        "
 	      "Size      Master Pos    Flags \n");
       fprintf(file, "# %8.8lx %02x %02x %02x %02x   %02x   "
@@ -954,7 +966,6 @@
 
       if (i % 16 == 15)
       {
-        DBUG_ASSERT(hexdump_from == (unsigned long) hexdump_from);
 	fprintf(file, "# %8.8lx %-48.48s |%16s|\n",
 		(unsigned long) (hexdump_from + (i & 0xfffffff0)),
                 hex_string, char_string);
@@ -968,12 +979,10 @@
     *c= '\0';
 
     /* Non-full last line */
-    if (hex_string[0]) {
-      DBUG_ASSERT(hexdump_from == (unsigned long) hexdump_from);
+    if (hex_string[0])
       fprintf(file, "# %8.8lx %-48.48s |%s|\n# ",
 	     (unsigned long) (hexdump_from + (i & 0xfffffff0)),
              hex_string, char_string);
-    }
   }
 }
 
@@ -4238,16 +4247,15 @@
 #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
 int Create_file_log_event::exec_event(struct st_relay_log_info* rli)
 {
-  char proc_info[17+FN_REFLEN+10], *fname_buf= proc_info+17;
-  char *p;
+  char proc_info[17+FN_REFLEN+10], *fname_buf;
+  char *ext;
   int fd = -1;
   IO_CACHE file;
   int error = 1;
 
   bzero((char*)&file, sizeof(file));
-  p = slave_load_file_stem(fname_buf, file_id, server_id);
-  strmov(p, ".info");			// strmov takes less code than memcpy
-  strnmov(proc_info, STRING_WITH_LEN("Making temp file ")); // no end 0
+  fname_buf= strmov(proc_info, "Making temp file ");
+  ext= slave_load_file_stem(fname_buf, file_id, server_id, ".info");
   thd->proc_info= proc_info;
   my_delete(fname_buf, MYF(0)); // old copy may exist already
   if ((fd= my_create(fname_buf, CREATE_MODE,
@@ -4262,12 +4270,11 @@
   }
   
   // a trick to avoid allocating another buffer
-  strmov(p, ".data");
-  fname = fname_buf;
-  fname_len = (uint)(p-fname) + 5;
+  fname= fname_buf;
+  fname_len= (uint) (strmov(ext, ".data") - fname);
   if (write_base(&file))
   {
-    strmov(p, ".info"); // to have it right in the error message
+    strmov(ext, ".info"); // to have it right in the error message
     slave_print_msg(ERROR_LEVEL, rli, my_errno,
                     "Error in Create_file event: could not write to file '%s'",
                     fname_buf);
@@ -4413,13 +4420,12 @@
 int Append_block_log_event::exec_event(struct st_relay_log_info* rli)
 {
   char proc_info[17+FN_REFLEN+10], *fname= proc_info+17;
-  char *p= slave_load_file_stem(fname, file_id, server_id);
   int fd;
   int error = 1;
   DBUG_ENTER("Append_block_log_event::exec_event");
 
-  memcpy(p, ".data", 6);
-  strnmov(proc_info, STRING_WITH_LEN("Making temp file ")); // no end 0
+  fname= strmov(proc_info, "Making temp file ");
+  slave_load_file_stem(fname, file_id, server_id, ".data");
   thd->proc_info= proc_info;
   if (get_create_or_append())
   {
@@ -4545,10 +4551,9 @@
 int Delete_file_log_event::exec_event(struct st_relay_log_info* rli)
 {
   char fname[FN_REFLEN+10];
-  char *p= slave_load_file_stem(fname, file_id, server_id);
-  memcpy(p, ".data", 6);
+  char *ext= slave_load_file_stem(fname, file_id, server_id, ".data");
   (void) my_delete(fname, MYF(MY_WME));
-  memcpy(p, ".info", 6);
+  strmov(ext, ".info");
   (void) my_delete(fname, MYF(MY_WME));
   return Log_event::exec_event(rli);
 }
@@ -4641,13 +4646,13 @@
 int Execute_load_log_event::exec_event(struct st_relay_log_info* rli)
 {
   char fname[FN_REFLEN+10];
-  char *p= slave_load_file_stem(fname, file_id, server_id);
+  char *ext;
   int fd;
-  int error = 1;
+  int error= 1;
   IO_CACHE file;
-  Load_log_event* lev = 0;
+  Load_log_event *lev= 0;
 
-  memcpy(p, ".info", 6);
+  ext= slave_load_file_stem(fname, file_id, server_id, ".info");
   if ((fd = my_open(fname, O_RDONLY | O_BINARY | O_NOFOLLOW,
                     MYF(MY_WME))) < 0 ||
       init_io_cache(&file, fd, IO_SIZE, READ_CACHE, (my_off_t)0, 0,
@@ -4708,7 +4713,7 @@
     fd= -1;
   }
   (void) my_delete(fname, MYF(MY_WME));
-  memcpy(p, ".data", 6);
+  memcpy(ext, ".data", 6);
   (void) my_delete(fname, MYF(MY_WME));
   error = 0;
 
@@ -4906,11 +4911,10 @@
   memcpy(p, query, fn_pos_start);
   p+= fn_pos_start;
   fname= (p= strmake(p, STRING_WITH_LEN(" INFILE \'")));
-  p= slave_load_file_stem(p, file_id, server_id);
-  fname_end= (p= strmake(p, STRING_WITH_LEN(".data")));
+  p= slave_load_file_stem(p, file_id, server_id, ".data");
+  fname_end= p= strend(p);                      // Safer than p=p+5
   *(p++)='\'';
-  switch (dup_handling)
-  {
+  switch (dup_handling) {
   case LOAD_DUP_IGNORE:
     p= strmake(p, STRING_WITH_LEN(" IGNORE"));
     break;

--- 1.124/sql/log_event.h	2005-12-10 22:31:52 -06:00
+++ 1.125/sql/log_event.h	2006-01-09 17:31:49 -06:00
@@ -1673,8 +1673,11 @@
   {
     /* 
        Nothing here right now, but the flags support is there in
-       preparation for changes that are coming.
+       preparation for changes that are coming.  Need to add a
+       constant to make it compile under HP-UX: aCC does not like
+       empty enumerations.
     */
+    ENUM_FLAG_COUNT
   };
 
   typedef uint16 flag_set;
@@ -1682,7 +1685,7 @@
   /* Special constants representing sets of flags */
   enum 
   {
-    NO_FLAGS = 0U
+    TM_NO_FLAGS = 0U
   };
 
   void set_flags(flag_set flag) { m_flags |= flag; }

--- 1.232/sql/sql_class.cc	2006-01-09 08:59:30 -06:00
+++ 1.233/sql/sql_class.cc	2006-01-09 17:35:20 -06:00
@@ -2252,7 +2252,6 @@
 THD::binlog_prepare_pending_rows_event(TABLE*, uint32, MY_BITMAP const*,
 				       my_size_t colcnt, my_size_t, bool,
 				       Update_rows_log_event *);
-
 static char const* 
 field_type_name(enum_field_types type) 
 {
@@ -2345,7 +2344,7 @@
   for (int i= 0 ; field ; i++, p_field++, field= *p_field)
   {
     if (bitmap_is_set(cols,i))
-      ptr= field->pack(ptr, field->ptr + offset);
+      ptr= (byte*)field->pack(ptr, field->ptr + offset);
   }
 
   /*
@@ -2422,7 +2421,7 @@
   }
   else
   {
-    if (unlikely(!(row_data= my_multi_malloc(MYF(MY_WME),
+    if (unlikely(!(row_data= (byte*)my_multi_malloc(MYF(MY_WME),
                                              &before_row, before_maxlen,
                                              &after_row, after_maxlen,
                                              NULL))))
@@ -2445,7 +2444,7 @@
   if (!table->write_row_record)
   {
     /* add_row_data copies row_data to internal buffer */
-    my_free(row_data, MYF(MY_WME));
+    my_free((gptr)row_data, MYF(MY_WME));
   }
   
   return error;
@@ -2464,7 +2463,7 @@
   bool error= 0;
   my_size_t const max_len= max_row_length(table, record);
   byte *row_data= table->write_row_record;
-  if (!row_data && unlikely(!(row_data= my_malloc(max_len, MYF(MY_WME)))))
+  if (!row_data && unlikely(!(row_data= (byte*)my_malloc(max_len, MYF(MY_WME)))))
     return HA_ERR_OUT_OF_MEM;
   my_size_t const len= pack_row(table, cols, row_data, record);
 
@@ -2477,7 +2476,7 @@
 
   /* add_row_data copies row_data */
   if (table->write_row_record == 0)
-    my_free(row_data, MYF(MY_WME));
+    my_free((gptr)row_data, MYF(MY_WME));
 
   return error;
 }
Thread
bk commit into 5.1 tree (reggie:1.2016)reggie10 Jan