List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:July 9 2010 12:07pm
Subject:bzr push into mysql-5.1-bugteam branch (davi:3470 to 3472) Bug#45288
View as plain text  
 3472 Davi Arnaut	2010-07-09
      Bug#45288: pb2 returns a lot of compilation warnings on linux
      
      Although the C standard mandates that sprintf return the number
      of bytes written, some very ancient systems (i.e. SunOS 4)
      returned a pointer to the buffer instead. Since these systems
      are not supported anymore and are hopefully long dead by now,
      simply remove the portability wrapper that dealt with this
      discrepancy. The autoconf check was causing trouble with GCC.

    modified:
      client/mysqlbinlog.cc
      client/mysqlcheck.c
      client/sql_string.cc
      configure.in
      include/my_global.h
      sql-common/my_time.c
      sql/field.cc
      sql/item_timefunc.cc
      sql/log_event.cc
      sql/my_decimal.cc
      sql/partition_info.cc
      sql/protocol.cc
      sql/sql_acl.cc
      sql/sql_analyse.cc
      sql/sql_show.cc
      sql/sql_string.cc
      storage/federated/ha_federated.cc
      strings/decimal.c
      tests/mysql_client_test.c
 3471 Davi Arnaut	2010-07-09
      Bug#53445: Build with -Wall and fix warnings that it generates
      
      Introduce a MySQL maintainer/developer mode that enables
      a set of warning options for the C/C++ compiler. This mode
      is intended to help improve the overall quality of the code.
      
      The warning options are:
      
      C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Werror"
      CXX_WARNINGS="$C_WARNINGS -Wno-unused-parameter"
      
      Since -Wall is essentially a moving target, autoconf checks
      are not run with warning options enabled, in particualr -Werror.
      This decision might be revisited in the future. The patch also
      fixes a mistake in the makefiles, where automake CXXFLAGS would
      be set to CFLAGS.
     @ config/ac-macros/maintainer.m4
        Add a set of default compiler flags used when in maintainer mode.
     @ configure.in
        Hook into the maintainer mode. Disabled by default.

    added:
      config/ac-macros/maintainer.m4
    modified:
      configure.in
      plugin/daemon_example/Makefile.am
      storage/archive/Makefile.am
      storage/blackhole/Makefile.am
      storage/csv/Makefile.am
      storage/example/Makefile.am
      storage/federated/Makefile.am
      storage/ibmdb2i/Makefile.am
      storage/innobase/Makefile.am
      storage/innodb_plugin/Makefile.am
 3470 Sergey Glukhov	2010-07-09
      Bug#54416 MAX from JOIN with HAVING returning NULL with 5.1 and Empty set
      The problem there is that HAVING condition evaluates const
      parts of condition despite the condition has references
      on aggregate functions. Table t1 became const tables
      after make_join_statistics and table1.pk = 1, HAVING is
      transformed into MAX(1) < 7 and taken away from HAVING.
      The fix is to skip evaluation of HAVING conts parts if
      HAVING condition has references on aggregate functions.
     @ mysql-test/r/having.result
        test case
     @ mysql-test/t/having.test
        test case
     @ sql/sql_select.cc
        skip evaluation of HAVING conts parts if
        HAVING condition has references on aggregate functions.

    modified:
      mysql-test/r/having.result
      mysql-test/t/having.test
      sql/sql_select.cc
=== modified file 'client/mysqlbinlog.cc'
--- a/client/mysqlbinlog.cc	2010-06-10 20:16:43 +0000
+++ b/client/mysqlbinlog.cc	2010-07-09 12:00:17 +0000
@@ -437,7 +437,7 @@ Exit_status Load_log_processor::process_
   ptr= fname + target_dir_name_len;
   memcpy(ptr,bname,blen);
   ptr+= blen;
