List:Commits« Previous MessageNext Message »
From:monty Date:February 22 2007 2:47pm
Subject:bk commit into 5.0 tree (monty:1.2420)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of monty. When monty 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, 2007-02-22 15:47:52+02:00, monty@stripped +24 -0
  Fixed compiler warnings (for linux and win32 and win64)

  client/mysqltest.c@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +7 -7
    Removed compiler warnings

  extra/yassl/include/openssl/ssl.h@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +6 -2
    Changed prototype for SSL_set_fd() to fix compiler warnings (and possible errors) on windows 64 bit

  extra/yassl/include/socket_wrapper.hpp@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +2 -4
    Moved socket_t to ssl.h, to be able to removed compiler warnings on windows 64 bit

  extra/yassl/src/ssl.cpp@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +1 -1
    Changed prototype for SSL_set_fd() to fix compiler warnings (and possible errors) on windows 64 bit

  extra/yassl/taocrypt/src/integer.cpp@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +1 -1
    Fixed compiler warnings

  include/my_global.h@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +15 -0
    Added my_offsetof() macro from 5.1 to get rid of compiler warnings

  innobase/include/ut0byte.ic@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +2 -2
    Fixed compiler warnings on win64

  innobase/include/ut0ut.ic@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +1 -1
    Fixed compiler warnings on win64

  libmysql/libmysql.def@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +0 -1
    Fixed compiler warnings on win64

  myisam/mi_packrec.c@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +1 -1
    Fixed compiler warnings on win64

  mysys/base64.c@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +2 -2
    Fixed compiler warnings on win64

  mysys/my_thr_init.c@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +3 -3
    Fixed compiler warnings

  ndb/include/kernel/signaldata/DictTabInfo.hpp@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +5 -5
    Fixed compiler warnings

  server-tools/instance-manager/mysql_connection.cc@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +1 -1
    Fixed compiler warnings

  server-tools/instance-manager/mysqlmanager.cc@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +1 -1
    Fixed compiler warnings

  sql/ha_berkeley.cc@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +10 -0
    Moved get_auto_primary_key() here as int5store() gives (wrong) compiler warnings in win64

  sql/ha_berkeley.h@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +1 -7
    Moved get_auto_primary_key() to ha_berkeley.cc

  sql/ha_innodb.cc@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +6 -3
    Fixed compiler warnings

  sql/item_timefunc.cc@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +1 -1
    Fixed compiler warnings

  sql/mysqld.cc@stripped, 2007-02-22 15:47:50+02:00, monty@stripped +2 -2
    Fixed compiler warnings

  sql/sql_select.cc@stripped, 2007-02-22 15:47:51+02:00, monty@stripped +1 -1
    Fixed compiler warnings

  sql/sql_show.cc@stripped, 2007-02-22 15:47:51+02:00, monty@stripped +4 -3
    Fixed compiler warnings

  sql/udf_example.def@stripped, 2007-02-22 15:47:51+02:00, monty@stripped +0 -1
    Fixed compiler warnings on win64

  support-files/compiler_warnings.supp@stripped, 2007-02-22 15:47:51+02:00, monty@stripped +8 -0
    Added warnings from sql_yacc.cc that are hard to remove

# 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:	monty
# Host:	narttu.mysql.fi
# Root:	/home/my/mysql-5.0

--- 1.41/myisam/mi_packrec.c	2007-01-22 11:31:53 +02:00
+++ 1.42/myisam/mi_packrec.c	2007-02-22 15:47:50 +02:00
@@ -564,7 +564,7 @@
   */
   value|= (max_bits - bits) << 8 | IS_CHAR;
 
-  for (end= table + (1 << bits); table < end; table++)
+  for (end= table + ((uint) 1 << bits); table < end; table++)
   {
     *table= (uint16) value;
   }

--- 1.40/mysys/my_thr_init.c	2007-02-20 11:01:52 +02:00
+++ 1.41/mysys/my_thr_init.c	2007-02-22 15:47:50 +02:00
@@ -54,8 +54,8 @@
  race conditions in NPTL pthread_exit code.
 */
 
