List:Commits« Previous MessageNext Message »
From:Tor Didriksen Date:January 11 2012 2:36pm
Subject:bzr push into mysql-trunk branch (tor.didriksen:3720 to 3722) WL#6159
View as plain text  
 3722 Tor Didriksen	2012-01-11
      WL#6159 Refactoring of my_global.h post-push fixes for sparc64
      Use the uintXkorr macros rather than uXXXget macros.

    modified:
      libmysqld/emb_qcache.cc
      sql/binlog.cc
      sql/ha_partition.cc
      sql/spatial.cc
      sql/unireg.cc
      storage/archive/ha_archive.cc
 3721 Tor Didriksen	2012-01-11
      need HAVE_purify

    modified:
      include/byteorder/byte_order_generic_x86_64.h
 3720 Tor Didriksen	2012-01-11
      fix compile warning: may be used uninitialized

    modified:
      client/mysqldump.c
=== modified file 'include/byteorder/byte_order_generic_x86_64.h'
--- a/include/byteorder/byte_order_generic_x86_64.h	2012-01-11 09:33:52 +0000
+++ b/include/byteorder/byte_order_generic_x86_64.h	2012-01-11 12:45:44 +0000
@@ -27,7 +27,17 @@
 				  ((uint32) (uchar) (A)[0])))
 #define sint4korr(A)	(int32)  (*((int32 *) (A)))
 #define uint2korr(A)	(uint16) (*((uint16 *) (A)))
+/*
+  Attention: Please, note, uint3korr reads 4 bytes (not 3)!
+  It means, that you have to provide enough allocated space.
+*/
+#if defined(HAVE_purify) && !defined(_WIN32)
+#define uint3korr(A)	(uint32) (((uint32) ((uchar) (A)[0])) +\
+				  (((uint32) ((uchar) (A)[1])) << 8) +\
+				  (((uint32) ((uchar) (A)[2])) << 16))
+#else
 #define uint3korr(A)	(uint32) (*((unsigned int *) (A)) & 0xFFFFFF)
+#endif
 #define uint4korr(A)	(uint32) (*((uint32 *) (A)))
 #define uint5korr(A)	((ulonglong)(((uint32) ((uchar) (A)[0])) +\
 				    (((uint32) ((uchar) (A)[1])) << 8) +\

=== modified file 'libmysqld/emb_qcache.cc'
--- a/libmysqld/emb_qcache.cc	2012-01-11 09:33:52 +0000
+++ b/libmysqld/emb_qcache.cc	2012-01-11 14:35:30 +0000
@@ -191,12 +191,12 @@ uint Querycache_stream::load_int()
     cur_data+= 4;
     return result;
   }
-  char buf[4];
+  char buf[4], *buf_p= buf;
   memcpy(buf, cur_data, rest_len);
   use_next_block(FALSE);
   memcpy(buf+rest_len, cur_data, 4-rest_len);
   cur_data+= 4-rest_len;
-  ulongget(result, buf);
+  result= uint4korr(buf_p);
   return result;
 }
 

=== modified file 'sql/binlog.cc'
--- a/sql/binlog.cc	2012-01-11 09:33:52 +0000
+++ b/sql/binlog.cc	2012-01-11 14:35:30 +0000
@@ -3994,15 +3994,14 @@ int MYSQL_BIN_LOG::write_cache(IO_CACHE 
              LOG_EVENT_HEADER_LEN - carry);
 
       /* fix end_log_pos */
-      ulongget(val, &header[LOG_POS_OFFSET]);
+      val=uint4korr(header + LOG_POS_OFFSET);
       val+= group +
         (end_log_pos_inc+= (do_checksum ? BINLOG_CHECKSUM_LEN : 0));
       int4store(&header[LOG_POS_OFFSET], val);
 
       if (do_checksum)
       {
-        ulong len;
-        ulongget(len, &header[EVENT_LEN_OFFSET]);
+        ulong len= uint4korr(header + EVENT_LEN_OFFSET);
         /* fix len */
         int4store(&header[EVENT_LEN_OFFSET], len + BINLOG_CHECKSUM_LEN);
       }