-  ptr+= my_sprintf(ptr, (ptr, "-%x", file_id));
+  ptr+= sprintf(ptr, "-%x", file_id);
 
   if ((file= create_unique_file(fname,ptr)) < 0)
   {

=== modified file 'client/mysqlcheck.c'
--- a/client/mysqlcheck.c	2010-06-10 20:16:43 +0000
+++ b/client/mysqlcheck.c	2010-07-09 12:00:17 +0000
@@ -703,8 +703,7 @@ static int handle_request_for_tables(cha
   if (opt_all_in_1)
   {
     /* No backticks here as we added them before */
-    query_length= my_sprintf(query,
-			     (query, "%s TABLE %s %s", op, tables, options));
+    query_length= sprintf(query, "%s TABLE %s %s", op, tables, options);
   }
   else
   {

=== modified file 'client/sql_string.cc'
--- a/client/sql_string.cc	2009-03-24 13:58:52 +0000
+++ b/client/sql_string.cc	2010-07-09 12:00:17 +0000
@@ -122,7 +122,8 @@ bool String::set(double num,uint decimal
   str_charset=cs;
   if (decimals >= NOT_FIXED_DEC)
   {
-    uint32 len= my_sprintf(buff,(buff, "%.15g",num));// Enough for a DATETIME
+    // Enough for a DATETIME
+    uint32 len= sprintf(buff, "%.15g", num);
     return copy(buff, len, &my_charset_latin1, cs, &dummy_errors);
   }
 #ifdef HAVE_FCONVERT
@@ -674,7 +675,7 @@ void String::qs_append(const char *str,
 void String::qs_append(double d)
 {
   char *buff = Ptr + str_length;
-  str_length+= my_sprintf(buff, (buff, "%.15g", d));
+  str_length+= sprintf(buff, buff, "%.15g", d);
 }
 
 void String::qs_append(double *d)

=== added file 'config/ac-macros/maintainer.m4'
--- a/config/ac-macros/maintainer.m4	1970-01-01 00:00:00 +0000
+++ b/config/ac-macros/maintainer.m4	2010-07-09 11:37:51 +0000
@@ -0,0 +1,66 @@
+#
+# Control aspects of the development environment which are
+# specific to MySQL maintainers and developers.
+#
+AC_DEFUN([MY_MAINTAINER_MODE], [
+  AC_MSG_CHECKING([whether to enable the maintainer-specific development environment])
+  AC_ARG_ENABLE([mysql-maintainer-mode],
+    [AS_HELP_STRING([--enable-mysql-maintainer-mode],
+                    [Enable a MySQL maintainer-specific development environment])],
+    [USE_MYSQL_MAINTAINER_MODE=$enableval],
+    [USE_MYSQL_MAINTAINER_MODE=no])
+  AC_MSG_RESULT([$USE_MYSQL_MAINTAINER_MODE])
+])
+
+# Set warning options required under maintainer mode.
+AC_DEFUN([MY_MAINTAINER_MODE_WARNINGS], [
+  # Setup GCC warning options.
+  AS_IF([test "$GCC" = "yes"], [
+    C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Werror"
+    CXX_WARNINGS="${C_WARNINGS} -Wno-unused-parameter"
+  ])
+
+  # Test whether the warning options work.
+  # Test C options
+  AS_IF([test -n "$C_WARNINGS"], [
+    save_CFLAGS="$CFLAGS"
+    AC_MSG_CHECKING([whether to use C warning options ${C_WARNINGS}])
+    AC_LANG_PUSH(C)
+    CFLAGS="$CFLAGS ${C_WARNINGS}"
+    AC_LANG_WERROR
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [myac_c_warning_flags=yes],
+                      [myac_c_warning_flags=no])
+    AC_LANG_POP()
+    AC_MSG_RESULT([$myac_c_warning_flags])
+    CFLAGS="$save_CFLAGS"
+  ])
+
+  # Test C++ options
+  AS_IF([test -n "$CXX_WARNINGS"], [
+    save_CXXFLAGS="$CXXFLAGS"
+    AC_MSG_CHECKING([whether to use C++ warning options ${CXX_WARNINGS}])
+    AC_LANG_PUSH(C++)
+    CXXFLAGS="$CXXFLAGS ${CXX_WARNINGS}"
+    AC_LANG_WERROR
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [myac_cxx_warning_flags=yes],
+                      [myac_cxx_warning_flags=no])
+    AC_LANG_POP()
+    AC_MSG_RESULT([$myac_cxx_warning_flags])
+    CXXFLAGS="$save_CXXFLAGS"
+  ])
+
+  # Set compile flag variables.
+  AS_IF([test "$myac_c_warning_flags" = "yes"], [
+    AM_CFLAGS="${AM_CFLAGS} ${C_WARNINGS}"
+    AC_SUBST([AM_CFLAGS])])
+  AS_IF([test "$myac_cxx_warning_flags" = "yes"], [
+    AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS}"
+    AC_SUBST([AM_CXXFLAGS])])
+])
+
+
+# Set compiler flags required under maintainer mode.
+AC_DEFUN([MY_MAINTAINER_MODE_SETUP], [
+  AS_IF([test "$USE_MYSQL_MAINTAINER_MODE" = "yes"],
+        [MY_MAINTAINER_MODE_WARNINGS])
+])

=== modified file 'configure.in'
--- a/configure.in	2010-07-06 18:36:31 +0000
+++ b/configure.in	2010-07-09 12:00:17 +0000
@@ -65,6 +65,7 @@ MYSQL_TCP_PORT_DEFAULT=3306
 MYSQL_UNIX_ADDR_DEFAULT="/tmp/mysql.sock"
 
 dnl Include m4 
+sinclude(config/ac-macros/maintainer.m4)
 sinclude(config/ac-macros/alloca.m4)
 sinclude(config/ac-macros/check_cpu.m4)
 sinclude(config/ac-macros/character_sets.m4)
@@ -102,6 +103,8 @@ AC_SUBST(SHARED_LIB_MAJOR_VERSION)
 AC_SUBST(SHARED_LIB_VERSION)
 AC_SUBST(AVAILABLE_LANGUAGES)
 
+# Whether the maintainer mode should be enabled.
+MY_MAINTAINER_MODE
 
 # Canonicalize the configuration name.
 
@@ -275,40 +278,6 @@ AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL
 AC_CHECK_PROG(PDFMANUAL, pdftex, manual.pdf)
 AC_CHECK_PROG(DVIS,      tex,    manual.dvi)
 
-#check the return type of sprintf
-AC_MSG_CHECKING("return type of sprintf")
-AC_TRY_RUN([
-  int main()
-    {
-      char* s = "hello";
-      char buf[6];
-      if((int)sprintf(buf, s) == strlen(s))
-	return 0;
-      
-      return -1;
-     }
-   ],
-   [AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf])
-   AC_MSG_RESULT("int")],
-   [AC_TRY_RUN([
- int main()
-   {
-     char* s = "hello";
-     char buf[6];
-     if((char*)sprintf(buf,s) == buf + strlen(s))
-       return 0;
-     return -1;
-   }           ],
-               [AC_DEFINE(SPRINTF_RETURNS_PTR, [1], [Broken sprintf])
-                AC_MSG_RESULT("ptr")],
-               [AC_DEFINE(SPRINTF_RETURNS_GARBAGE, [1], [Broken sprintf])
-                AC_MSG_RESULT("garbage")]
-   )],
-   # Cross compile, assume POSIX
-   [AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf])
-    AC_MSG_RESULT("int (we assume)")]
-)
-
 AC_PATH_PROG(uname_prog, uname, no)
 
 # We should go through this and put all the explictly system dependent
@@ -2889,6 +2858,12 @@ do
 done
 AC_SUBST(sql_union_dirs)
 
+#
+# Setup maintainer mode options by the end to not disturb
+# system and other checks.
+#
+MY_MAINTAINER_MODE_SETUP
+
 # Some usefull subst
 AC_SUBST(CC)
 AC_SUBST(GXX)