-static
-pthread_handler_t nptl_pthread_exit_hack_handler(void *arg)
+static pthread_handler_t
+nptl_pthread_exit_hack_handler(void *arg __attribute__((unused)))
 {
   /* Do nothing! */
   pthread_exit(0);
@@ -400,9 +400,9 @@
 
 static uint get_thread_lib(void)
 {
+#ifdef _CS_GNU_LIBPTHREAD_VERSION
   char buff[64];
     
-#ifdef _CS_GNU_LIBPTHREAD_VERSION
   confstr(_CS_GNU_LIBPTHREAD_VERSION, buff, sizeof(buff));
 
   if (!strncasecmp(buff, "NPTL", 4))

--- 1.165/sql/ha_berkeley.cc	2006-12-30 22:02:06 +02:00
+++ 1.166/sql/ha_berkeley.cc	2007-02-22 15:47:50 +02:00
@@ -233,6 +233,7 @@
   return 0;
 }
 
+
 bool berkeley_flush_logs()
 {
   int error;
@@ -436,6 +437,15 @@
     }
   }
   return flags;
+}
+
+
+void ha_berkeley::get_auto_primary_key(byte *to)
+{
+  pthread_mutex_lock(&share->mutex);
+  share->auto_ident++;
+  int5store(to,share->auto_ident);
+  pthread_mutex_unlock(&share->mutex);
 }
 
 

--- 1.80/sql/ha_berkeley.h	2006-12-30 22:02:06 +02:00
+++ 1.81/sql/ha_berkeley.h	2007-02-22 15:47:50 +02:00
@@ -141,13 +141,7 @@
 			     enum thr_lock_type lock_type);
 
   void get_status();
-  inline void get_auto_primary_key(byte *to)
-  {
-    pthread_mutex_lock(&share->mutex);
-    share->auto_ident++;
-    int5store(to,share->auto_ident);
-    pthread_mutex_unlock(&share->mutex);
-  }
+  void get_auto_primary_key(byte *to);
   ulonglong get_auto_increment();
   void print_error(int error, myf errflag);
   uint8 table_cache_type() { return HA_CACHE_TBL_TRANSACT; }

--- 1.140/sql/item_timefunc.cc	2007-02-21 13:05:00 +02:00
+++ 1.141/sql/item_timefunc.cc	2007-02-22 15:47:50 +02:00
@@ -1608,7 +1608,7 @@
 void Item_func_sysdate_local::store_now_in_TIME(TIME *now_time)
 {
   THD *thd= current_thd;
-  thd->variables.time_zone->gmt_sec_to_TIME(now_time, time(NULL));
+  thd->variables.time_zone->gmt_sec_to_TIME(now_time, (my_time_t) time(NULL));
   thd->time_zone_used= 1;
 }
 

--- 1.588/sql/mysqld.cc	2007-02-21 14:07:05 +02:00
+++ 1.589/sql/mysqld.cc	2007-02-22 15:47:50 +02:00
@@ -324,6 +324,7 @@
 #ifndef EMBEDDED_LIBRARY
 static struct passwd *user_info;
 static pthread_t select_thread;
+static uint thr_kill_signal;
 #endif
 
 static pthread_cond_t COND_thread_cache, COND_flush_thread_cache;
@@ -522,7 +523,6 @@
 pthread_cond_t COND_refresh,COND_thread_count, COND_global_read_lock;
 pthread_t signal_thread;
 pthread_attr_t connection_attrib;
-static uint thr_kill_signal;
 
 File_parser_dummy_hook file_parser_dummy_hook;
 
@@ -3216,7 +3216,7 @@
 #ifdef HAVE_REPLICATION
   if (opt_bin_log && expire_logs_days)
   {
-    long purge_time= time(0) - expire_logs_days*24*60*60;
+    long purge_time= (long) (time(0) - expire_logs_days*24*60*60);
     if (purge_time >= 0)
       mysql_bin_log.purge_logs_before_date(purge_time);
   }

--- 1.492/sql/sql_select.cc	2007-02-21 13:05:03 +02:00
+++ 1.493/sql/sql_select.cc	2007-02-22 15:47:51 +02:00
@@ -8081,7 +8081,7 @@
       */
       if (nested_join->join_list.elements != 1)
       {
-        nested_join->nj_map= 1 << first_unused++;
+        nested_join->nj_map= (nested_join_map) 1 << first_unused++;
         first_unused= build_bitmap_for_nested_joins(&nested_join->join_list,
                                                     first_unused);
       }

