[Commits] 96403c5e124: Replace some unsigned integers with size_t to avoid type mismatch.

marko.makela at mariadb.com marko.makela at mariadb.com
Thu Mar 30 14:39:50 EEST 2017


revision-id: 96403c5e1240342948cb88600ece14c0c8b72dbc (mariadb-10.2.4-110-g96403c5e124)
parent(s): 6150002055f5d8a2ed7a905e9bf2b184cadfccbc
author: Marko Mäkelä
committer: Marko Mäkelä
timestamp: 2017-03-30 14:39:50 +0300
message:

Replace some unsigned integers with size_t to avoid type mismatch.

---
 libmysqld/lib_sql.cc             |   2 +-
 sql/item.cc                      |   4 +-
 sql/item_cmpfunc.cc              |   4 +-
 sql/item_func.cc                 |   6 +-
 sql/item_sum.cc                  |   4 +-
 sql/key.cc                       |   3 +-
 sql/sp_head.cc                   |   4 +-
 sql/spatial.cc                   |  11 ++--
 sql/sql_class.cc                 |   2 +-
 sql/sql_class.h                  |   2 +-
 sql/sql_prepare.cc               |   6 +-
 sql/sql_signal.cc                |   3 +-
 sql/sql_string.cc                |  92 +++++++++++++-------------
 sql/sql_string.h                 | 139 ++++++++++++++++++++-------------------
 sql/sql_table.cc                 |  12 ++--
 sql/sql_view.cc                  |   4 +-
 sql/sys_vars.ic                  |   4 +-
 storage/spider/spd_db_include.h  | 102 ++++++++++++++--------------
 storage/spider/spd_db_mysql.cc   |   8 +--
 storage/spider/spd_malloc.cc     | 102 ++++++++++++++--------------
 storage/spider/spd_ping_table.cc |   2 +-
 21 files changed, 261 insertions(+), 255 deletions(-)

diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 555eadc9425..90e57532813 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -865,7 +865,7 @@ void THD::clear_data_list()
 static char *dup_str_aux(MEM_ROOT *root, const char *from, uint length,
 			 CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
 {
-  uint32 dummy32;
+  size_t dummy32;
   uint dummy_err;
   char *result;
 
diff --git a/sql/item.cc b/sql/item.cc
index 2ff9d4e4a44..8f2b3615f6d 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1,6 +1,6 @@
 /*
    Copyright (c) 2000, 2016, Oracle and/or its affiliates.
-   Copyright (c) 2010, 2016, MariaDB
+   Copyright (c) 2010, 2017, MariaDB Corporation.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -3577,7 +3577,7 @@ void Item_param::CONVERSION_INFO::set(THD *thd, CHARSET_INFO *fromcs)
     are different only if conversion is necessary: this will
     make later checks easier.
   */
-  uint32 dummy_offset;
+  size_t dummy_offset;
   final_character_set_of_str_value=
     String::needs_conversion(0, fromcs, tocs, &dummy_offset) ?
     tocs : fromcs;
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 689ce656d60..52c71958669 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1,5 +1,5 @@
 /* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
-   Copyright (c) 2009, 2016, MariaDB
+   Copyright (c) 2009, 2017, MariaDB Corporation.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -5242,7 +5242,7 @@ bool fix_escape_item(THD *thd, Item *escape_item, String *tmp_str,
           code instead of Unicode code as "escape" argument.
           Convert to "cs" if charset of escape differs.
         */
-        uint32 unused;
+        size_t unused;
         if (escape_str->needs_conversion(escape_str->length(),
                                          escape_str->charset(),cmp_cs,&unused))
         {
diff --git a/sql/item_func.cc b/sql/item_func.cc
index ed527cda218..e9fdbd0edfa 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1,5 +1,5 @@
 /* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
-   Copyright (c) 2009, 2015, MariaDB
+   Copyright (c) 2009, 2017, MariaDB Corporation.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -4210,7 +4210,7 @@ longlong Item_func_get_lock::val_int()
 
   if (!ull_name_ok(res))
     DBUG_RETURN(0);
-  DBUG_PRINT("enter", ("lock: %.*s", res->length(), res->ptr()));
+  DBUG_PRINT("enter", ("lock: %.*s", (int) res->length(), res->ptr()));
   /* HASH entries are of type User_level_lock. */
   if (! my_hash_inited(&thd->ull_hash) &&
         my_hash_init(&thd->ull_hash, &my_charset_bin,
@@ -4288,7 +4288,7 @@ longlong Item_func_release_lock::val_int()
   if (!ull_name_ok(res))
     DBUG_RETURN(0);
 
-  DBUG_PRINT("enter", ("lock: %.*s", res->length(), res->ptr()));
+  DBUG_PRINT("enter", ("lock: %.*s", (int) res->length(), res->ptr()));
 
   MDL_key ull_key;
   ull_key.mdl_key_init(MDL_key::USER_LOCK, res->c_ptr_safe(), "");
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index cb2d3e839b8..d5296074ce3 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1,5 +1,5 @@
 /* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
-   Copyright (c) 2008, 2015, MariaDB
+   Copyright (c) 2008, 2017, MariaDB Corporation.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -3494,7 +3494,7 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref)
               / collation.collation->mbminlen
               * collation.collation->mbmaxlen);
 
-  uint32 offset;
+  size_t offset;
   if (separator->needs_conversion(separator->length(), separator->charset(),
                                   collation.collation, &offset))
   {
diff --git a/sql/key.cc b/sql/key.cc
index bb10e902b8b..9e8693fe9f5 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -1,4 +1,5 @@
 /* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+   Copyright (c) 2017, MariaDB Corporation.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -392,7 +393,7 @@ void field_unpack(String *to, Field *field, const uchar *rec, uint max_length,
         tmp.length(charpos);
     }
     if (max_length < field->pack_length())
-      tmp.length(min(tmp.length(),max_length));
+      tmp.length(min(tmp.length(),static_cast<size_t>(max_length)));
     ErrConvString err(&tmp);
     to->append(err.ptr());
   }
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 251b829fb1d..0f746a1c9b7 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -1,6 +1,6 @@
 /*
    Copyright (c) 2002, 2016, Oracle and/or its affiliates.
-   Copyright (c) 2011, 2016, MariaDB
+   Copyright (c) 2011, 2017, MariaDB Corporation.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -763,7 +763,7 @@ create_typelib(MEM_ROOT *mem_root, Column_definition *field_def, List<String> *s
     String conv;
     for (uint i=0; i < result->count; i++)
     {
-      uint32 dummy;
+      size_t dummy;
       uint length;
       String *tmp= it++;
 
diff --git a/sql/spatial.cc b/sql/spatial.cc
index 7c9d8bb771e..399a9681988 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -1,6 +1,6 @@
 /*
    Copyright (c) 2002, 2013, Oracle and/or its affiliates.
-   Copyright (c) 2011, 2013, Monty Program Ab.
+   Copyright (c) 2011, 2017, MariaDB Corporation.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -2255,7 +2255,7 @@ int Gis_multi_line_string::num_geometries(uint32 *num) const
 
 int Gis_multi_line_string::geometry_n(uint32 num, String *result) const
 {
-  uint32 n_line_strings, n_points, length;
+  size_t n_line_strings, n_points, length;
   const char *data= m_data;
 
   if (no_data(data, 4))
@@ -2278,7 +2278,7 @@ int Gis_multi_line_string::geometry_n(uint32 num, String *result) const
       break;
     data+= length;
   }
-  return result->append(data, length, (uint32) 0);
+  return result->append(data, length, static_cast<size_t>(0));
 }
 
 
@@ -2710,8 +2710,9 @@ int Gis_multi_polygon::geometry_n(uint32 num, String *result) const
   } while (--num);
   if (no_data(data, 0))				// We must check last segment
     return 1;
-  return result->append(start_of_polygon, (uint32) (data - start_of_polygon),
-			(uint32) 0);
+  return result->append(start_of_polygon,
+                        static_cast<size_t>(data - start_of_polygon),
+                        static_cast<size_t>(0));
 }
 
 
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index f8ba23298e0..ff5e5e65b8d 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -2322,7 +2322,7 @@ bool THD::convert_string(String *s, CHARSET_INFO *from_cs, CHARSET_INFO *to_cs)
 
 void THD::update_charset()
 {
-  uint32 not_used;
+  size_t not_used;
   charset_is_system_charset=
     !String::needs_conversion(0,
                               variables.character_set_client,
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 986cb1c4793..097d4a6b165 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -3344,7 +3344,7 @@ class THD :public Statement,
   {
     return !stmt_arena->is_stmt_prepare();
   }
-  inline void* trans_alloc(unsigned int size)
+  inline void* trans_alloc(size_t size)
   {
     return alloc_root(&transaction.mem_root,size);
   }
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 4b2d8b5fb36..03b4034a757 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1,5 +1,5 @@
 /* Copyright (c) 2002, 2015, Oracle and/or its affiliates.
-   Copyright (c) 2008, 2016, MariaDB
+   Copyright (c) 2008, 2017, MariaDB Corporation.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -793,7 +793,7 @@ static void setup_one_conversion_function(THD *thd, Item_param *param,
     {
       CHARSET_INFO *fromcs= thd->variables.character_set_client;
       CHARSET_INFO *tocs= thd->variables.collation_connection;
-      uint32 dummy_offset;
+      size_t dummy_offset;
 
       param->value.cs_info.character_set_of_placeholder= fromcs;
       param->value.cs_info.character_set_client= fromcs;
@@ -2736,7 +2736,7 @@ bool LEX::get_dynamic_sql_string(LEX_CSTRING *dst, String *buffer)
   */
   CHARSET_INFO *to_cs= thd->variables.character_set_client;
 
-  uint32 unused;
+  size_t unused;
   if (String::needs_conversion(str->length(), str->charset(), to_cs, &unused))
   {
     if (!(dst->str= sql_strmake_with_convert(thd, str->ptr(), str->length(),
diff --git a/sql/sql_signal.cc b/sql/sql_signal.cc
index 1b7edbee54a..ad57d4df46d 100644
--- a/sql/sql_signal.cc
+++ b/sql/sql_signal.cc
@@ -1,4 +1,5 @@
 /* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+   Copyright (c) 2017, MariaDB Corporation.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -149,7 +150,7 @@ static bool assign_fixed_string(MEM_ROOT *mem_root,
   char* dst_str;
   size_t dst_len;
   size_t dst_copied;
-  uint32 dummy_offset;
+  size_t dummy_offset;
 
   src_str= src->ptr();
   if (src_str == NULL)
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 62473e082c3..354e5dcb9c8 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -1,5 +1,5 @@
 /* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
-   Copyright (c) 2016, MariaDB
+   Copyright (c) 2016, 2017, MariaDB Corporation.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -32,9 +32,9 @@
 ** String functions
 *****************************************************************************/
 
-bool String::real_alloc(uint32 length)
+bool String::real_alloc(size_t length)
 {
-  uint32 arg_length= ALIGN_SIZE(length + 1);
+  size_t arg_length= ALIGN_SIZE(length + 1);
   DBUG_ASSERT(arg_length > length);
   if (arg_length <= length)
     return TRUE;                                 /* Overflow */
@@ -81,12 +81,12 @@ bool String::real_alloc(uint32 length)
 
    @retval true An error occurred when attempting to allocate memory.
 */
-bool String::realloc_raw(uint32 alloc_length)
+bool String::realloc_raw(size_t alloc_length)
 {
   if (Alloced_length <= alloc_length)
   {
     char *new_ptr;
-    uint32 len= ALIGN_SIZE(alloc_length+1);
+    size_t len= ALIGN_SIZE(alloc_length+1);
     DBUG_ASSERT(len > alloc_length);
     if (len <= alloc_length)
       return TRUE;                                 /* Overflow */
@@ -125,7 +125,7 @@ bool String::set_int(longlong num, bool unsigned_flag, CHARSET_INFO *cs)
 
   if (alloc(l))
     return TRUE;
-  str_length=(uint32) (cs->cset->longlong10_to_str)(cs,Ptr,l,base,num);
+  str_length= (cs->cset->longlong10_to_str)(cs,Ptr,l,base,num);
   str_charset=cs;
   return FALSE;
 }
@@ -143,7 +143,7 @@ bool String::set_real(double num,uint decimals, CHARSET_INFO *cs)
     return copy(buff, len, &my_charset_latin1, cs, &dummy_errors);
   }
   len= my_fcvt(num, decimals, buff, NULL);
-  return copy(buff, (uint32) len, &my_charset_latin1, cs,
+  return copy(buff, len, &my_charset_latin1, cs,
               &dummy_errors);
 }
 
@@ -180,7 +180,7 @@ bool String::copy(const String &str)
   return FALSE;
 }
 
-bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *cs)
+bool String::copy(const char *str,size_t arg_length, CHARSET_INFO *cs)
 {
   if (alloc(arg_length))
     return TRUE;
@@ -202,7 +202,7 @@ bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *cs)
   arg_length		Length of string to copy.
   from_cs		Character set to copy from
   to_cs			Character set to copy to
-  uint32 *offset	Returns number of unaligned characters.
+  *offset		Returns number of unaligned characters.
 
   RETURN
    0  No conversion needed
@@ -214,10 +214,10 @@ bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *cs)
   character_set_results is NULL.
 */
 
-bool String::needs_conversion(uint32 arg_length,
+bool String::needs_conversion(size_t arg_length,
 			      CHARSET_INFO *from_cs,
 			      CHARSET_INFO *to_cs,
-			      uint32 *offset)
+			      size_t *offset)
 {
   *offset= 0;
   if (!to_cs ||
@@ -243,11 +243,11 @@ bool String::needs_conversion(uint32 arg_length,
 
   @return conversion needed
 */
-bool String::needs_conversion_on_storage(uint32 arg_length,
+bool String::needs_conversion_on_storage(size_t arg_length,
                                          CHARSET_INFO *cs_from,
                                          CHARSET_INFO *cs_to)
 {
-  uint32 offset;
+  size_t offset;
   return (needs_conversion(arg_length, cs_from, cs_to, &offset) ||
           /* force conversion when storing a binary string */
           (cs_from == &my_charset_bin &&
@@ -292,14 +292,14 @@ bool String::needs_conversion_on_storage(uint32 arg_length,
     1  error
 */
 
-bool String::copy_aligned(const char *str,uint32 arg_length, uint32 offset,
+bool String::copy_aligned(const char *str,size_t arg_length, size_t offset,
 			  CHARSET_INFO *cs)
 {
   /* How many bytes are in incomplete character */
   offset= cs->mbminlen - offset; /* How many zeros we should prepend */
   DBUG_ASSERT(offset && offset != cs->mbminlen);
 
-  uint32 aligned_length= arg_length + offset;
+  size_t aligned_length= arg_length + offset;
   if (alloc(aligned_length))
     return TRUE;
   
@@ -318,11 +318,11 @@ bool String::copy_aligned(const char *str,uint32 arg_length, uint32 offset,
 }
 
 
-bool String::set_or_copy_aligned(const char *str,uint32 arg_length,
+bool String::set_or_copy_aligned(const char *str,size_t arg_length,
 				 CHARSET_INFO *cs)
 {
   /* How many bytes are in incomplete character */
-  uint32 offset= (arg_length % cs->mbminlen); 
+  size_t offset= (arg_length % cs->mbminlen); 
   
   if (!offset) /* All characters are complete, just copy */
   {
@@ -343,10 +343,10 @@ bool String::set_or_copy_aligned(const char *str,uint32 arg_length,
 
 */
 
-bool String::copy(const char *str, uint32 arg_length,
+bool String::copy(const char *str, size_t arg_length,
 		  CHARSET_INFO *from_cs, CHARSET_INFO *to_cs, uint *errors)
 {
-  uint32 offset;
+  size_t offset;
 
   DBUG_ASSERT(!str || str != Ptr);
   
@@ -360,7 +360,7 @@ bool String::copy(const char *str, uint32 arg_length,
     *errors= 0;
     return copy_aligned(str, arg_length, offset, to_cs);
   }
-  uint32 new_length= to_cs->mbmaxlen*arg_length;
+  size_t new_length= to_cs->mbmaxlen*arg_length;
   if (alloc(new_length))
     return TRUE;
   str_length=copy_and_convert((char*) Ptr, new_length, to_cs,
@@ -389,7 +389,7 @@ bool String::copy(const char *str, uint32 arg_length,
 
 */
 
-bool String::set_ascii(const char *str, uint32 arg_length)
+bool String::set_ascii(const char *str, size_t arg_length)
 {
   if (str_charset->mbminlen == 1)
   {
@@ -403,7 +403,7 @@ bool String::set_ascii(const char *str, uint32 arg_length)
 
 /* This is used by mysql.cc */
 
-bool String::fill(uint32 max_length,char fill_char)
+bool String::fill(size_t max_length,char fill_char)
 {
   if (str_length > max_length)
     Ptr[str_length=max_length]=0;
@@ -440,7 +440,7 @@ bool String::append(const String &s)
   Append an ASCII string to the a string of the current character set
 */
 
-bool String::append(const char *s,uint32 arg_length)
+bool String::append(const char *s,size_t arg_length)
 {
   if (!arg_length)
     return FALSE;
@@ -450,7 +450,7 @@ bool String::append(const char *s,uint32 arg_length)
   */
   if (str_charset->mbminlen > 1)
   {
-    uint32 add_length=arg_length * str_charset->mbmaxlen;
+    size_t add_length=arg_length * str_charset->mbmaxlen;
     uint dummy_errors;
     if (realloc_with_extra_if_needed(str_length+ add_length))
       return TRUE;
@@ -496,13 +496,13 @@ bool String::append_ulonglong(ulonglong val)
   with character set recoding
 */
 
-bool String::append(const char *s,uint32 arg_length, CHARSET_INFO *cs)
+bool String::append(const char *s,size_t arg_length, CHARSET_INFO *cs)
 {
-  uint32 offset;
+  size_t offset;
   
   if (needs_conversion(arg_length, cs, str_charset, &offset))
   {
-    uint32 add_length;
+    size_t add_length;
     if ((cs == &my_charset_bin) && offset)
     {
       DBUG_ASSERT(str_charset->mbminlen > offset);
@@ -533,7 +533,7 @@ bool String::append(const char *s,uint32 arg_length, CHARSET_INFO *cs)
   return FALSE;
 }
 
-bool String::append(IO_CACHE* file, uint32 arg_length)
+bool String::append(IO_CACHE* file, size_t arg_length)
 {
   if (realloc_with_extra_if_needed(str_length+arg_length))
     return TRUE;
@@ -564,8 +564,8 @@ bool String::append_parenthesized(long nr, int radix)
 }
 
 
-bool String::append_with_prefill(const char *s,uint32 arg_length,
-		 uint32 full_length, char fill_char)
+bool String::append_with_prefill(const char *s,size_t arg_length,
+                                 size_t full_length, char fill_char)
 {
   int t_length= arg_length > full_length ? arg_length : full_length;
 
@@ -581,19 +581,19 @@ bool String::append_with_prefill(const char *s,uint32 arg_length,
   return FALSE;
 }
 
-uint32 String::numchars() const
+size_t String::numchars() const
 {
   return str_charset->cset->numchars(str_charset, Ptr, Ptr+str_length);
 }
 
-int String::charpos(longlong i,uint32 offset)
+int String::charpos(longlong i,size_t offset)
 {
   if (i <= 0)
     return (int)i;
   return (int)str_charset->cset->charpos(str_charset,Ptr+offset,Ptr+str_length,(size_t)i);
 }
 
-int String::strstr(const String &s,uint32 offset)
+int String::strstr(const String &s,size_t offset)
 {
   if (s.length()+offset <= str_length)
   {
@@ -624,7 +624,7 @@ int String::strstr(const String &s,uint32 offset)
 ** Search string from end. Offset is offset to the end of string
 */
 
-int String::strrstr(const String &s,uint32 offset)
+int String::strrstr(const String &s,size_t offset)
 {
   if (s.length() <= offset && offset <= str_length)
   {
@@ -656,13 +656,13 @@ int String::strrstr(const String &s,uint32 offset)
   If wrong parameter or not enough memory, do nothing
 */
 
-bool String::replace(uint32 offset,uint32 arg_length,const String &to)
+bool String::replace(size_t offset,size_t arg_length,const String &to)
 {
   return replace(offset,arg_length,to.ptr(),to.length());
 }
 
-bool String::replace(uint32 offset,uint32 arg_length,
-                     const char *to, uint32 to_length)
+bool String::replace(size_t offset,size_t arg_length,
+                     const char *to, size_t to_length)
 {
   long diff = (long) to_length-(long) arg_length;
   if (offset+arg_length <= str_length)
@@ -678,7 +678,7 @@ bool String::replace(uint32 offset,uint32 arg_length,
     {
       if (diff)
       {
-	if (realloc_with_extra_if_needed(str_length+(uint32) diff))
+	if (realloc_with_extra_if_needed(str_length+(size_t) diff))
 	  return TRUE;
 	bmove_upp((uchar*) Ptr+str_length+diff, (uchar*) Ptr+str_length,
 		  str_length-offset-arg_length);
@@ -686,14 +686,14 @@ bool String::replace(uint32 offset,uint32 arg_length,
       if (to_length)
 	memcpy(Ptr+offset,to,to_length);
     }
-    str_length+=(uint32) diff;
+    str_length+=(size_t) diff;
   }
   return FALSE;
 }
 
 
 // added by Holyfoot for "geometry" needs
-int String::reserve(uint32 space_needed, uint32 grow_by)
+int String::reserve(size_t space_needed, size_t grow_by)
 {
   if (Alloced_length < str_length + space_needed)
   {
@@ -703,7 +703,7 @@ int String::reserve(uint32 space_needed, uint32 grow_by)
   return FALSE;
 }
 
-void String::qs_append(const char *str, uint32 len)
+void String::qs_append(const char *str, size_t len)
 {
   memcpy(Ptr + str_length, str, len + 1);
   str_length += len;
@@ -784,7 +784,7 @@ int sortcmp(const String *s,const String *t, CHARSET_INFO *cs)
 
 int stringcmp(const String *s,const String *t)
 {
-  uint32 s_len=s->length(),t_len=t->length(),len=MY_MIN(s_len,t_len);
+  size_t s_len=s->length(),t_len=t->length(),len=MY_MIN(s_len,t_len);
   int cmp= memcmp(s->ptr(), t->ptr(), len);
   return (cmp) ? cmp : (int) (s_len - t_len);
 }
@@ -813,7 +813,7 @@ int stringcmp(const String *s,const String *t)
   then "to" is reallocated to fit "from_length" bytes, the value is copied
   from "from" to "to", then "to" is returned.
 */
-String *copy_if_not_alloced(String *to,String *from,uint32 from_length)
+String *copy_if_not_alloced(String *to,String *from,size_t from_length)
 {
   DBUG_ASSERT(to);
   /*
@@ -1032,7 +1032,7 @@ String_copier::well_formed_copy(CHARSET_INFO *to_cs,
   Does not add the enclosing quotes, this is left up to caller.
 */
 #define APPEND(X)   if (append(X)) return 1; else break
-bool String::append_for_single_quote(const char *st, uint len)
+bool String::append_for_single_quote(const char *st, size_t len)
 {
   const char *end= st+len;
   for (; st < end; st++)
@@ -1080,8 +1080,8 @@ void String::print_with_conversion(String *print, CHARSET_INFO *cs) const
 void String::swap(String &s)
 {
   swap_variables(char *, Ptr, s.Ptr);
-  swap_variables(uint32, str_length, s.str_length);
-  swap_variables(uint32, Alloced_length, s.Alloced_length);
+  swap_variables(size_t, str_length, s.str_length);
+  swap_variables(size_t, Alloced_length, s.Alloced_length);
   swap_variables(bool, alloced, s.alloced);
   swap_variables(CHARSET_INFO*, str_charset, s.str_charset);
 }
diff --git a/sql/sql_string.h b/sql/sql_string.h
index 18f5f4cac5c..8248f6d3554 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -34,10 +34,10 @@ typedef struct st_mem_root MEM_ROOT;
 
 #include "pack.h"
 int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
-String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
-inline uint32 copy_and_convert(char *to, uint32 to_length,
+String *copy_if_not_alloced(String *a,String *b,size_t arg_length);
+inline size_t copy_and_convert(char *to, size_t to_length,
                                CHARSET_INFO *to_cs,
-                               const char *from, uint32 from_length,
+                               const char *from, size_t from_length,
                                CHARSET_INFO *from_cs, uint *errors)
 {
   return my_convert(to, to_length, to_cs, from, from_length, from_cs, errors);
@@ -132,7 +132,7 @@ uint convert_to_printable(char *to, size_t to_len,
 class String
 {
   char *Ptr;
-  uint32 str_length,Alloced_length, extra_alloc;
+  size_t str_length,Alloced_length, extra_alloc;
   bool alloced,thread_specific;
   CHARSET_INFO *str_charset;
 public:
@@ -142,7 +142,7 @@ class String
     alloced= thread_specific= 0; 
     str_charset= &my_charset_bin; 
   }
-  String(uint32 length_arg)
+  String(size_t length_arg)
   { 
     alloced= thread_specific= 0;
     Alloced_length= extra_alloc= 0; (void) real_alloc(length_arg); 
@@ -150,7 +150,7 @@ class String
   }
   String(const char *str, CHARSET_INFO *cs)
   { 
-    Ptr=(char*) str; str_length= (uint32) strlen(str);
+    Ptr=(char*) str; str_length= strlen(str);
     Alloced_length= extra_alloc= 0;
     alloced= thread_specific= 0;
     str_charset=cs;
@@ -160,13 +160,13 @@ class String
     contructors need the size of memory for STR to be at least LEN+1 (to make
     room for zero termination).
   */
-  String(const char *str,uint32 len, CHARSET_INFO *cs)
+  String(const char *str, size_t len, CHARSET_INFO *cs)
   { 
     Ptr=(char*) str; str_length=len; Alloced_length= extra_alloc=0;
     alloced= thread_specific= 0;
     str_charset=cs;
   }
-  String(char *str,uint32 len, CHARSET_INFO *cs)
+  String(char *str, size_t len, CHARSET_INFO *cs)
   { 
     Ptr=(char*) str; Alloced_length=str_length=len; extra_alloc= 0;
     alloced= thread_specific= 0;
@@ -180,7 +180,7 @@ class String
     str_charset=str.str_charset;
   }
   static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
-  { return (void*) alloc_root(mem_root, (uint) size); }
+  { return (void*) alloc_root(mem_root, size); }
   static void operator delete(void *ptr_arg, size_t size)
   {
     (void) ptr_arg;
@@ -200,12 +200,12 @@ class String
   inline void set_charset(CHARSET_INFO *charset_arg)
   { str_charset= charset_arg; }
   inline CHARSET_INFO *charset() const { return str_charset; }
-  inline uint32 length() const { return str_length;}
-  inline uint32 alloced_length() const { return Alloced_length;}
-  inline uint32 extra_allocation() const { return extra_alloc;}
-  inline char& operator [] (uint32 i) const { return Ptr[i]; }
-  inline void length(uint32 len) { str_length=len ; }
-  inline void extra_allocation(uint32 len) { extra_alloc= len; }
+  inline size_t length() const { return str_length;}
+  inline size_t alloced_length() const { return Alloced_length;}
+  inline size_t extra_allocation() const { return extra_alloc;}
+  inline char& operator [] (size_t i) const { return Ptr[i]; }
+  inline void length(size_t len) { str_length=len ; }
+  inline void extra_allocation(size_t len) { extra_alloc= len; }
   inline bool is_empty() const { return (str_length == 0); }
   inline void mark_as_const() { Alloced_length= 0;}
   inline const char *ptr() const { return Ptr; }
@@ -244,7 +244,7 @@ class String
     return skr;
   }
 
-  void set(String &str,uint32 offset,uint32 arg_length)
+  void set(String &str,size_t offset,size_t arg_length)
   {
     DBUG_ASSERT(&str != this);
     free();
@@ -263,20 +263,20 @@ class String
      @param cs Character set to use for interpreting string data.
      @note The new buffer will not be null terminated.
   */
-  inline void set(char *str,uint32 arg_length, CHARSET_INFO *cs)
+  inline void set(char *str,size_t arg_length, CHARSET_INFO *cs)
   {
     free();
     Ptr=(char*) str; str_length=Alloced_length=arg_length;
     str_charset=cs;
   }
-  inline void set(const char *str,uint32 arg_length, CHARSET_INFO *cs)
+  inline void set(const char *str,size_t arg_length, CHARSET_INFO *cs)
   {
     free();
     Ptr=(char*) str; str_length=arg_length;
     str_charset=cs;
   }
-  bool set_ascii(const char *str, uint32 arg_length);
-  inline void set_quick(char *str,uint32 arg_length, CHARSET_INFO *cs)
+  bool set_ascii(const char *str, size_t arg_length);
+  inline void set_quick(char *str,size_t arg_length, CHARSET_INFO *cs)
   {
     if (!alloced)
     {
@@ -294,7 +294,7 @@ class String
   bool set_real(double num,uint decimals, CHARSET_INFO *cs);
 
   /* Take over handling of buffer from some other object */
-  void reset(char *ptr_arg, uint32 length_arg, uint32 alloced_length_arg,
+  void reset(char *ptr_arg, size_t length_arg, size_t alloced_length_arg,
              CHARSET_INFO *cs)
   { 
     free();
@@ -354,22 +354,22 @@ class String
     Ptr=0;
     str_length=0;				/* Safety */
   }
-  inline bool alloc(uint32 arg_length)
+  inline bool alloc(size_t arg_length)
   {
     if (arg_length < Alloced_length)
       return 0;
     return real_alloc(arg_length);
   }
-  bool real_alloc(uint32 arg_length);			// Empties old string
-  bool realloc_raw(uint32 arg_length);
-  bool realloc(uint32 arg_length)
+  bool real_alloc(size_t arg_length);			// Empties old string
+  bool realloc_raw(size_t arg_length);
+  bool realloc(size_t arg_length)
   {
     if (realloc_raw(arg_length))
       return TRUE;
     Ptr[arg_length]=0;        // This make other funcs shorter
     return FALSE;
   }
-  bool realloc_with_extra(uint32 arg_length)
+  bool realloc_with_extra(size_t arg_length)
   {
     if (extra_alloc < 4096)
       extra_alloc= extra_alloc*2+128;
@@ -378,7 +378,7 @@ class String
     Ptr[arg_length]=0;        // This make other funcs shorter
     return FALSE;
   }
-  bool realloc_with_extra_if_needed(uint32 arg_length)
+  bool realloc_with_extra_if_needed(size_t arg_length)
   {
     if (arg_length < Alloced_length)
     {
@@ -388,7 +388,7 @@ class String
     return realloc_with_extra(arg_length);
   }
   // Shrink the buffer, but only if it is allocated on the heap.
-  inline void shrink(uint32 arg_length)
+  inline void shrink(size_t arg_length)
   {
     if (!is_alloced())
       return;
@@ -428,25 +428,25 @@ class String
 
   bool copy();					// Alloc string if not alloced
   bool copy(const String &s);			// Allocate new string
-  bool copy(const char *s,uint32 arg_length, CHARSET_INFO *cs);	// Allocate new string
-  static bool needs_conversion(uint32 arg_length,
+  bool copy(const char *s,size_t arg_length, CHARSET_INFO *cs);	// Allocate new string
+  static bool needs_conversion(size_t arg_length,
   			       CHARSET_INFO *cs_from, CHARSET_INFO *cs_to,
-			       uint32 *offset);
-  static bool needs_conversion_on_storage(uint32 arg_length,
+			       size_t *offset);
+  static bool needs_conversion_on_storage(size_t arg_length,
                                           CHARSET_INFO *cs_from,
                                           CHARSET_INFO *cs_to);
-  bool copy_aligned(const char *s, uint32 arg_length, uint32 offset,
+  bool copy_aligned(const char *s, size_t arg_length, size_t offset,
 		    CHARSET_INFO *cs);
-  bool set_or_copy_aligned(const char *s, uint32 arg_length, CHARSET_INFO *cs);
-  bool copy(const char*s,uint32 arg_length, CHARSET_INFO *csfrom,
+  bool set_or_copy_aligned(const char *s, size_t arg_length, CHARSET_INFO *cs);
+  bool copy(const char*s,size_t arg_length, CHARSET_INFO *csfrom,
 	    CHARSET_INFO *csto, uint *errors);
   bool copy(const String *str, CHARSET_INFO *tocs, uint *errors)
   {
     return copy(str->ptr(), str->length(), str->charset(), tocs, errors);
   }
   bool copy(CHARSET_INFO *tocs,
-            CHARSET_INFO *fromcs, const char *src, uint32 src_length,
-            uint32 nchars, String_copier *copier)
+            CHARSET_INFO *fromcs, const char *src, size_t src_length,
+            size_t nchars, String_copier *copier)
   {
     if (alloc(tocs->mbmaxlen * src_length))
       return true;
@@ -468,17 +468,17 @@ class String
   bool append(const char *s);
   bool append(const LEX_STRING *ls) { return append(ls->str, ls->length); }
   bool append(const LEX_CSTRING *ls) { return append(ls->str, ls->length); }
-  bool append(const char *s, uint32 arg_length);
-  bool append(const char *s, uint32 arg_length, CHARSET_INFO *cs);
+  bool append(const char *s, size_t arg_length);
+  bool append(const char *s, size_t arg_length, CHARSET_INFO *cs);
   bool append_ulonglong(ulonglong val);
-  bool append(IO_CACHE* file, uint32 arg_length);
-  bool append_with_prefill(const char *s, uint32 arg_length, 
-			   uint32 full_length, char fill_char);
+  bool append(IO_CACHE* file, size_t arg_length);
+  bool append_with_prefill(const char *s, size_t arg_length,
+			   size_t full_length, char fill_char);
   bool append_parenthesized(long nr, int radix= 10);
-  int strstr(const String &search,uint32 offset=0); // Returns offset to substring or -1
-  int strrstr(const String &search,uint32 offset=0); // Returns offset to substring or -1
-  bool replace(uint32 offset,uint32 arg_length,const char *to,uint32 length);
-  bool replace(uint32 offset,uint32 arg_length,const String &to);
+  int strstr(const String &search,size_t offset=0); // Returns offset to substring or -1
+  int strrstr(const String &search,size_t offset=0); // Returns offset to substring or -1
+  bool replace(size_t offset,size_t arg_length,const char *to,size_t length);
+  bool replace(size_t offset,size_t arg_length,const String &to);
   inline bool append(char chr)
   {
     if (str_length < Alloced_length)
@@ -493,7 +493,7 @@ class String
     }
     return 0;
   }
-  bool append_hex(const char *src, uint32 srclen)
+  bool append_hex(const char *src, size_t srclen)
   {
     for (const char *src_end= src + srclen ; src != src_end ; src++)
     {
@@ -503,24 +503,24 @@ class String
     }
     return false;
   }
-  bool append_hex(const uchar *src, uint32 srclen)
+  bool append_hex(const uchar *src, size_t srclen)
   {
     return append_hex((const char*)src, srclen);
   }
-  bool fill(uint32 max_length,char fill);
+  bool fill(size_t max_length,char fill);
   void strip_sp();
   friend int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
   friend int stringcmp(const String *a,const String *b);
-  friend String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
+  friend String *copy_if_not_alloced(String *a,String *b,size_t arg_length);
   friend class Field;
-  uint32 numchars() const;
-  int charpos(longlong i,uint32 offset=0);
+  size_t numchars() const;
+  int charpos(longlong i,size_t offset=0);
 
-  int reserve(uint32 space_needed)
+  int reserve(size_t space_needed)
   {
     return realloc(str_length + space_needed);
   }
-  int reserve(uint32 space_needed, uint32 grow_by);
+  int reserve(size_t space_needed, size_t grow_by);
 
   /*
     The following append operations do NOT check alloced memory
@@ -531,16 +531,19 @@ class String
   {
     Ptr[str_length++] = c;
   }
-  void q_append2b(const uint32 n)
+  void q_append2b(size_t n)
   {
     int2store(Ptr + str_length, n);
     str_length += 2;
   }
-  void q_append(const uint32 n)
+  void q_append(size_t n)
   {
     int4store(Ptr + str_length, n);
     str_length += 4;
   }
+#if SIZEOF_SIZE_T > 4
+  void q_append(uint32 n) { q_append(static_cast<size_t>(n)); }
+#endif
   void q_append(double d)
   {
     float8store(Ptr + str_length, d);
@@ -551,22 +554,22 @@ class String
     float8store(Ptr + str_length, *d);
     str_length += 8;
   }
-  void q_append(const char *data, uint32 data_len)
+  void q_append(const char *data, size_t data_len)
   {
     memcpy(Ptr + str_length, data, data_len);
     str_length += data_len;
   }
 
-  void write_at_position(int position, uint32 value)
+  void write_at_position(int position, size_t value)
   {
     int4store(Ptr + position,value);
   }
 
   void qs_append(const char *str)
   {
-    qs_append(str, (uint32)strlen(str));
+    qs_append(str, strlen(str));
   }
-  void qs_append(const char *str, uint32 len);
+  void qs_append(const char *str, size_t len);
   void qs_append(double d);
   void qs_append(double *d);
   inline void qs_append(const char c)
@@ -593,23 +596,23 @@ class String
 
   /* Inline (general) functions used by the protocol functions */
 
-  inline char *prep_append(uint32 arg_length, uint32 step_alloc)
+  inline char *prep_append(size_t arg_length, size_t step_alloc)
   {
-    uint32 new_length= arg_length + str_length;
+    size_t new_length= arg_length + str_length;
     if (new_length > Alloced_length)
     {
       if (realloc(new_length + step_alloc))
         return 0;
     }
-    uint32 old_length= str_length;
+    size_t old_length= str_length;
     str_length+= arg_length;
     return Ptr+ old_length;			/* Area to use */
   }
 
 
-  inline bool append(const char *s, uint32 arg_length, uint32 step_alloc)
+  inline bool append(const char *s, size_t arg_length, size_t step_alloc)
   {
-    uint32 new_length= arg_length + str_length;
+    size_t new_length= arg_length + str_length;
     if (new_length > Alloced_length && realloc(new_length + step_alloc))
       return TRUE;
     memcpy(Ptr+str_length, s, arg_length);
@@ -626,7 +629,7 @@ class String
       print_with_conversion(to, cs);
   }
 
-  bool append_for_single_quote(const char *st, uint len);
+  bool append_for_single_quote(const char *st, size_t len);
   bool append_for_single_quote(const String *s)
   {
     return append_for_single_quote(s->ptr(), s->length());
@@ -669,11 +672,11 @@ class String
   {
     return !sortcmp(this, other, cs);
   }
-  void q_net_store_length(ulonglong length)
+  void q_net_store_length(size_t length)
   {
     DBUG_ASSERT(Alloced_length >= (str_length + net_length_size(length)));
     char *pos= (char *) net_store_length((uchar *)(Ptr + str_length), length);
-    str_length= uint32(pos - Ptr);
+    str_length= static_cast<size_t>(pos - Ptr);
   }
   void q_net_store_data(const uchar *from, size_t length)
   {
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index baab8e320a0..4b025785876 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -2853,7 +2853,7 @@ bool check_duplicates_in_interval(const char *set_or_name,
     void
 */
 void calculate_interval_lengths(CHARSET_INFO *cs, TYPELIB *interval,
-                                uint32 *max_length, uint32 *tot_length)
+                                size_t *max_length, size_t *tot_length)
 {
   const char **pos;
   uint *len;
@@ -2863,7 +2863,7 @@ void calculate_interval_lengths(CHARSET_INFO *cs, TYPELIB *interval,
   {
     size_t length= cs->cset->numchars(cs, *pos, *pos + *len);
     *tot_length+= length;
-    set_if_bigger(*max_length, (uint32)length);
+    set_if_bigger(*max_length, length);
   }
 }
 
@@ -3260,7 +3260,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
     if (sql_field->sql_type == MYSQL_TYPE_SET ||
         sql_field->sql_type == MYSQL_TYPE_ENUM)
     {
-      uint32 dummy;
+      size_t dummy;
       CHARSET_INFO *cs= sql_field->charset;
       TYPELIB *interval= sql_field->interval;
 
@@ -3321,13 +3321,13 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
 
       if (sql_field->sql_type == MYSQL_TYPE_SET)
       {
-        uint32 field_length;
+        size_t field_length;
         calculate_interval_lengths(cs, interval, &dummy, &field_length);
         sql_field->length= field_length + (interval->count - 1);
       }
       else  /* MYSQL_TYPE_ENUM */
       {
-        uint32 field_length;
+        size_t field_length;
         DBUG_ASSERT(sql_field->sql_type == MYSQL_TYPE_ENUM);
         calculate_interval_lengths(cs, interval, &field_length, &dummy);
         sql_field->length= field_length;
@@ -4359,7 +4359,7 @@ void sp_prepare_create_field(THD *thd, Column_definition *sql_field)
   if (sql_field->sql_type == MYSQL_TYPE_SET ||
       sql_field->sql_type == MYSQL_TYPE_ENUM)
   {
-    uint32 field_length, dummy;
+    size_t field_length, dummy;
     if (sql_field->sql_type == MYSQL_TYPE_SET)
     {
       calculate_interval_lengths(sql_field->charset,
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 55550ddfb8a..7cab0fd5da2 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -1,5 +1,5 @@
 /* Copyright (c) 2004, 2013, Oracle and/or its affiliates.
-   Copyright (c) 2011, 2016, MariaDB Corporation
+   Copyright (c) 2011, 2017, MariaDB Corporation.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -925,7 +925,7 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
 
     thd->variables.sql_mode|= sql_mode;
   }
-  DBUG_PRINT("info", ("View: %.*s", view_query.length(), view_query.ptr()));
+  DBUG_PRINT("info", ("View: %.*s", (int) view_query.length(), view_query.ptr()));
 
   /* fill structure */
   view->source= thd->lex->create_view_select;
diff --git a/sql/sys_vars.ic b/sql/sys_vars.ic
index 780450b484b..1cb6ba1d947 100644
--- a/sql/sys_vars.ic
+++ b/sql/sys_vars.ic
@@ -1,5 +1,5 @@
 /* Copyright (c) 2002, 2011, Oracle and/or its affiliates.
-   Copyright (c) 2010, 2013, Monty Program Ab.
+   Copyright (c) 2010, 2017, MariaDB Corporation.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -482,7 +482,7 @@ class Sys_var_charptr_base: public sys_var
       var->save_result.string_value.str= 0;
     else
     {
-      uint32 unused;
+      size_t unused;
       if (String::needs_conversion(res->length(), res->charset(),
                                    charset, &unused))
       {
diff --git a/storage/spider/spd_db_include.h b/storage/spider/spd_db_include.h
index 936951d3860..c9ce40d2294 100644
--- a/storage/spider/spd_db_include.h
+++ b/storage/spider/spd_db_include.h
@@ -237,12 +237,12 @@ class spider_string
   const char *func_name;
   const char *file_name;
   ulong line_no;
-  uint32 current_alloc_mem;
+  size_t current_alloc_mem;
   spider_string *next;
 
   spider_string();
   spider_string(
-    uint32 length_arg
+    size_t length_arg
   );
   spider_string(
     const char *str,
@@ -250,12 +250,12 @@ class spider_string
   );
   spider_string(
     const char *str,
-    uint32 len,
+    size_t len,
     CHARSET_INFO *cs
   );
   spider_string(
     char *str,
-    uint32 len,
+    size_t len,
     CHARSET_INFO *cs
   );
   spider_string(
@@ -274,13 +274,13 @@ class spider_string
     CHARSET_INFO *charset_arg
   );
   CHARSET_INFO *charset() const;
-  uint32 length() const;
-  uint32 alloced_length() const;
+  size_t length() const;
+  size_t alloced_length() const;
   char &operator [] (
-    uint32 i
+    size_t i
   ) const;
   void length(
-    uint32 len
+    size_t len
   );
   bool is_empty() const;
   const char *ptr() const;
@@ -290,26 +290,26 @@ class spider_string
   LEX_STRING lex_string() const;
   void set(
     String &str,
-    uint32 offset,
-    uint32 arg_length
+    size_t offset,
+    size_t arg_length
   );
   void set(
     char *str,
-    uint32 arg_length,
+    size_t arg_length,
     CHARSET_INFO *cs
   );
   void set(
     const char *str,
-    uint32 arg_length,
+    size_t arg_length,
     CHARSET_INFO *cs
   );
   bool set_ascii(
     const char *str,
-    uint32 arg_length
+    size_t arg_length
   );
   void set_quick(
     char *str,
-    uint32 arg_length,
+    size_t arg_length,
     CHARSET_INFO *cs
   );
   bool set_int(
@@ -333,16 +333,16 @@ class spider_string
   void chop();
   void free();
   bool alloc(
-    uint32 arg_length
+    size_t arg_length
   );
   bool real_alloc(
-    uint32 arg_length
+    size_t arg_length
   );
   bool realloc(
-    uint32 arg_length
+    size_t arg_length
   );
   void shrink(
-    uint32 arg_length
+    size_t arg_length
   );
   bool is_alloced();
   spider_string& operator = (
@@ -357,29 +357,29 @@ class spider_string
   );
   bool copy(
     const char *s,
-    uint32 arg_length,
+    size_t arg_length,
     CHARSET_INFO *cs
   );
   bool needs_conversion(
-    uint32 arg_length,
+    size_t arg_length,
     CHARSET_INFO *cs_from,
     CHARSET_INFO *cs_to,
-    uint32 *offset
+    size_t *offset
   );
   bool copy_aligned(
     const char *s,
-    uint32 arg_length,
-    uint32 offset,
+    size_t arg_length,
+    size_t offset,
     CHARSET_INFO *cs
   );
   bool set_or_copy_aligned(
     const char *s,
-    uint32 arg_length,
+    size_t arg_length,
     CHARSET_INFO *cs
   );
   bool copy(
     const char *s,
-    uint32 arg_length,
+    size_t arg_length,
     CHARSET_INFO *csfrom,
     CHARSET_INFO *csto,
     uint *errors
@@ -398,11 +398,11 @@ class spider_string
   );
   bool append(
     const char *s,
-    uint32 arg_length
+    size_t arg_length
   );
   bool append(
     const char *s,
-    uint32 arg_length,
+    size_t arg_length,
     CHARSET_INFO *cs
   );
   bool append_ulonglong(
@@ -410,58 +410,58 @@ class spider_string
   );
   bool append(
     IO_CACHE *file,
-    uint32 arg_length
+    size_t arg_length
   );
   bool append_with_prefill(
     const char *s,
-    uint32 arg_length,
-    uint32 full_length,
+    size_t arg_length,
+    size_t full_length,
     char fill_char
   );
   int strstr(
     const String &search,
-    uint32 offset = 0
+    size_t offset = 0
   );
   int strrstr(
     const String &search,
-    uint32 offset = 0
+    size_t offset = 0
   );
   bool replace(
-    uint32 offset,
-    uint32 arg_length,
+    size_t offset,
+    size_t arg_length,
     const char *to,
-    uint32 length
+    size_t length
   );
   bool replace(
-    uint32 offset,
-    uint32 arg_length,
+    size_t offset,
+    size_t arg_length,
     const String &to
   );
   inline bool append(
     char chr
   );
   bool fill(
-    uint32 max_length,
+    size_t max_length,
     char fill
   );
   void strip_sp();
-  uint32 numchars();
+  size_t numchars();
   int charpos(
     int i,
-    uint32 offset=0
+    size_t offset=0
   );
   int reserve(
-    uint32 space_needed
+    size_t space_needed
   );
   int reserve(
-    uint32 space_needed,
-    uint32 grow_by
+    size_t space_needed,
+    size_t grow_by
   );
   void q_append(
     const char c
   );
   void q_append(
-    const uint32 n
+    const size_t n
   );
   void q_append(
     double d
@@ -471,15 +471,15 @@ class spider_string
   );
   void q_append(
     const char *data,
-    uint32 data_len
+    size_t data_len
   );
   void write_at_position(
     int position,
-    uint32 value
+    size_t value
   );
   void qs_append(
     const char *str,
-    uint32 len
+    size_t len
   );
   void qs_append(
     double d
@@ -497,13 +497,13 @@ class spider_string
     uint i
   );
   char *prep_append(
-    uint32 arg_length,
-    uint32 step_alloc
+    size_t arg_length,
+    size_t step_alloc
   );
   bool append(
     const char *s,
-    uint32 arg_length,
-    uint32 step_alloc
+    size_t arg_length,
+    size_t step_alloc
   );
   void append_escape_string(
     const char *st,
diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc
index 1c1c440c2ed..0b18a0b883b 100644
--- a/storage/spider/spd_db_mysql.cc
+++ b/storage/spider/spd_db_mysql.cc
@@ -2922,7 +2922,7 @@ int spider_db_mysql_util::append_column_value(
     tmp_str.mem_calc();
   }
   DBUG_PRINT("info", ("spider field->type() is %d", field->type()));
-  DBUG_PRINT("info", ("spider ptr->length() is %d", ptr->length()));
+  DBUG_PRINT("info", ("spider ptr->length() is %zu", ptr->length()));
 /*
   if (
     field->type() == MYSQL_TYPE_BIT ||
@@ -8805,7 +8805,7 @@ int spider_mysql_handler::append_insert_terminator(
 ) {
   DBUG_ENTER("spider_mysql_handler::append_insert_terminator");
   DBUG_PRINT("info",("spider this=%p", this));
-  DBUG_PRINT("info",("spider dup_update_sql.length=%u", dup_update_sql.length()));
+  DBUG_PRINT("info",("spider dup_update_sql.length=%zu", dup_update_sql.length()));
   if (
     spider->result_list.insert_dup_update_pushdown &&
     dup_update_sql.length()
@@ -9521,7 +9521,7 @@ bool spider_mysql_handler::is_bulk_insert_exec_period(
 ) {
   DBUG_ENTER("spider_mysql_handler::is_bulk_insert_exec_period");
   DBUG_PRINT("info",("spider this=%p", this));
-  DBUG_PRINT("info",("spider insert_sql.length=%u", insert_sql.length()));
+  DBUG_PRINT("info",("spider insert_sql.length=%zu", insert_sql.length()));
   DBUG_PRINT("info",("spider insert_pos=%d", insert_pos));
   DBUG_PRINT("info",("spider insert_sql=%s", insert_sql.c_ptr_safe()));
   if (
@@ -10089,7 +10089,7 @@ int spider_mysql_handler::set_sql_for_exec(
       append_table_name_with_adjusting(exec_insert_sql, link_idx,
         sql_type);
       exec_insert_sql->length(tmp_pos);
-      DBUG_PRINT("info",("spider exec_insert_sql->length=%u",
+      DBUG_PRINT("info",("spider exec_insert_sql->length=%zu",
         exec_insert_sql->length()));
       DBUG_PRINT("info",("spider exec_insert_sql=%s",
         exec_insert_sql->c_ptr_safe()));
diff --git a/storage/spider/spd_malloc.cc b/storage/spider/spd_malloc.cc
index 8d348682edf..f4868602898 100644
--- a/storage/spider/spd_malloc.cc
+++ b/storage/spider/spd_malloc.cc
@@ -253,7 +253,7 @@ void *spider_bulk_alloc_mem(
 #define SPIDER_STRING_CALC_MEM \
   if (mem_calc_inited) \
   { \
-    uint32 new_alloc_mem = \
+    size_t new_alloc_mem = \
       (this->str.is_alloced() ? this->str.alloced_length() : 0); \
     if (new_alloc_mem != current_alloc_mem) \
     { \
@@ -277,7 +277,7 @@ spider_string::spider_string(
 }
 
 spider_string::spider_string(
-  uint32 length_arg
+  size_t length_arg
 ) : str(length_arg), next(NULL)
 {
   DBUG_ENTER("spider_string::spider_string");
@@ -299,7 +299,7 @@ spider_string::spider_string(
 
 spider_string::spider_string(
   const char *str,
-  uint32 len,
+  size_t len,
   CHARSET_INFO *cs
 ) : str(str, len, cs), next(NULL)
 {
@@ -311,7 +311,7 @@ spider_string::spider_string(
 
 spider_string::spider_string(
   char *str,
-  uint32 len,
+  size_t len,
   CHARSET_INFO *cs
 ) : str(str, len, cs), next(NULL)
 {
@@ -396,21 +396,21 @@ CHARSET_INFO *spider_string::charset() const
   DBUG_RETURN(str.charset());
 }
 
-uint32 spider_string::length() const
+size_t spider_string::length() const
 {
   DBUG_ENTER("spider_string::length");
   DBUG_PRINT("info",("spider this=%p", this));
   DBUG_RETURN(str.length());
 }
 
-uint32 spider_string::alloced_length() const
+size_t spider_string::alloced_length() const
 {
   DBUG_ENTER("spider_string::alloced_length");
   DBUG_PRINT("info",("spider this=%p", this));
   DBUG_RETURN(str.alloced_length());
 }
 
-char &spider_string::operator [] (uint32 i) const
+char &spider_string::operator [] (size_t i) const
 {
   DBUG_ENTER("spider_string::operator []");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -418,7 +418,7 @@ char &spider_string::operator [] (uint32 i) const
 }
 
 void spider_string::length(
-  uint32 len
+  size_t len
 ) {
   DBUG_ENTER("spider_string::length");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -480,8 +480,8 @@ LEX_STRING spider_string::lex_string() const
 
 void spider_string::set(
   String &str,
-  uint32 offset,
-  uint32 arg_length
+  size_t offset,
+  size_t arg_length
 ) {
   DBUG_ENTER("spider_string::set");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -495,7 +495,7 @@ void spider_string::set(
 
 void spider_string::set(
   char *str,
-  uint32 arg_length,
+  size_t arg_length,
   CHARSET_INFO *cs
 ) {
   DBUG_ENTER("spider_string::set");
@@ -510,7 +510,7 @@ void spider_string::set(
 
 void spider_string::set(
   const char *str,
-  uint32 arg_length,
+  size_t arg_length,
   CHARSET_INFO *cs
 ) {
   DBUG_ENTER("spider_string::set");
@@ -525,7 +525,7 @@ void spider_string::set(
 
 bool spider_string::set_ascii(
   const char *str,
-  uint32 arg_length
+  size_t arg_length
 ) {
   DBUG_ENTER("spider_string::set_ascii");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -539,7 +539,7 @@ bool spider_string::set_ascii(
 
 void spider_string::set_quick(
   char *str,
-  uint32 arg_length,
+  size_t arg_length,
   CHARSET_INFO *cs
 ) {
   DBUG_ENTER("spider_string::set_quick");
@@ -634,7 +634,7 @@ void spider_string::free()
   DBUG_VOID_RETURN;
 }
 
-bool spider_string::alloc(uint32 arg_length)
+bool spider_string::alloc(size_t arg_length)
 {
   bool res;
   DBUG_ENTER("spider_string::alloc");
@@ -647,7 +647,7 @@ bool spider_string::alloc(uint32 arg_length)
   DBUG_RETURN(res);
 }
 
-bool spider_string::real_alloc(uint32 arg_length)
+bool spider_string::real_alloc(size_t arg_length)
 {
   bool res;
   DBUG_ENTER("spider_string::real_alloc");
@@ -667,7 +667,7 @@ bool spider_string::real_alloc(uint32 arg_length)
   DBUG_RETURN(res);
 }
 
-bool spider_string::realloc(uint32 arg_length)
+bool spider_string::realloc(size_t arg_length)
 {
   bool res;
   DBUG_ENTER("spider_string::realloc");
@@ -686,7 +686,7 @@ bool spider_string::realloc(uint32 arg_length)
 }
 
 void spider_string::shrink(
-  uint32 arg_length
+  size_t arg_length
 ) {
   DBUG_ENTER("spider_string::shrink");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -758,7 +758,7 @@ bool spider_string::copy(
 
 bool spider_string::copy(
   const char *s,
-  uint32 arg_length,
+  size_t arg_length,
   CHARSET_INFO *cs
 ) {
   DBUG_ENTER("spider_string::copy");
@@ -772,10 +772,10 @@ bool spider_string::copy(
 }
 
 bool spider_string::needs_conversion(
-  uint32 arg_length,
+  size_t arg_length,
   CHARSET_INFO *cs_from,
   CHARSET_INFO *cs_to,
-  uint32 *offset
+  size_t *offset
 ) {
   DBUG_ENTER("spider_string::needs_conversion");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -784,8 +784,8 @@ bool spider_string::needs_conversion(
 
 bool spider_string::copy_aligned(
   const char *s,
-  uint32 arg_length,
-  uint32 offset,
+  size_t arg_length,
+  size_t offset,
   CHARSET_INFO *cs
 ) {
   DBUG_ENTER("spider_string::copy_aligned");
@@ -800,7 +800,7 @@ bool spider_string::copy_aligned(
 
 bool spider_string::set_or_copy_aligned(
   const char *s,
-  uint32 arg_length,
+  size_t arg_length,
   CHARSET_INFO *cs
 ) {
   DBUG_ENTER("spider_string::set_or_copy_aligned");
@@ -815,7 +815,7 @@ bool spider_string::set_or_copy_aligned(
 
 bool spider_string::copy(
   const char *s,
-  uint32 arg_length,
+  size_t arg_length,
   CHARSET_INFO *csfrom,
   CHARSET_INFO *csto,
   uint *errors
@@ -884,7 +884,7 @@ bool spider_string::append(
 
 bool spider_string::append(
   const char *s,
-  uint32 arg_length
+  size_t arg_length
 ) {
   DBUG_ENTER("spider_string::append");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -898,7 +898,7 @@ bool spider_string::append(
 
 bool spider_string::append(
   const char *s,
-  uint32 arg_length,
+  size_t arg_length,
   CHARSET_INFO *cs
 ) {
   DBUG_ENTER("spider_string::append");
@@ -926,7 +926,7 @@ bool spider_string::append_ulonglong(
 
 bool spider_string::append(
   IO_CACHE *file,
-  uint32 arg_length
+  size_t arg_length
 ) {
   DBUG_ENTER("spider_string::append");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -940,8 +940,8 @@ bool spider_string::append(
 
 bool spider_string::append_with_prefill(
   const char *s,
-  uint32 arg_length,
-  uint32 full_length,
+  size_t arg_length,
+  size_t full_length,
   char fill_char
 ) {
   DBUG_ENTER("spider_string::append_with_prefill");
@@ -957,7 +957,7 @@ bool spider_string::append_with_prefill(
 
 int spider_string::strstr(
   const String &search,
-  uint32 offset
+  size_t offset
 ) {
   DBUG_ENTER("spider_string::strstr");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -966,7 +966,7 @@ int spider_string::strstr(
 
 int spider_string::strrstr(
   const String &search,
-  uint32 offset
+  size_t offset
 ) {
   DBUG_ENTER("spider_string::strrstr");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -974,10 +974,10 @@ int spider_string::strrstr(
 }
 
 bool spider_string::replace(
-  uint32 offset,
-  uint32 arg_length,
+  size_t offset,
+  size_t arg_length,
   const char *to,
-  uint32 length
+  size_t length
 ) {
   DBUG_ENTER("spider_string::replace");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -990,8 +990,8 @@ bool spider_string::replace(
 }
 
 bool spider_string::replace(
-  uint32 offset,
-  uint32 arg_length,
+  size_t offset,
+  size_t arg_length,
   const String &to
 ) {
   DBUG_ENTER("spider_string::replace");
@@ -1018,7 +1018,7 @@ bool spider_string::append(
 }
 
 bool spider_string::fill(
-  uint32 max_length,
+  size_t max_length,
   char fill
 ) {
   DBUG_ENTER("spider_string::fill");
@@ -1039,7 +1039,7 @@ void spider_string::strip_sp()
   DBUG_VOID_RETURN;
 }
 
-uint32 spider_string::numchars()
+size_t spider_string::numchars()
 {
   DBUG_ENTER("spider_string::numchars");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -1048,7 +1048,7 @@ uint32 spider_string::numchars()
 
 int spider_string::charpos(
   int i,
-  uint32 offset
+  size_t offset
 ) {
   DBUG_ENTER("spider_string::charpos");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -1056,7 +1056,7 @@ int spider_string::charpos(
 }
 
 int spider_string::reserve(
-  uint32 space_needed
+  size_t space_needed
 ) {
   DBUG_ENTER("spider_string::reserve");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -1069,8 +1069,8 @@ int spider_string::reserve(
 }
 
 int spider_string::reserve(
-  uint32 space_needed,
-  uint32 grow_by
+  size_t space_needed,
+  size_t grow_by
 ) {
   DBUG_ENTER("spider_string::reserve");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -1092,7 +1092,7 @@ void spider_string::q_append(
 }
 
 void spider_string::q_append(
-  const uint32 n
+  size_t n
 ) {
   DBUG_ENTER("spider_string::q_append");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -1120,7 +1120,7 @@ void spider_string::q_append(
 
 void spider_string::q_append(
   const char *data,
-  uint32 data_len
+  size_t data_len
 ) {
   DBUG_ENTER("spider_string::q_append");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -1130,7 +1130,7 @@ void spider_string::q_append(
 
 void spider_string::write_at_position(
   int position,
-  uint32 value
+  size_t value
 ) {
   DBUG_ENTER("spider_string::write_at_position");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -1140,7 +1140,7 @@ void spider_string::write_at_position(
 
 void spider_string::qs_append(
   const char *str,
-  uint32 len
+  size_t len
 ) {
   DBUG_ENTER("spider_string::qs_append");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -1194,8 +1194,8 @@ void spider_string::qs_append(
 }
 
 char *spider_string::prep_append(
-  uint32 arg_length,
-  uint32 step_alloc
+  size_t arg_length,
+  size_t step_alloc
 ) {
   DBUG_ENTER("spider_string::prep_append");
   DBUG_PRINT("info",("spider this=%p", this));
@@ -1209,8 +1209,8 @@ char *spider_string::prep_append(
 
 bool spider_string::append(
   const char *s,
-  uint32 arg_length,
-  uint32 step_alloc
+  size_t arg_length,
+  size_t step_alloc
 ) {
   DBUG_ENTER("spider_string::append");
   DBUG_PRINT("info",("spider this=%p", this));
diff --git a/storage/spider/spd_ping_table.cc b/storage/spider/spd_ping_table.cc
index 77a2969d061..53a327abb5e 100644
--- a/storage/spider/spd_ping_table.cc
+++ b/storage/spider/spd_ping_table.cc
@@ -107,7 +107,7 @@ SPIDER_TABLE_MON_LIST *spider_get_ping_table_mon_list(
   mutex_hash = spider_udf_calc_hash(str->c_ptr(),
     spider_param_udf_table_mon_mutex_count());
   DBUG_PRINT("info",("spider hash key=%s", str->c_ptr()));
-  DBUG_PRINT("info",("spider hash key length=%u", str->length()));
+  DBUG_PRINT("info",("spider hash key length=%zu", str->length()));
 #ifdef SPIDER_HAS_HASH_VALUE_TYPE
   hash_value = my_calc_hash(
     &spider_udf_table_mon_list_hash[mutex_hash],


More information about the commits mailing list