=== modified file 'include/my_global.h'
--- a/include/my_global.h	2010-07-02 18:30:47 +0000
+++ b/include/my_global.h	2010-07-09 12:00:17 +0000
@@ -1467,17 +1467,6 @@ do { doubleget_union _tmp; \
 
 #endif /* WORDS_BIGENDIAN */
 
-/* sprintf does not always return the number of bytes :- */
-#ifdef SPRINTF_RETURNS_INT
-#define my_sprintf(buff,args) sprintf args
-#else
-#ifdef SPRINTF_RETURNS_PTR
-#define my_sprintf(buff,args) ((int)(sprintf args - buff))
-#else
-#define my_sprintf(buff,args) ((ulong) sprintf args, (ulong) strlen(buff))
-#endif
-#endif
-
 #ifndef THREAD
 #define thread_safe_increment(V,L) (V)++
 #define thread_safe_decrement(V,L) (V)--

=== modified file 'plugin/daemon_example/Makefile.am'
--- a/plugin/daemon_example/Makefile.am	2008-01-02 13:00:46 +0000
+++ b/plugin/daemon_example/Makefile.am	2010-07-09 11:37:51 +0000
@@ -27,14 +27,14 @@ INCLUDES =              -I$(top_srcdir)/
 EXTRA_LTLIBRARIES =	libdaemon_example.la
 pkgplugin_LTLIBRARIES =	@plugin_daemon_example_shared_target@
 libdaemon_example_la_LDFLAGS =	-module -rpath $(pkgplugindir)
-libdaemon_example_la_CXXFLAGS=	$(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+libdaemon_example_la_CXXFLAGS=	$(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
 libdaemon_example_la_CFLAGS =	$(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
 libdaemon_example_la_SOURCES =	daemon_example.cc
 
 
 EXTRA_LIBRARIES =	libdaemon_example.a
 noinst_LIBRARIES =	@plugin_daemon_example_static_target@
-libdaemon_example_a_CXXFLAGS =	$(AM_CFLAGS)
+libdaemon_example_a_CXXFLAGS =	$(AM_CXXFLAGS)
 libdaemon_example_a_CFLAGS =	$(AM_CFLAGS)
 libdaemon_example_a_SOURCES=	daemon_example.cc
 

=== modified file 'sql-common/my_time.c'
--- a/sql-common/my_time.c	2009-09-17 15:25:52 +0000
+++ b/sql-common/my_time.c	2010-07-09 12:00:17 +0000
@@ -1024,30 +1024,21 @@ void set_zero_time(MYSQL_TIME *tm, enum
 int my_time_to_str(const MYSQL_TIME *l_time, char *to)
 {
   uint extra_hours= 0;
-  return my_sprintf(to, (to, "%s%02u:%02u:%02u",
-                         (l_time->neg ? "-" : ""),
-                         extra_hours+ l_time->hour,
-                         l_time->minute,
-                         l_time->second));
+  return sprintf(to, "%s%02u:%02u:%02u", (l_time->neg ? "-" : ""),
+                 extra_hours+ l_time->hour, l_time->minute, l_time->second);
 }
 
 int my_date_to_str(const MYSQL_TIME *l_time, char *to)
 {
-  return my_sprintf(to, (to, "%04u-%02u-%02u",
-                         l_time->year,
-                         l_time->month,
-                         l_time->day));
+  return sprintf(to, "%04u-%02u-%02u",
+                 l_time->year, l_time->month, l_time->day);
 }
 
 int my_datetime_to_str(const MYSQL_TIME *l_time, char *to)
 {
-  return my_sprintf(to, (to, "%04u-%02u-%02u %02u:%02u:%02u",
-                         l_time->year,
-                         l_time->month,
-                         l_time->day,
-                         l_time->hour,
-                         l_time->minute,
-                         l_time->second));
+  return sprintf(to, "%04u-%02u-%02u %02u:%02u:%02u",
+                 l_time->year, l_time->month, l_time->day,
+                 l_time->hour, l_time->minute, l_time->second);
 }
 
 

=== modified file 'sql/field.cc'
--- a/sql/field.cc	2010-07-02 18:30:47 +0000
+++ b/sql/field.cc	2010-07-09 12:00:17 +0000
@@ -2277,7 +2277,7 @@ int Field_decimal::store(double nr)
   snprintf(buff,sizeof(buff)-1, "%.*f",(int) dec,nr);
   length= strlen(buff);
 #else
-  length= my_sprintf(buff,(buff,"%.*f",dec,nr));
+  length= sprintf(buff, "%.*f", dec, nr);
 #endif
 
   if (length > field_length)
@@ -4259,7 +4259,7 @@ String *Field_float::val_str(String *val
     snprintf(to,to_length-1,"%.*f",dec,nr);
     to=strend(to);
 #else
-    to+= my_sprintf(to,(to,"%.*f",dec,nr));
+    to+= sprintf(to, "%.*f", dec, nr);
 #endif
 #endif
   }
@@ -4617,7 +4617,7 @@ String *Field_double::val_str(String *va
     snprintf(to,to_length-1,"%.*f",dec,nr);
     to=strend(to);
 #else
-    to+= my_sprintf(to,(to,"%.*f",dec,nr));
+    to+= sprintf(to, "%.*f", dec, nr);
 #endif
 #endif
   }
@@ -6461,7 +6461,7 @@ int Field_str::store(double nr)
   /* Limit precision to DBL_DIG to avoid garbage past significant digits */
   set_if_smaller(digits, DBL_DIG);
   
-  length= (uint) my_sprintf(buff, (buff, "%-.*g", digits, nr));
+  length= (uint) sprintf(buff, "%-.*g", digits, nr);
 
 #ifdef __WIN__
   /*
@@ -10419,7 +10419,7 @@ Field::set_datetime_warning(MYSQL_ERROR:
   {
     /* DBL_DIG is enough to print '-[digits].E+###' */
     char str_nr[DBL_DIG + 8];
-    uint str_len= my_sprintf(str_nr, (str_nr, "%g", nr));
+    uint str_len= sprintf(str_nr, "%g", nr);
     make_truncated_value_warning(thd, level, str_nr, str_len, ts_type,
                                  field_name);
   }

=== modified file 'sql/item_timefunc.cc'
--- a/sql/item_timefunc.cc	2010-02-26 13:16:46 +0000
+++ b/sql/item_timefunc.cc	2010-07-09 12:00:17 +0000
@@ -754,13 +754,11 @@ bool make_date_time(DATE_TIME_FORMAT *fo
 	str->append(hours_i < 12 ? "AM" : "PM",2);
 	break;
       case 'r':
-	length= my_sprintf(intbuff, 
-		   (intbuff, 
-		    ((l_time->hour % 24) < 12) ?
-                    "%02d:%02d:%02d AM" : "%02d:%02d:%02d PM",
-		    (l_time->hour+11)%12+1,
-		    l_time->minute,
-		    l_time->second));
+	length= sprintf(intbuff, ((l_time->hour % 24) < 12) ?
+                        "%02d:%02d:%02d AM" : "%02d:%02d:%02d PM",
+		        (l_time->hour+11)%12+1,
+		        l_time->minute,
+		        l_time->second);
 	str->append(intbuff, length);
 	break;
       case 'S':
@@ -769,12 +767,8 @@ bool make_date_time(DATE_TIME_FORMAT *fo
 	str->append_with_prefill(intbuff, length, 2, '0');
 	break;
       case 'T':
-	length= my_sprintf(intbuff, 
-		   (intbuff, 
-		    "%02d:%02d:%02d", 
-		    l_time->hour, 
-		    l_time->minute,
-		    l_time->second));
+	length= sprintf(intbuff,  "%02d:%02d:%02d",
+                        l_time->hour, l_time->minute, l_time->second);
 	str->append(intbuff, length);
 	break;
       case 'U':
@@ -2985,12 +2979,12 @@ String *Item_func_maketime::val_str(Stri
     char buf[28];
     char *ptr= longlong10_to_str(hour, buf, args[0]->unsigned_flag ? 10 : -10);
     int len = (int)(ptr - buf) +
-      my_sprintf(ptr, (ptr, ":%02u:%02u", (uint)minute, (uint)second));
+      sprintf(ptr, ":%02u:%02u", (uint) minute, (uint) second);
     make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
                                  buf, len, MYSQL_TIMESTAMP_TIME,
                                  NullS);
   }
-  
+
   if (make_time_with_warn((DATE_TIME_FORMAT *) 0, &ltime, str))
   {
     null_value= 1;

=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2010-07-08 02:44:26 +0000
+++ b/sql/log_event.cc	2010-07-09 12:00:17 +0000
@@ -1664,17 +1664,17 @@ beg:
       int i, end;
       char buff[512], *pos;
       pos= buff;
-      pos+= my_sprintf(buff, (buff, "%s", dec.sign() ? "-" : ""));
+      pos+= sprintf(buff, "%s", dec.sign() ? "-" : "");
       end= ROUND_UP(dec.frac) + ROUND_UP(dec.intg)-1;
       for (i=0; i < end; i++)
-        pos+= my_sprintf(pos, (pos, "%09d.", dec.buf[i]));
-      pos+= my_sprintf(pos, (pos, "%09d", dec.buf[i]));
+        pos+= sprintf(pos, "%09d.", dec.buf[i]);
+      pos+= sprintf(pos, "%09d", dec.buf[i]);
       my_b_printf(file, "%s", buff);
       my_snprintf(typestr, typestr_length, "DECIMAL(%d,%d)",
                   precision, decimals);
       return bin_size;
     }
-    
+
   case MYSQL_TYPE_FLOAT:
     {
       float fl;
@@ -5481,8 +5481,7 @@ void User_var_log_event::pack_info(Proto
       if (!(buf= (char*) my_malloc(val_offset + FLOATING_POINT_BUFFER,
                                    MYF(MY_WME))))
         return;
-      event_len+= my_sprintf(buf + val_offset,
-			     (buf + val_offset, "%.14g", real_val));
+      event_len+= sprintf(buf + val_offset, "%.14g", real_val);
       break;
     case INT_RESULT:
       if (!(buf= (char*) my_malloc(val_offset + 22, MYF(MY_WME))))
@@ -5664,7 +5663,7 @@ void User_var_log_event::print(FILE* fil
       double real_val;
       char real_buf[FMT_G_BUFSIZE(14)];
       float8get(real_val, val);
-      my_sprintf(real_buf, (real_buf, "%.14g", real_val));
+      sprintf(real_buf, "%.14g", real_val);
       my_b_printf(&cache, ":=%s%s\n", real_buf, print_event_info->delimiter);
       break;
     case INT_RESULT:
@@ -6414,10 +6413,9 @@ void Append_block_log_event::print(FILE*
 void Append_block_log_event::pack_info(Protocol *protocol)
 {
   char buf[256];
-  uint length;
-  length= (uint) my_sprintf(buf,
-			    (buf, ";file_id=%u;block_len=%u", file_id,
-			     block_len));
+  size_t length;
+  length= my_snprintf(buf, sizeof(buf), ";file_id=%u;block_len=%u",
+                      file_id, block_len);
   protocol->store(buf, length, &my_charset_bin);
 }
 
@@ -6566,9 +6564,9 @@ void Delete_file_log_event::print(FILE*
 void Delete_file_log_event::pack_info(Protocol *protocol)
 {
   char buf[64];
-  uint length;
-  length= (uint) my_sprintf(buf, (buf, ";file_id=%u", (uint) file_id));
-  protocol->store(buf, (int32) length, &my_charset_bin);
+  size_t length;
+  length= my_snprintf(buf, sizeof(buf), ";file_id=%u", (uint) file_id);
+  protocol->store(buf, length, &my_charset_bin);
 }
 #endif
 
@@ -6664,9 +6662,9 @@ void Execute_load_log_event::print(FILE*
 void Execute_load_log_event::pack_info(Protocol *protocol)
 {
   char buf[64];
-  uint length;
-  length= (uint) my_sprintf(buf, (buf, ";file_id=%u", (uint) file_id));
-  protocol->store(buf, (int32) length, &my_charset_bin);
+  size_t length;
+  length= my_snprintf(buf, sizeof(buf), ";file_id=%u", (uint) file_id);
+  protocol->store(buf, length, &my_charset_bin);
 }
 
 

=== modified file 'sql/my_decimal.cc'
--- a/sql/my_decimal.cc	2008-11-27 11:33:04 +0000
+++ b/sql/my_decimal.cc	2010-07-09 12:00:17 +0000
@@ -249,12 +249,12 @@ print_decimal(const my_decimal *dec)
   int i, end;
   char buff[512], *pos;
   pos= buff;
-  pos+= my_sprintf(buff, (buff, "Decimal: sign: %d  intg: %d  frac: %d  { ",
-                          dec->sign(), dec->intg, dec->frac));
+  pos+= sprintf(buff, "Decimal: sign: %d  intg: %d  frac: %d  { ",
+                dec->sign(), dec->intg, dec->frac);
   end= ROUND_UP(dec->frac)+ROUND_UP(dec->intg)-1;
   for (i=0; i < end; i++)
-    pos+= my_sprintf(pos, (pos, "%09d, ", dec->buf[i]));
-  pos+= my_sprintf(pos, (pos, "%09d }\n", dec->buf[i]));
+    pos+= sprintf(pos, "%09d, ", dec->buf[i]);
+  pos+= sprintf(pos, "%09d }\n", dec->buf[i]);
   fputs(buff, DBUG_FILE);
 }
 

=== modified file 'sql/partition_info.cc'
--- a/sql/partition_info.cc	2010-05-04 14:03:28 +0000
+++ b/sql/partition_info.cc	2010-07-09 12:00:17 +0000
@@ -103,8 +103,8 @@ char *partition_info::create_default_par
   {
     do
     {
-      my_sprintf(move_ptr, (move_ptr,"p%u", (start_no + i)));
-      move_ptr+=MAX_PART_NAME_SIZE;
+      sprintf(move_ptr, "p%u", (start_no + i));
+      move_ptr+= MAX_PART_NAME_SIZE;
     } while (++i < no_parts_arg);
   }
   else
@@ -135,7 +135,7 @@ char *partition_info::create_subpartitio
 
   if (likely(ptr != NULL))
   {
-    my_sprintf(ptr, (ptr, "%ssp%u", part_name, subpart_no));
+    my_snprintf(ptr, size_alloc, "%ssp%u", part_name, subpart_no);
   }
   else
   {

=== modified file 'sql/protocol.cc'
--- a/sql/protocol.cc	2010-03-23 15:00:50 +0000
+++ b/sql/protocol.cc	2010-07-09 12:00:17 +0000
@@ -1003,16 +1003,12 @@ bool Protocol_text::store(MYSQL_TIME *tm
 #endif
   char buff[40];
   uint length;
-  length= my_sprintf(buff,(buff, "%04d-%02d-%02d %02d:%02d:%02d",
-			   (int) tm->year,
-			   (int) tm->month,
-			   (int) tm->day,
-			   (int) tm->hour,
-			   (int) tm->minute,
-			   (int) tm->second));
+  length= sprintf(buff, "%04d-%02d-%02d %02d:%02d:%02d",
+                  (int) tm->year, (int) tm->month,
+                  (int) tm->day, (int) tm->hour,
+                  (int) tm->minute, (int) tm->second);
   if (tm->second_part)
-    length+= my_sprintf(buff+length,(buff+length, ".%06d",
-                                     (int)tm->second_part));
+    length+= sprintf(buff+length, ".%06d", (int) tm->second_part);
   return net_store_data((uchar*) buff, length);
 }
 
@@ -1046,13 +1042,11 @@ bool Protocol_text::store_time(MYSQL_TIM
   char buff[40];
   uint length;
   uint day= (tm->year || tm->month) ? 0 : tm->day;
-  length= my_sprintf(buff,(buff, "%s%02ld:%02d:%02d",
-			   tm->neg ? "-" : "",
-			   (long) day*24L+(long) tm->hour,
-			   (int) tm->minute,
-			   (int) tm->second));
+  length= sprintf(buff, "%s%02ld:%02d:%02d", tm->neg ? "-" : "",
+                  (long) day*24L+(long) tm->hour, (int) tm->minute,
+                  (int) tm->second);
   if (tm->second_part)
-    length+= my_sprintf(buff+length,(buff+length, ".%06d", (int)tm->second_part));
+    length+= sprintf(buff+length, ".%06d", (int) tm->second_part);
   return net_store_data((uchar*) buff, length);
 }
 

=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc	2010-07-04 04:02:49 +0000
+++ b/sql/sql_acl.cc	2010-07-09 12:00:17 +0000
@@ -1653,12 +1653,10 @@ bool change_password(THD *thd, const cha
   result= 0;
   if (mysql_bin_log.is_open())
   {
-    query_length=
-      my_sprintf(buff,
-                 (buff,"SET PASSWORD FOR '%-.120s'@'%-.120s'='%-.120s'",
-                  acl_user->user ? acl_user->user : "",
-                  acl_user->host.hostname ? acl_user->host.hostname : "",
-                  new_password));
+    query_length= sprintf(buff, "SET PASSWORD FOR '%-.120s'@'%-.120s'='%-.120s'",
+                          acl_user->user ? acl_user->user : "",
+                          acl_user->host.hostname ? acl_user->host.hostname : "",
+                          new_password);
     thd->clear_error();
     result= thd->binlog_query(THD::MYSQL_QUERY_TYPE, buff, query_length,
                               FALSE, FALSE, 0);

=== modified file 'sql/sql_analyse.cc'
--- a/sql/sql_analyse.cc	2009-06-17 14:56:44 +0000
+++ b/sql/sql_analyse.cc	2010-07-09 12:00:17 +0000
@@ -408,7 +408,7 @@ void field_real::add()
 
   if ((decs = decimals()) == NOT_FIXED_DEC)
   {
-    length= my_sprintf(buff, (buff, "%g", num));
+    length= sprintf(buff, "%g", num);
     if (rint(num) != num)
       max_notzero_dec_len = 1;
   }
@@ -419,7 +419,7 @@ void field_real::add()
     snprintf(buff, sizeof(buff)-1, "%-.*f", (int) decs, num);
     length = (uint) strlen(buff);
 #else
-    length= my_sprintf(buff, (buff, "%-.*f", (int) decs, num));
+    length= sprintf(buff, "%-.*f", (int) decs, num);
 #endif
 
     // We never need to check further than this
@@ -1006,9 +1006,9 @@ void field_decimal::get_opt_type(String
   my_decimal_set_zero(&zero);
   my_bool is_unsigned= (my_decimal_cmp(&zero, &min_arg) >= 0);
 
-  length= my_sprintf(buff, (buff, "DECIMAL(%d, %d)",
-                            (int) (max_length - (item->decimals ? 1 : 0)),
-                            item->decimals));
+  length= my_snprintf(buff, sizeof(buff), "DECIMAL(%d, %d)",
+                      (int) (max_length - (item->decimals ? 1 : 0)),
+                      item->decimals);
   if (is_unsigned)
     length= (uint) (strmov(buff+length, " UNSIGNED")- buff);
   answer->append(buff, length);

=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2010-07-07 09:15:58 +0000
+++ b/sql/sql_show.cc	2010-07-09 12:00:17 +0000
@@ -2278,7 +2278,7 @@ static bool show_status_array(THD *thd,
           value= ((char *) status_var + (ulong) value);
           /* fall through */
         case SHOW_DOUBLE:
-          end= buff + my_sprintf(buff, (buff, "%f", *(double*) value));
+          end= buff + sprintf(buff, "%f", *(double*) value);
           break;
         case SHOW_LONG_STATUS:
           value= ((char *) status_var + (ulong) value);

=== modified file 'sql/sql_string.cc'
--- a/sql/sql_string.cc	2009-07-31 17:14:52 +0000
+++ b/sql/sql_string.cc	2010-07-09 12:00:17 +0000
@@ -112,7 +112,8 @@ bool String::set_real(double num,uint de
   str_charset=cs;
   if (decimals >= NOT_FIXED_DEC)
   {
-    uint32 len= my_sprintf(buff,(buff, "%.15g",num));// Enough for a DATETIME
+    // Enough for a DATETIME
+    uint32 len= sprintf(buff, "%.15g", num);
     return copy(buff, len, &my_charset_latin1, cs, &dummy_errors);
   }
 #ifdef HAVE_FCONVERT
@@ -676,7 +677,7 @@ void String::qs_append(const char *str,
 void String::qs_append(double d)
 {
   char *buff = Ptr + str_length;
-  str_length+= my_sprintf(buff, (buff, "%.15g", d));
+  str_length+= sprintf(buff, "%.15g", d);
 }
 
 void String::qs_append(double *d)

=== modified file 'storage/archive/Makefile.am'
--- a/storage/archive/Makefile.am	2008-01-02 13:00:46 +0000
+++ b/storage/archive/Makefile.am	2010-07-09 11:37:51 +0000
@@ -36,14 +36,14 @@ noinst_PROGRAMS	=	archive_test archive_r
 EXTRA_LTLIBRARIES =	ha_archive.la
 pkgplugin_LTLIBRARIES =	@plugin_archive_shared_target@
 ha_archive_la_LDFLAGS =	-module -rpath $(pkgplugindir)
-ha_archive_la_CXXFLAGS=	$(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+ha_archive_la_CXXFLAGS=	$(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
 ha_archive_la_CFLAGS =	$(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
 ha_archive_la_SOURCES =	ha_archive.cc azio.c
 
 
 EXTRA_LIBRARIES =	libarchive.a
 noinst_LIBRARIES =	@plugin_archive_static_target@
-libarchive_a_CXXFLAGS =	$(AM_CFLAGS)
+libarchive_a_CXXFLAGS =	$(AM_CXXFLAGS)
 libarchive_a_CFLAGS =	$(AM_CFLAGS)
 libarchive_a_SOURCES =	ha_archive.cc azio.c
 

=== modified file 'storage/blackhole/Makefile.am'
--- a/storage/blackhole/Makefile.am	2008-01-02 13:00:46 +0000
+++ b/storage/blackhole/Makefile.am	2010-07-09 11:37:51 +0000
@@ -35,14 +35,14 @@ noinst_HEADERS =	ha_blackhole.h
 EXTRA_LTLIBRARIES =	ha_blackhole.la
 pkgplugin_LTLIBRARIES =	@plugin_blackhole_shared_target@
 ha_blackhole_la_LDFLAGS=-module -rpath $(pkgplugindir)
-ha_blackhole_la_CXXFLAGS=$(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+ha_blackhole_la_CXXFLAGS=$(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
 ha_blackhole_la_CFLAGS=	$(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
 ha_blackhole_la_SOURCES=ha_blackhole.cc
 
 
 EXTRA_LIBRARIES =	libblackhole.a
 noinst_LIBRARIES =	@plugin_blackhole_static_target@
-libblackhole_a_CXXFLAGS=$(AM_CFLAGS)
+libblackhole_a_CXXFLAGS=$(AM_CXXFLAGS)
 libblackhole_a_CFLAGS =	$(AM_CFLAGS)
 libblackhole_a_SOURCES=	ha_blackhole.cc
 

=== modified file 'storage/csv/Makefile.am'
--- a/storage/csv/Makefile.am	2007-01-04 18:54:52 +0000
+++ b/storage/csv/Makefile.am	2010-07-09 11:37:51 +0000
@@ -32,12 +32,12 @@ noinst_HEADERS	  =	ha_tina.h transparent
 EXTRA_LTLIBRARIES =	ha_csv.la
 pkglib_LTLIBRARIES =	@plugin_csv_shared_target@
 ha_csv_la_LDFLAGS =	-module -rpath $(MYSQLLIBdir)
-ha_csv_la_CXXFLAGS =	$(AM_CFLAGS) -DMYSQL_PLUGIN
+ha_csv_la_CXXFLAGS =	$(AM_CXXFLAGS) -DMYSQL_PLUGIN
 ha_csv_la_SOURCES =	transparent_file.cc ha_tina.cc 
 
 EXTRA_LIBRARIES =	libcsv.a
 noinst_LIBRARIES =	@plugin_csv_static_target@
-libcsv_a_CXXFLAGS =	$(AM_CFLAGS)
+libcsv_a_CXXFLAGS =	$(AM_CXXFLAGS)
 libcsv_a_SOURCES =	transparent_file.cc ha_tina.cc
 
 EXTRA_DIST =		CMakeLists.txt plug.in

=== modified file 'storage/example/Makefile.am'
--- a/storage/example/Makefile.am	2008-01-02 13:00:46 +0000
+++ b/storage/example/Makefile.am	2010-07-09 11:37:51 +0000
@@ -35,14 +35,14 @@ noinst_HEADERS =	ha_example.h
 EXTRA_LTLIBRARIES =	ha_example.la
 pkgplugin_LTLIBRARIES =	@plugin_example_shared_target@
 ha_example_la_LDFLAGS =	-module -rpath $(pkgplugindir)
-ha_example_la_CXXFLAGS=	$(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+ha_example_la_CXXFLAGS=	$(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
 ha_example_la_CFLAGS =	$(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
 ha_example_la_SOURCES =	ha_example.cc
 
 
 EXTRA_LIBRARIES =	libexample.a
 noinst_LIBRARIES =	@plugin_example_static_target@
-libexample_a_CXXFLAGS =	$(AM_CFLAGS)
+libexample_a_CXXFLAGS =	$(AM_CXXFLAGS)
 libexample_a_CFLAGS =	$(AM_CFLAGS)
 libexample_a_SOURCES=	ha_example.cc
 

=== modified file 'storage/federated/Makefile.am'
--- a/storage/federated/Makefile.am	2008-01-02 13:00:46 +0000
+++ b/storage/federated/Makefile.am	2010-07-09 11:37:51 +0000
@@ -35,14 +35,14 @@ noinst_HEADERS =	ha_federated.h
 EXTRA_LTLIBRARIES =	ha_federated.la
 pkgplugin_LTLIBRARIES =	@plugin_federated_shared_target@
 ha_federated_la_LDFLAGS =	-module -rpath $(pkgplugindir)
-ha_federated_la_CXXFLAGS=	$(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+ha_federated_la_CXXFLAGS=	$(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
 ha_federated_la_CFLAGS =	$(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
 ha_federated_la_SOURCES =	ha_federated.cc
 
 
 EXTRA_LIBRARIES =	libfederated.a
 noinst_LIBRARIES =	@plugin_federated_static_target@
-libfederated_a_CXXFLAGS =	$(AM_CFLAGS)
+libfederated_a_CXXFLAGS =	$(AM_CXXFLAGS)
 libfederated_a_CFLAGS =	$(AM_CFLAGS)
 libfederated_a_SOURCES=	ha_federated.cc
 

=== modified file 'storage/federated/ha_federated.cc'
--- a/storage/federated/ha_federated.cc	2010-03-14 16:01:45 +0000
+++ b/storage/federated/ha_federated.cc	2010-07-09 12:00:17 +0000
@@ -561,7 +561,6 @@ static int parse_url_error(FEDERATED_SHA
 int get_connection(MEM_ROOT *mem_root, FEDERATED_SHARE *share)
 {
   int error_num= ER_FOREIGN_SERVER_DOESNT_EXIST;
-  char error_buffer[FEDERATED_QUERY_BUFFER_SIZE];
   FOREIGN_SERVER *server, server_buffer;
   DBUG_ENTER("ha_federated::get_connection");
 
@@ -613,10 +612,8 @@ int get_connection(MEM_ROOT *mem_root, F
   DBUG_RETURN(0);
 
 error:
-  my_sprintf(error_buffer,
-             (error_buffer, "server name: '%s' doesn't exist!",
-              share->connection_string));
-  my_error(error_num, MYF(0), error_buffer);
+  my_printf_error(error_num, "server name: '%s' doesn't exist!",
+                  MYF(0), share->connection_string);
   DBUG_RETURN(error_num);
 }
 
@@ -2405,8 +2402,8 @@ int ha_federated::index_read_idx_with_re
 
   if (real_query(sql_query.ptr(), sql_query.length()))
   {
-    my_sprintf(error_buffer, (error_buffer, "error: %d '%s'",
-                              mysql_errno(mysql), mysql_error(mysql)));
+    sprintf(error_buffer, "error: %d '%s'",
+            mysql_errno(mysql), mysql_error(mysql));
     retval= ER_QUERY_ON_FOREIGN_DATA_SOURCE;
     goto error;
   }
@@ -2775,7 +2772,6 @@ int ha_federated::rnd_pos(uchar *buf, uc
 
 int ha_federated::info(uint flag)
 {
-  char error_buffer[FEDERATED_QUERY_BUFFER_SIZE];
   char status_buf[FEDERATED_QUERY_BUFFER_SIZE];
   int error;
   uint error_code;
@@ -2859,9 +2855,8 @@ error:
   mysql_free_result(result);
   if (mysql)
   {
-    my_sprintf(error_buffer, (error_buffer, ": %d : %s",
-                              mysql_errno(mysql), mysql_error(mysql)));
-    my_error(error_code, MYF(0), error_buffer);
+    my_printf_error(error_code, ": %d : %s", MYF(0),
+                    mysql_errno(mysql), mysql_error(mysql));
   }
   else
   if (remote_error_number != -1 /* error already reported */)

=== modified file 'storage/ibmdb2i/Makefile.am'
--- a/storage/ibmdb2i/Makefile.am	2009-04-01 20:18:49 +0000
+++ b/storage/ibmdb2i/Makefile.am	2010-07-09 11:37:51 +0000
@@ -34,7 +34,7 @@ EXTRA_LTLIBRARIES =	ha_ibmdb2i.la
 pkgplugin_LTLIBRARIES =	@plugin_ibmdb2i_shared_target@
 ha_ibmdb2i_la_LIBADD =  -liconv
 ha_ibmdb2i_la_LDFLAGS =	-module -rpath $(MYSQLLIBdir)
-ha_ibmdb2i_la_CXXFLAGS=	$(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+ha_ibmdb2i_la_CXXFLAGS=	$(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
 ha_ibmdb2i_la_CFLAGS =	$(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
 ha_ibmdb2i_la_SOURCES =	ha_ibmdb2i.cc db2i_ileBridge.cc db2i_conversion.cc \
 			db2i_blobCollection.cc db2i_file.cc db2i_charsetSupport.cc \
@@ -44,7 +44,7 @@ ha_ibmdb2i_la_SOURCES =	ha_ibmdb2i.cc db
 
 EXTRA_LIBRARIES =	libibmdb2i.a
 noinst_LIBRARIES =	@plugin_ibmdb2i_static_target@
-libibmdb2i_a_CXXFLAGS =	$(AM_CFLAGS)
+libibmdb2i_a_CXXFLAGS =	$(AM_CXXFLAGS)
 libibmdb2i_a_CFLAGS =	$(AM_CFLAGS)
 libibmdb2i_a_SOURCES=	$(ha_ibmdb2i_la_SOURCES)
 

=== modified file 'storage/innobase/Makefile.am'
--- a/storage/innobase/Makefile.am	2010-03-30 16:03:46 +0000
+++ b/storage/innobase/Makefile.am	2010-07-09 11:37:51 +0000
@@ -156,14 +156,14 @@ libinnobase_a_SOURCES=	btr/btr0btr.c btr
 			ut/ut0ut.c ut/ut0vec.c ut/ut0wqueue.c		\
 			handler/ha_innodb.cc
 
-libinnobase_a_CXXFLAGS=	$(AM_CFLAGS)
+libinnobase_a_CXXFLAGS=	$(AM_CXXFLAGS)
 libinnobase_a_CFLAGS=	$(AM_CFLAGS)
 
 EXTRA_LTLIBRARIES=	ha_innodb.la
 pkgplugin_LTLIBRARIES=	@plugin_innobase_shared_target@
 
 ha_innodb_la_LDFLAGS=	-module -rpath $(pkgplugindir)
-ha_innodb_la_CXXFLAGS=	$(AM_CFLAGS) $(INNODB_DYNAMIC_CFLAGS)
+ha_innodb_la_CXXFLAGS=	$(AM_CXXFLAGS) $(INNODB_DYNAMIC_CFLAGS)
 ha_innodb_la_CFLAGS=	$(AM_CFLAGS) $(INNODB_DYNAMIC_CFLAGS)
 ha_innodb_la_SOURCES=	$(libinnobase_a_SOURCES)
 

=== modified file 'storage/innodb_plugin/Makefile.am'
--- a/storage/innodb_plugin/Makefile.am	2010-04-07 17:24:43 +0000
+++ b/storage/innodb_plugin/Makefile.am	2010-07-09 11:37:51 +0000
@@ -325,14 +325,14 @@ libinnobase_a_SOURCES=	\
 			ut/ut0vec.c			\
 			ut/ut0wqueue.c
 
-libinnobase_a_CXXFLAGS=	$(AM_CFLAGS)
+libinnobase_a_CXXFLAGS=	$(AM_CXXFLAGS)
 libinnobase_a_CFLAGS=	$(AM_CFLAGS)
 
 EXTRA_LTLIBRARIES=	ha_innodb_plugin.la
 pkgplugin_LTLIBRARIES=	@plugin_innodb_plugin_shared_target@
 
 ha_innodb_plugin_la_LDFLAGS=	-module -rpath $(pkgplugindir)
-ha_innodb_plugin_la_CXXFLAGS=	$(AM_CFLAGS) $(INNODB_DYNAMIC_CFLAGS)
+ha_innodb_plugin_la_CXXFLAGS=	$(AM_CXXFLAGS) $(INNODB_DYNAMIC_CFLAGS)
 ha_innodb_plugin_la_CFLAGS=	$(AM_CFLAGS) $(INNODB_DYNAMIC_CFLAGS)
 ha_innodb_plugin_la_SOURCES=	$(libinnobase_a_SOURCES)
 

=== modified file 'strings/decimal.c'
--- a/strings/decimal.c	2010-06-10 20:16:43 +0000
+++ b/strings/decimal.c	2010-07-09 12:00:17 +0000
@@ -994,7 +994,7 @@ int double2decimal(double from, decimal_
   char buff[400], *end;
   int length, res;
   DBUG_ENTER("double2decimal");
-  length= my_sprintf(buff, (buff, "%.16G", from));
+  length= sprintf(buff, "%.16G", from);
   DBUG_PRINT("info",("from: %g  from_as_str: %s", from, buff));
   end= buff+length;
   res= string2decimal(buff, to, &end);

=== modified file 'tests/mysql_client_test.c'
--- a/tests/mysql_client_test.c	2010-07-02 18:30:47 +0000
+++ b/tests/mysql_client_test.c	2010-07-09 12:00:17 +0000
@@ -1685,7 +1685,7 @@ static void test_prepare()
   /* now, execute the prepared statement to insert 10 records.. */
   for (tiny_data= 0; tiny_data < 100; tiny_data++)
   {
-    length[1]= my_sprintf(str_data, (str_data, "MySQL%d", int_data));
+    length[1]= sprintf(str_data, "MySQL%d", int_data);
     rc= mysql_stmt_execute(stmt);
     check_execute(stmt, rc);
     int_data += 25;
@@ -1724,7 +1724,7 @@ static void test_prepare()
   /* now, execute the prepared statement to insert 10 records.. */
   for (o_tiny_data= 0; o_tiny_data < 100; o_tiny_data++)
   {
-    len= my_sprintf(data, (data, "MySQL%d", o_int_data));
+    len= sprintf(data, "MySQL%d", o_int_data);
 
     rc= mysql_stmt_fetch(stmt);
     check_execute(stmt, rc);
@@ -3090,7 +3090,7 @@ static void test_simple_update()
   my_bind[0].buffer= szData;                /* string data */
   my_bind[0].buffer_length= sizeof(szData);
   my_bind[0].length= &length[0];
-  length[0]= my_sprintf(szData, (szData, "updated-data"));
+  length[0]= sprintf(szData, "updated-data");
 
   my_bind[1].buffer= (void *) &nData;
   my_bind[1].buffer_type= MYSQL_TYPE_LONG;
@@ -3286,7 +3286,7 @@ static void test_long_data_str()
   DIE_UNLESS(rc == 1);
   mysql_free_result(result);
 
-  my_sprintf(data, (data, "%d", i*5));
+  sprintf(data, "%d", i*5);
   verify_col_data("test_long_data_str", "LENGTH(longstr)", data);
   data[0]= '\0';
   while (i--)
@@ -3344,7 +3344,7 @@ static void test_long_data_str1()
 
   rc= mysql_stmt_bind_param(stmt, my_bind);
   check_execute(stmt, rc);
-  length= my_sprintf(data, (data, "MySQL AB"));
+  length= sprintf(data, "MySQL AB");
 
   /* supply data in pieces */
   for (i= 0; i < 3; i++)
@@ -3384,10 +3384,10 @@ static void test_long_data_str1()
   DIE_UNLESS(rc == 1);
   mysql_free_result(result);
 
-  my_sprintf(data, (data, "%ld", (long)i*length));
+  sprintf(data, "%ld", (long)i*length);
   verify_col_data("test_long_data_str", "length(longstr)", data);
 
-  my_sprintf(data, (data, "%d", i*2));
+  sprintf(data, "%d", i*2);
   verify_col_data("test_long_data_str", "length(blb)", data);
 
   /* Test length of field->max_length */
@@ -3659,7 +3659,7 @@ static void test_update()
   my_bind[0].buffer= szData;
   my_bind[0].buffer_length= sizeof(szData);
   my_bind[0].length= &length[0];
-  length[0]= my_sprintf(szData, (szData, "inserted-data"));
+  length[0]= sprintf(szData, "inserted-data");
 
   my_bind[1].buffer= (void *)&nData;
   my_bind[1].buffer_type= MYSQL_TYPE_LONG;
@@ -3688,7 +3688,7 @@ static void test_update()
   my_bind[0].buffer= szData;
   my_bind[0].buffer_length= sizeof(szData);
   my_bind[0].length= &length[0];
-  length[0]= my_sprintf(szData, (szData, "updated-data"));
+  length[0]= sprintf(szData, "updated-data");
 
   my_bind[1].buffer= (void *)&nData;
   my_bind[1].buffer_type= MYSQL_TYPE_LONG;
@@ -4257,7 +4257,7 @@ static void bind_fetch(int row_count)
     /* CHAR */
     {
       char buff[20];
-      long len= my_sprintf(buff, (buff, "%d", rc));
+      long len= sprintf(buff, "%d", rc);
       DIE_UNLESS(strcmp(s_data, buff) == 0);
       DIE_UNLESS(length[6] == (ulong) len);
     }
@@ -4850,7 +4850,7 @@ static void test_insert()
   /* now, execute the prepared statement to insert 10 records.. */
   for (tiny_data= 0; tiny_data < 3; tiny_data++)
   {
-    length= my_sprintf(str_data, (str_data, "MySQL%d", tiny_data));
+    length= sprintf(str_data, "MySQL%d", tiny_data);
     rc= mysql_stmt_execute(stmt);
     check_execute(stmt, rc);
   }
@@ -17512,7 +17512,7 @@ static void test_wl4166_1()
   /* now, execute the prepared statement to insert 10 records.. */
   for (tiny_data= 0; tiny_data < 10; tiny_data++)
   {
-    length[1]= my_sprintf(str_data, (str_data, "MySQL%d", int_data));
+    length[1]= sprintf(str_data, "MySQL%d", int_data);
     rc= mysql_stmt_execute(stmt);
     check_execute(stmt, rc);
     int_data += 25;
@@ -17535,7 +17535,7 @@ static void test_wl4166_1()
 
   for (tiny_data= 50; tiny_data < 60; tiny_data++)
   {
-    length[1]= my_sprintf(str_data, (str_data, "MySQL%d", int_data));
+    length[1]= sprintf(str_data, "MySQL%d", int_data);
     rc= mysql_stmt_execute(stmt);
     check_execute(stmt, rc);
     int_data += 25;


Attachment: [text/bzr-bundle] bzr/davi.arnaut@sun.com-20100709120017-q3g9zrsud5gurjf9.bundle
Thread
bzr push into mysql-5.1-bugteam branch (davi:3470 to 3472) Bug#45288Davi Arnaut9 Jul