--- 1.340/sql/sql_show.cc	2007-02-21 13:05:03 +02:00
+++ 1.341/sql/sql_show.cc	2007-02-22 15:47:51 +02:00
@@ -2515,20 +2515,21 @@
     if (file->create_time)
     {
       thd->variables.time_zone->gmt_sec_to_TIME(&time,
-                                                file->create_time);
+                                                (my_time_t) file->create_time);
       table->field[14]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
       table->field[14]->set_notnull();
     }
     if (file->update_time)
     {
       thd->variables.time_zone->gmt_sec_to_TIME(&time,
-                                                file->update_time);
+                                                (my_time_t) file->update_time);
       table->field[15]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
       table->field[15]->set_notnull();
     }
     if (file->check_time)
     {
-      thd->variables.time_zone->gmt_sec_to_TIME(&time, file->check_time);
+      thd->variables.time_zone->gmt_sec_to_TIME(&time,
+                                                (my_time_t) file->check_time);
       table->field[16]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
       table->field[16]->set_notnull();
     }

--- 1.2/sql/udf_example.def	2006-11-16 17:19:27 +02:00
+++ 1.3/sql/udf_example.def	2007-02-22 15:47:51 +02:00
@@ -1,5 +1,4 @@
 LIBRARY		udf_example
-DESCRIPTION	'MySQL Sample for UDF'
 VERSION		1.0
 EXPORTS
   lookup

--- 1.3/support-files/compiler_warnings.supp	2007-02-21 19:38:39 +02:00
+++ 1.4/support-files/compiler_warnings.supp	2007-02-22 15:47:51 +02:00
@@ -2,3 +2,11 @@
 DictTabInfo.cpp : .*macro was used incorrectly.*
 DbdihMain.cpp : .*unused variable.* : 6666-6705
 DbtupExecQuery.cpp : .*unused variable.* : 1448-1449
+sql_yacc.cc : .*switch statement contains 'default' but no 'case' labels.*
+
+#
+# Ignore all conversion warnings on windows 64
+# (Is safe as we are not yet supporting strings >= 2G)
+#
+*: conversion from 'size_t' to .*int'.*
+*: conversion from '__int64' to .*int'.*

--- 1.19/server-tools/instance-manager/mysqlmanager.cc	2006-12-30 22:02:06 +02:00
+++ 1.20/server-tools/instance-manager/mysqlmanager.cc	2007-02-22 15:47:50 +02:00
@@ -199,7 +199,7 @@
   MY_INIT(progname);
   log_init();
   umask(0117);
-  srand(time(0));
+  srand((uint) time(0));
 }
 
 

--- 1.23/ndb/include/kernel/signaldata/DictTabInfo.hpp	2007-01-22 14:10:37 +02:00
+++ 1.24/ndb/include/kernel/signaldata/DictTabInfo.hpp	2007-02-22 15:47:50 +02:00
@@ -46,17 +46,17 @@
 #endif
 
 #define DTIMAP(x, y, z) \
-  { DictTabInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, 0, (~0), 0 }
+  { DictTabInfo::y, my_offsetof(x, z), SimpleProperties::Uint32Value, 0, (~0), 0 }
 
 #define DTIMAP2(x, y, z, u, v) \
-  { DictTabInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, u, v, 0 }
+  { DictTabInfo::y, my_offsetof(x, z), SimpleProperties::Uint32Value, u, v, 0 }
 
 #define DTIMAPS(x, y, z, u, v) \
-  { DictTabInfo::y, offsetof(x, z), SimpleProperties::StringValue, u, v, 0 }
+  { DictTabInfo::y, my_offsetof(x, z), SimpleProperties::StringValue, u, v, 0 }
 
 #define DTIMAPB(x, y, z, u, v, l) \
-  { DictTabInfo::y, offsetof(x, z), SimpleProperties::BinaryValue, u, v, \
-                     offsetof(x, l) }
+  { DictTabInfo::y, my_offsetof(x, z), SimpleProperties::BinaryValue, u, v, \
+                     my_offsetof(x, l) }
 
 #define DTIBREAK(x) \
   { DictTabInfo::x, 0, SimpleProperties::InvalidValue, 0, 0, 0 }

--- 1.14/mysys/base64.c	2006-12-23 21:04:07 +02:00
+++ 1.15/mysys/base64.c	2007-02-22 15:47:50 +02:00
@@ -98,10 +98,10 @@
 }
 
 
-static inline unsigned
+static inline uint
 pos(unsigned char c)
 {
-  return strchr(base64_table, c) - base64_table;
+  return (uint) (strchr(base64_table, c) - base64_table);
 }
 
 

--- 1.44/libmysql/libmysql.def	2006-04-22 01:48:08 +03:00
+++ 1.45/libmysql/libmysql.def	2007-02-22 15:47:50 +02:00
@@ -1,5 +1,4 @@
 LIBRARY		LIBMYSQL
-DESCRIPTION	'MySQL 5.0 Client Library'
 VERSION		6.0
 EXPORTS
 	_dig_vec_lower