=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc	2012-01-11 09:33:52 +0000
+++ b/sql/ha_partition.cc	2012-01-11 14:35:30 +0000
@@ -2454,7 +2454,7 @@ error_end:
 
 bool ha_partition::read_par_file(const char *name)
 {
-  char buff[FN_REFLEN], *tot_name_len_offset;
+  char buff[FN_REFLEN], *tot_name_len_offset, *buff_p= buff;
   File file;
   char *file_buffer;
   uint i, len_bytes, len_words, tot_partition_words, tot_name_words, chksum;
@@ -2471,7 +2471,7 @@ bool ha_partition::read_par_file(const c
     DBUG_RETURN(TRUE);
   if (mysql_file_read(file, (uchar *) &buff[0], PAR_WORD_SIZE, MYF(MY_NABP)))
     goto err1;
-  ulongget(len_words, buff);
+  len_words= uint4korr(buff_p);
   len_bytes= PAR_WORD_SIZE * len_words;
   if (mysql_file_seek(file, 0, MY_SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR)
     goto err1;

=== modified file 'sql/spatial.cc'
--- a/sql/spatial.cc	2012-01-11 09:33:52 +0000
+++ b/sql/spatial.cc	2012-01-11 14:35:30 +0000
@@ -238,14 +238,12 @@ static uint32 wkb_get_uint(const char *p
     return uint4korr(ptr);
   /* else */
   {
-    char inv_array[4];
+    char inv_array[4], *inv_array_p= inv_array;
     inv_array[0]= ptr[3];
     inv_array[1]= ptr[2];
     inv_array[2]= ptr[1];
     inv_array[3]= ptr[0];
-    uint32 ret;
-    ulongget(ret, inv_array);
-    return ret;
+    return uint4korr(inv_array_p);
   }
 }
 

=== modified file 'sql/unireg.cc'
--- a/sql/unireg.cc	2012-01-11 09:33:52 +0000
+++ b/sql/unireg.cc	2012-01-11 14:35:30 +0000
@@ -121,7 +121,7 @@ bool mysql_create_frm(THD *thd, const ch
   ulong key_buff_length;
   File file;
   ulong filepos, data_offset;
-  uchar fileinfo[64],forminfo[288],*keybuff;
+  uchar fileinfo[64],forminfo[288],*keybuff, *forminfo_p= forminfo;
   uchar *screen_buff;
   char buff[128];
 #ifdef WITH_PARTITION_STORAGE_ENGINE
@@ -297,9 +297,7 @@ bool mysql_create_frm(THD *thd, const ch
 
   if (!(filepos= make_new_entry(file, fileinfo, NULL, "")))
     goto err;
-  ushort io_sz;
-  ushortget(io_sz, forminfo);
-  maxlength=(uint) next_io_size((ulong) (io_sz + 1000));
+  maxlength=(uint) next_io_size((ulong) (uint2korr(forminfo_p)+1000));
   int2store(forminfo+2,maxlength);
   int4store(fileinfo+10,(ulong) (filepos+maxlength));
   fileinfo[26]= (uchar) test((create_info->max_rows == 1) &&

=== modified file 'storage/archive/ha_archive.cc'
--- a/storage/archive/ha_archive.cc	2012-01-11 09:33:52 +0000
+++ b/storage/archive/ha_archive.cc	2012-01-11 14:35:30 +0000
@@ -1264,7 +1264,7 @@ int ha_archive::unpack_row(azio_stream *
 
   unsigned int read;
   int error;
-  uchar size_buffer[ARCHIVE_ROW_HEADER_SIZE];
+  uchar size_buffer[ARCHIVE_ROW_HEADER_SIZE], *size_buffer_p= size_buffer;
   unsigned int row_len;
 
   /* First we grab the length stored */
@@ -1277,7 +1277,7 @@ int ha_archive::unpack_row(azio_stream *
   if (read == 0 || read != ARCHIVE_ROW_HEADER_SIZE)
     DBUG_RETURN(HA_ERR_END_OF_FILE);
 
-  ulongget(row_len, size_buffer);
+  row_len= uint4korr(size_buffer_p);
   DBUG_PRINT("ha_archive",("Unpack row length %u -> %u", row_len, 
                            (unsigned int)table->s->reclength));
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (tor.didriksen:3720 to 3722) WL#6159Tor Didriksen12 Jan