List:Commits« Previous MessageNext Message »
From:Alexander Barkov Date:April 18 2012 5:53pm
Subject:bzr push into mysql-trunk branch (alexander.barkov:3877 to 3878)
View as plain text  
 3878 Alexander Barkov	2012-04-18
      Fixing "conversion from 'size_t' to 'uint', possible loss of data"
      warnings on Windows.

    modified:
      sql/item.h
      sql/sql_show.cc
      sql/sql_string.h
 3877 Georgi Kodinov	2012-04-17
      Bug #13859866: VERSION_COMPILE_MACHINE SHOWS X86 FOR 
      64-BIT BINARIES ON 64-BIT WINDOWS MACHINE
      
      Added a workaround for a cmake deficiency that caused 
      the problem.
      Now the mysql cmake files will set the compile_machine
      to x86_64 when compiling a 64 bit windows binary.

    modified:
      CMakeLists.txt
      cmake/os/Windows.cmake
      config.h.cmake
=== modified file 'sql/item.h'
--- a/sql/item.h	2012-04-17 14:37:50 +0000
+++ b/sql/item.h	2012-04-18 17:52:08 +0000
@@ -181,7 +181,7 @@ public:
   NameString(const LEX_STRING str, bool is_null_terminated):
     SimpleCString()
   {
-    set_or_copy(str.str, str.length, is_null_terminated);
+    set_or_copy(str.str, (uint) str.length, is_null_terminated);
   }
   /**
     Allocate space using sql_strmake() or sql_strmake_with_convert().
@@ -200,11 +200,11 @@ public:
   }
   void copy(const LEX_STRING lex)
   {
-    copy(lex.str, lex.length);
+    copy(lex.str, (uint) lex.length);
   }
   void copy(const LEX_STRING *lex)
   {
-    copy(lex->str, lex->length);
+    copy(lex->str, (uint) lex->length);
   }
   void copy(const NameString str)
   {
@@ -2899,7 +2899,7 @@ class Item_return_date_time :public Item
   enum_field_types date_time_field_type;
 public:
   Item_return_date_time(const char *name_arg, enum_field_types field_type_arg)
-    :Item_partition_func_safe_string(NameString((char *) name_arg, strlen(name_arg)),
+    :Item_partition_func_safe_string(NameString((char *) name_arg, (uint) strlen(name_arg)),
                                      0, &my_charset_bin),
      date_time_field_type(field_type_arg)
   { decimals= 0; }
@@ -2911,7 +2911,7 @@ class Item_blob :public Item_partition_f
 {
 public:
   Item_blob(const char *name, uint length) :
-    Item_partition_func_safe_string(NameString((char *) name, strlen(name)),
+    Item_partition_func_safe_string(NameString((char *) name, (uint) strlen(name)),
                                     length, &my_charset_bin)
   { }
   enum Type type() const { return TYPE_HOLDER; }
@@ -2930,7 +2930,7 @@ class Item_empty_string :public Item_par
 public:
   Item_empty_string(const char *header, uint length,
                     const CHARSET_INFO *cs= NULL) :
-    Item_partition_func_safe_string(NameString((char *)header, strlen(header)),
+    Item_partition_func_safe_string(NameString((char *)header, (uint) strlen(header)),
                                     0, cs ? cs : &my_charset_utf8_general_ci)
     {
       max_length= length * collation.collation->mbmaxlen;
@@ -2945,7 +2945,7 @@ class Item_return_int :public Item_int
 public:
   Item_return_int(const char *name_arg, uint length,
 		  enum_field_types field_type_arg, longlong value= 0)
-    :Item_int(NameString(name_arg, name_arg ? strlen(name_arg) : 0),
+    :Item_int(NameString(name_arg, name_arg ? (uint) strlen(name_arg) : 0),
               value, length), int_field_type(field_type_arg)
   {
     unsigned_flag=1;

=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2012-04-18 08:05:23 +0000
+++ b/sql/sql_show.cc	2012-04-18 17:52:08 +0000
@@ -6725,7 +6725,7 @@ TABLE *create_schema_table(THD *thd, TAB
     case MYSQL_TYPE_DOUBLE:
     {
       const NameString field_name(fields_info->field_name,
-                                  strlen(fields_info->field_name));
+                                  (uint) strlen(fields_info->field_name));
       if ((item= new Item_float(field_name, 0.0, NOT_FIXED_DEC, 
                                 fields_info->field_length)) == NULL)
         DBUG_RETURN(NULL);

=== modified file 'sql/sql_string.h'
--- a/sql/sql_string.h	2012-04-17 14:37:50 +0000
+++ b/sql/sql_string.h	2012-04-18 17:52:08 +0000
@@ -63,7 +63,7 @@ public:
   }
   SimpleCString(const LEX_STRING arg)
   {
-    set(arg.str, arg.length);
+    set(arg.str, (uint) arg.length);
   }
   void reset()
   {
@@ -74,7 +74,7 @@ public:
   */
   void set(const char *str)
   {
-    set(str, str ? strlen(str) : 0);
+    set(str, str ? (uint) strlen(str) : 0);
   }
   /**
     Return string buffer.
@@ -373,7 +373,7 @@ public:
   bool append(const char *s);
   bool append(LEX_STRING *ls)
   {
-    return append(ls->str, ls->length);
+    return append(ls->str, (uint32) ls->length);
   }
   bool append(SimpleCString str)
   {

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (alexander.barkov:3877 to 3878) Alexander Barkov20 Apr