--- 1.4/innobase/include/ut0byte.ic	2004-12-02 19:42:32 +02:00
+++ 1.5/innobase/include/ut0byte.ic	2007-02-22 15:47:50 +02:00
@@ -388,8 +388,8 @@
 	ut_ad(TRUE == 1);
 
 	if (val) {
-		return((1 << n) | a);
+		return(((ulint) 1 << n) | a);
 	} else {
-		return(~(1 << n) & a);
+		return(~((ulint) 1 << n) & a);
 	}
 }

--- 1.3/innobase/include/ut0ut.ic	2003-10-07 17:19:31 +03:00
+++ 1.4/innobase/include/ut0ut.ic	2007-02-22 15:47:50 +02:00
@@ -170,5 +170,5 @@
 			/* out: 2 to power n */
 	ulint	n)	/* in: number */
 {
-	return(1 << n);
+	return((ulint) 1 << n);
 }

--- 1.307/sql/ha_innodb.cc	2006-12-23 21:04:24 +02:00
+++ 1.308/sql/ha_innodb.cc	2007-02-22 15:47:50 +02:00
@@ -2711,7 +2711,8 @@
 				true_len = (ulint) cs->cset->well_formed_len(cs,
 						(const char *) data,
 						(const char *) data + len,
-						key_len / cs->mbmaxlen,
+                                                (uint) (key_len /
+                                                        cs->mbmaxlen),
 						&error);
 			}
 
@@ -2780,7 +2781,8 @@
 						(const char *) blob_data,
 						(const char *) blob_data
 							+ blob_len,
-						key_len / cs->mbmaxlen,
+                                                (uint) (key_len /
+                                                        cs->mbmaxlen),
 						&error);
 			}
 
@@ -2852,7 +2854,8 @@
 							(const char *)src_start,
 							(const char *)src_start
 								+ key_len,
-							key_len / cs->mbmaxlen,
+                                                        (uint) (key_len /
+                                                                cs->mbmaxlen),
 							&error);
 				}
 			}

--- 1.135/include/my_global.h	2007-02-21 13:04:55 +02:00
+++ 1.136/include/my_global.h	2007-02-22 15:47:50 +02:00
@@ -846,6 +846,21 @@
 #define ADD_TO_PTR(ptr,size,type) (type) ((byte*) (ptr)+size)
 #define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((byte*) (A) - (byte*) (B))
 
+/*
+  Custom version of standard offsetof() macro which can be used to get
+  offsets of members in class for non-POD types (according to the current
+  version of C++ standard offsetof() macro can't be used in such cases and
+  attempt to do so causes warnings to be emitted, OTOH in many cases it is
+  still OK to assume that all instances of the class has the same offsets
+  for the same members).
+
+  This is temporary solution which should be removed once File_parser class
+  and related routines are refactored.
+*/
+
+#define my_offsetof(TYPE, MEMBER) \
+        ((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10))
+
 #define NullS		(char *) 0
 /* Nowdays we do not support MessyDos */
 #ifndef NEAR

--- 1.275/client/mysqltest.c	2007-01-22 14:10:36 +02:00
+++ 1.276/client/mysqltest.c	2007-02-22 15:47:50 +02:00
@@ -1844,7 +1844,7 @@
 
 void do_chmod_file(struct st_command *command)
 {
-  ulong mode= 0;
+  long mode= 0;
   static DYNAMIC_STRING ds_mode;
   static DYNAMIC_STRING ds_file;
   const struct command_arg chmod_file_args[] = {
@@ -1864,7 +1864,7 @@
     die("You must write a 4 digit octal number for mode");
 
   DBUG_PRINT("info", ("chmod %o %s", (uint)mode, ds_file.str));
-  handle_command_error(command, chmod(ds_file.str, mode));
+  handle_command_error(command, chmod(ds_file.str, (mode_t) mode));
   dynstr_free(&ds_mode);
   dynstr_free(&ds_file);
   DBUG_VOID_RETURN;
@@ -6666,7 +6666,7 @@
         we need at least what we have so far in the buffer + the part
         before this match
       */
-      need_buf_len= (res_p - buf) + subs[0].rm_so;
+      need_buf_len= (res_p - buf) + (int) subs[0].rm_so;
 
       /* on this pass, calculate the memory for the result buffer */
       while (expr_p < replace_end)
@@ -6676,17 +6676,17 @@
 
         if (c == '\\' && expr_p + 1 < replace_end)
         {
-          back_ref_num= expr_p[1] - '0';
+          back_ref_num= (int) (expr_p[1] - '0');
         }
 
         /* found a valid back_ref (eg. \1)*/
         if (back_ref_num >= 0 && back_ref_num <= (int)r.re_nsub)
         {
-          int start_off,end_off;
+          regoff_t start_off, end_off;
           if ((start_off=subs[back_ref_num].rm_so) > -1 &&
               (end_off=subs[back_ref_num].rm_eo) > -1)
           {
-            need_buf_len += (end_off - start_off);
+            need_buf_len += (int) (end_off - start_off);
           }
           expr_p += 2;
         }
@@ -6706,7 +6706,7 @@
         /* copy the pre-match part */
         if (subs[0].rm_so)
         {
-          memcpy(res_p, str_p, subs[0].rm_so);
+          memcpy(res_p, str_p, (size_t) subs[0].rm_so);
           res_p+= subs[0].rm_so;
         }
 

--- 1.18/server-tools/instance-manager/mysql_connection.cc	2007-01-22 14:10:38 +02:00
+++ 1.19/server-tools/instance-manager/mysql_connection.cc	2007-02-22 15:47:50 +02:00
@@ -135,7 +135,7 @@
   /* Initialize random number generator */
   {
     ulong seed1= (ulong) &rand_st + rand();
-    ulong seed2= rand() + time(0);
+    ulong seed2= rand() + (ulong) time(0);
     randominit(&rand_st, seed1, seed2);
   }
   /* Fill scramble - server's random message used for handshake */

--- 1.20/extra/yassl/include/openssl/ssl.h	2007-01-10 20:27:15 +02:00
+++ 1.21/extra/yassl/include/openssl/ssl.h	2007-02-22 15:47:50 +02:00
@@ -33,7 +33,6 @@
 #include "opensslv.h" /* for version number */
 #include "rsa.h"
 
-
 #define YASSL_VERSION "1.5.8"
 
 
@@ -190,11 +189,16 @@
     EVP_R_BAD_DECRYPT = 2
 };
 
+#ifdef WIN
+    typedef SOCKET socket_t;
+#else
+    typedef int socket_t;
+#endif
 
 
 SSL_CTX* SSL_CTX_new(SSL_METHOD*);
 SSL* SSL_new(SSL_CTX*);
-int  SSL_set_fd (SSL*, int);
+int  SSL_set_fd (SSL*, socket_t);
 int  SSL_connect(SSL*);
 int  SSL_write(SSL*, const void*, int);
 int  SSL_read(SSL*, void*, int);

--- 1.10/extra/yassl/include/socket_wrapper.hpp	2006-11-02 20:10:43 +02:00
+++ 1.11/extra/yassl/include/socket_wrapper.hpp	2007-02-22 15:47:50 +02:00
@@ -38,16 +38,14 @@
     #include <netinet/in.h>
     #include <arpa/inet.h>
 #endif
+#include "openssl/ssl.h"                        /* for socket_t */
 
 
 namespace yaSSL {
 
 typedef unsigned int uint;
 
-#ifdef _WIN32
-    typedef SOCKET socket_t;
-#else
-    typedef int socket_t;
+#ifndef _WIN32
     const socket_t INVALID_SOCKET = -1;
     const int SD_RECEIVE   = 0;
     const int SD_SEND      = 1;

--- 1.25/extra/yassl/src/ssl.cpp	2007-02-21 19:38:38 +02:00
+++ 1.26/extra/yassl/src/ssl.cpp	2007-02-22 15:47:50 +02:00
@@ -229,7 +229,7 @@
 }
 
 
-int SSL_set_fd(SSL* ssl, int fd)
+int SSL_set_fd(SSL* ssl, socket_t fd)
 {
     ssl->useSocket().set_fd(fd);
     return SSL_SUCCESS;

--- 1.28/extra/yassl/taocrypt/src/integer.cpp	2007-01-25 20:34:38 +02:00
+++ 1.29/extra/yassl/taocrypt/src/integer.cpp	2007-02-22 15:47:50 +02:00
@@ -3390,7 +3390,7 @@
         CopyWords(r.reg_.get_buffer(), a.reg_.get_buffer(), wordCount);
         SetWords(r.reg_+wordCount, 0, r.reg_.size()-wordCount);
         if (n % WORD_BITS != 0)
-            r.reg_[wordCount-1] %= (1 << (n % WORD_BITS));
+          r.reg_[wordCount-1] %= ((word) 1 << (n % WORD_BITS));
     }
     else
     {
Thread
bk commit into 5.0 tree (monty:1.2420)monty22 Feb