List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:July 12 2010 8:57pm
Subject:bzr commit into mysql-5.1-bugteam branch (davi:3478) Bug#45288
View as plain text  
# At a local mysql-5.1-bugteam repository of davi

 3478 Davi Arnaut	2010-07-12
      Bug#45288: pb2 returns a lot of compilation warnings on linux
      
      Fix warnings flagged by the new warning option -Wunused-but-set-variable
      that was added to GCC 4.6 and that is enabled by -Wunused and -Wall. The
      option causes a warning whenever a local variable is assigned to but is
      later unused. It also warns about meaningless pointer dereferences.
     @ client/mysql.cc
        Meaningless pointer dereferences.
     @ client/mysql_upgrade.c
        Check whether reading from the file succeeded.
     @ client/mysqltest.cc
        Provided a error if connect option is not available.
     @ extra/comp_err.c
        Unused.
     @ extra/yassl/src/yassl_imp.cpp
        Skip instead of reading data that is discarded.
     @ include/my_pthread.h
        Variable is only used in debug builds.
     @ include/mysys_err.h
        Add new error messages.
     @ mysys/errors.c
        Add new error message for permission related functions.
     @ mysys/mf_iocache.c
        Variable is only checked under THREAD.
     @ mysys/my_copy.c
        Raise a error if chmod or chown fails.
     @ mysys/my_redel.c
        Raise a error if chmod or chown fails.
     @ regex/engine.c
        Use a equivalent variable for the assert.
     @ server-tools/instance-manager/instance_options.cc
        Unused.
     @ sql/field.cc
        Unused.
     @ sql/item.cc
        Unused.
     @ sql/log.cc
        Do not ignore the return value of freopen: only set buffer if
        reopening succeeds.
        
        Adjust doxygen comment to the right function.
        
        Pass message lenght to log function.
     @ sql/mysqld.cc
        Do not ignore the return value of freopen: only set buffer if
        reopening succeeds.
     @ sql/partition_info.cc
        Unused.
     @ sql/slave.cc
        No need to set pointer to the address of '\0'.
     @ sql/spatial.cc
        Unused. Left for historical purposes.
     @ sql/sql_acl.cc
        Unused.
     @ sql/sql_base.cc
        Pointers are always set to the same variables.
     @ sql/sql_parse.cc
        End statement if reading fails.
     @ sql/sql_repl.cc
        No need to set pointer to the address of '\0'.
     @ sql/sql_show.cc
        Put variable under the same ifdef block.
     @ sql/udf_example.c
        Set null pointer flag appropriately.
     @ storage/csv/ha_tina.cc
        Meaningless dereferences.
     @ storage/example/ha_example.cc
        Return the error since it's available.
     @ storage/myisam/mi_locking.c
        Remove unused and dead code.

    modified:
      client/mysql.cc
      client/mysql_upgrade.c
      client/mysqltest.cc
      extra/comp_err.c
      extra/yassl/src/yassl_imp.cpp
      include/my_pthread.h
      include/mysys_err.h
      mysys/errors.c
      mysys/mf_iocache.c
      mysys/my_copy.c
      mysys/my_redel.c
      regex/engine.c
      server-tools/instance-manager/instance_options.cc
      sql/field.cc
      sql/item.cc
      sql/log.cc
      sql/mysqld.cc
      sql/partition_info.cc
      sql/slave.cc
      sql/spatial.cc
      sql/sql_acl.cc
      sql/sql_base.cc
      sql/sql_load.cc
      sql/sql_parse.cc
      sql/sql_repl.cc
      sql/sql_show.cc
      sql/sql_table.cc
      sql/table.cc
      sql/udf_example.c
      storage/csv/ha_tina.cc
      storage/example/ha_example.cc
      storage/myisam/mi_locking.c
      storage/myisam/rt_split.c
      storage/myisammrg/myrg_open.c
      strings/decimal.c
=== modified file 'client/mysql.cc'
--- a/client/mysql.cc	2010-07-02 18:30:47 +0000
+++ b/client/mysql.cc	2010-07-12 20:57:14 +0000
@@ -3639,7 +3639,7 @@ xmlencode_print(const char *src, uint le
     tee_fputs("NULL", PAGER);
   else
   {
-    for (const char *p = src; length; *p++, length--)
+    for (const char *p = src; length; p++, length--)
     {
       const char *t;
       if ((t = array_value(xmlmeta, *p)))
@@ -4726,7 +4726,7 @@ static const char* construct_prompt()
   struct tm *t = localtime(&lclock);
 
   /* parse thru the settings for the prompt */
-  for (char *c = current_prompt; *c ; *c++)
+  for (char *c = current_prompt; *c ; c++)
   {
     if (*c != PROMPT_CHAR)
 	processed_prompt.append(*c);

=== modified file 'client/mysql_upgrade.c'
--- a/client/mysql_upgrade.c	2010-06-10 20:16:43 +0000
+++ b/client/mysql_upgrade.c	2010-07-12 20:57:14 +0000
@@ -595,7 +595,10 @@ static int upgrade_already_done(void)
 
   my_fclose(in, MYF(0));
 
-  return (strncmp(buf, MYSQL_SERVER_VERSION,
+  if (!res)
+    return 0; /* Could not read from file => not sure */
+
+  return (strncmp(res, MYSQL_SERVER_VERSION,
                   sizeof(MYSQL_SERVER_VERSION)-1)==0);
 }
 

=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2010-07-02 18:30:47 +0000
+++ b/client/mysqltest.cc	2010-07-12 20:57:14 +0000
@@ -5156,6 +5156,9 @@ void do_connect(struct st_command *comma
                   &opt_ssl_verify_server_cert);
 #endif
   }
+#else
+  if (con_ssl)
+    die("SSL connection is not supported on this build.");
 #endif
 
 #ifdef __WIN__
@@ -5164,6 +5167,9 @@ void do_connect(struct st_command *comma
     uint protocol= MYSQL_PROTOCOL_PIPE;
     mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, &protocol);
   }
+#else
+  if (con_pipe)
+    die("Named pipe connection is not supported on this platform.");
 #endif
 
 #ifdef HAVE_SMEM
@@ -5180,9 +5186,11 @@ void do_connect(struct st_command *comma
     mysql_options(&con_slot->mysql, MYSQL_SHARED_MEMORY_BASE_NAME,
       shared_memory_base_name);
   }
+#else
+  if (con_shm)
+    die("Shared memory connection is not supported on this build.");
 #endif
 
-
   /* Use default db name */
   if (ds_database.length == 0)
     dynstr_set(&ds_database, opt_db);

=== modified file 'extra/comp_err.c'
--- a/extra/comp_err.c	2010-07-02 18:30:47 +0000
+++ b/extra/comp_err.c	2010-07-12 20:57:14 +0000
@@ -831,7 +831,6 @@ static struct message *parse_message_str
 static struct errors *parse_error_string(char *str, int er_count)
 {
   struct errors *new_error;
-  char *start;
   DBUG_ENTER("parse_error_string");
   DBUG_PRINT("enter", ("str: %s", str));
 
@@ -842,7 +841,6 @@ static struct errors *parse_error_string
     DBUG_RETURN(0);				/* OOM: Fatal error */
 
   /* getting the error name */
-  start= str;
   str= skip_delimiters(str);
 
   if (!(new_error->er_name= get_word(&str)))

=== modified file 'extra/yassl/src/yassl_imp.cpp'
--- a/extra/yassl/src/yassl_imp.cpp	2009-06-29 14:00:47 +0000
+++ b/extra/yassl/src/yassl_imp.cpp	2010-07-12 20:57:14 +0000
@@ -884,21 +884,19 @@ void Alert::Process(input_buffer& input,
         else
             hmac(ssl, verify, data, aSz, alert, true);
 
-        // read mac and fill
+        // read mac and skip fill
         int    digestSz = ssl.getCrypto().get_digest().get_digestSize();
         opaque mac[SHA_LEN];
         input.read(mac, digestSz);
 
         if (ssl.getSecurity().get_parms().cipher_type_ == block) {
             int    ivExtra = 0;
-        opaque fill;
 
             if (ssl.isTLSv1_1())
                 ivExtra = ssl.getCrypto().get_cipher().get_blockSize();
             int padSz = ssl.getSecurity().get_parms().encrypt_size_ - ivExtra -
                         aSz - digestSz;
-        for (int i = 0; i < padSz; i++) 
-            fill = input[AUTO];
+            input.set_current(input.get_current() + padSz);
         }
 
         // verify
@@ -1020,14 +1018,10 @@ void Data::Process(input_buffer& input,
             hmac(ssl, verify, rawData, dataSz, application_data, true);
     }
 
-    // read mac and fill
+    // read mac and skip fill
     opaque mac[SHA_LEN];
-    opaque fill;
     input.read(mac, digestSz);
-    for (int i = 0; i < pad; i++) 
-        fill = input[AUTO];
-    if (padByte)
-        fill = input[AUTO];    
+    input.set_current(input.get_current() + pad + padByte);
 
     // verify
     if (dataSz) {
@@ -2073,11 +2067,9 @@ void Finished::Process(input_buffer& inp
         if (ssl.isTLSv1_1())
             ivExtra = ssl.getCrypto().get_cipher().get_blockSize();
 
-    opaque fill;
     int    padSz = ssl.getSecurity().get_parms().encrypt_size_ - ivExtra -
                      HANDSHAKE_HEADER - finishedSz - digestSz;
-    for (int i = 0; i < padSz; i++) 
-        fill = input[AUTO];
+    input.set_current(input.get_current() + padSz);
 
     // verify mac
     if (memcmp(mac, verifyMAC, digestSz)) {

=== modified file 'include/my_pthread.h'
--- a/include/my_pthread.h	2010-07-05 12:00:39 +0000
+++ b/include/my_pthread.h	2010-07-12 20:57:14 +0000
@@ -269,13 +269,14 @@ int sigwait(sigset_t *setp, int *sigp);
   we want to make sure that no such flags are set.
 */
 #if defined(HAVE_SIGACTION) && !defined(my_sigset)
-#define my_sigset(A,B) do { struct sigaction l_s; sigset_t l_set; int l_rc; \
+#define my_sigset(A,B) do { struct sigaction l_s; sigset_t l_set;           \
+                            IF_DBUG(int l_rc);                              \
                             DBUG_ASSERT((A) != 0);                          \
                             sigemptyset(&l_set);                            \
                             l_s.sa_handler = (B);                           \
                             l_s.sa_mask   = l_set;                          \
                             l_s.sa_flags   = 0;                             \
-                            l_rc= sigaction((A), &l_s, (struct sigaction *) NULL);\
+                            IF_DBUG(l_rc=) sigaction((A), &l_s, NULL);      \
                             DBUG_ASSERT(l_rc == 0);                         \
                           } while (0)
 #elif defined(HAVE_SIGSET) && !defined(my_sigset)

=== modified file 'include/mysys_err.h'
--- a/include/mysys_err.h	2007-03-02 16:43:45 +0000
+++ b/include/mysys_err.h	2010-07-12 20:57:14 +0000
@@ -62,7 +62,9 @@ extern const char * NEAR globerrs[];	/*
 #define EE_UNKNOWN_COLLATION	28
 #define EE_FILENOTFOUND		29
 #define EE_FILE_NOT_CLOSED	30
-#define EE_ERROR_LAST           30 /* Copy last error nr */
+#define EE_CHANGE_OWNERSHIP     31
+#define EE_CHANGE_PERMISSIONS   32
+#define EE_ERROR_LAST           32 /* Copy last error nr */
 /* Add error numbers before EE_ERROR_LAST and change it accordingly. */
 
   /* exit codes for all MySQL programs */

=== modified file 'mysys/errors.c'
--- a/mysys/errors.c	2009-03-06 09:38:14 +0000
+++ b/mysys/errors.c	2010-07-12 20:57:14 +0000
@@ -49,7 +49,9 @@ const char * NEAR globerrs[GLOBERRS]=
   "Can't sync file '%s' to disk (Errcode: %d)",
   "Collation '%s' is not a compiled collation and is not specified in the '%s' file",
   "File '%s' not found (Errcode: %d)",
-  "File '%s' (fileno: %d) was not closed"
+  "File '%s' (fileno: %d) was not closed",
+  "Can't change ownership of the file '%s' (Errcode: %d)",
+  "Can't change permissions of the file '%s' (Errcode: %d)",
 };
 
 void init_glob_errs(void)
@@ -90,6 +92,8 @@ void init_glob_errs()
   EE(EE_UNKNOWN_COLLATION)= "Collation '%s' is not a compiled collation and is not specified in the %s file";
   EE(EE_FILENOTFOUND)	= "File '%s' not found (Errcode: %d)";
   EE(EE_FILE_NOT_CLOSED) = "File '%s' (fileno: %d) was not closed";
+  EE(EE_CHANGE_OWNERSHIP)   = "Can't change ownership of the file '%s' (Errcode: %d)";
+  EE(EE_CHANGE_PERMISSIONS) = "Can't change permissions of the file '%s' (Errcode: %d)";
 }
 #endif
 

=== modified file 'mysys/mf_iocache.c'
--- a/mysys/mf_iocache.c	2009-09-02 12:12:18 +0000
+++ b/mysys/mf_iocache.c	2010-07-12 20:57:14 +0000
@@ -1701,16 +1701,19 @@ int my_block_write(register IO_CACHE *in
 #endif
 
 
-int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock)
+int my_b_flush_io_cache(IO_CACHE *info,
+                        int need_append_buffer_lock __attribute__((unused)))
 {
   size_t length;
-  my_bool append_cache;
   my_off_t pos_in_file;
+  my_bool append_cache= (info->type == SEQ_READ_APPEND);
   DBUG_ENTER("my_b_flush_io_cache");
   DBUG_PRINT("enter", ("cache: 0x%lx", (long) info));
 
-  if (!(append_cache = (info->type == SEQ_READ_APPEND)))
-    need_append_buffer_lock=0;
+#ifdef THREAD
+  if (!append_cache)
+    need_append_buffer_lock= 0;
+#endif
 
   if (info->type == WRITE_CACHE || append_cache)
   {

=== modified file 'mysys/my_copy.c'
--- a/mysys/my_copy.c	2009-09-03 12:29:25 +0000
+++ b/mysys/my_copy.c	2010-07-12 20:57:14 +0000
@@ -16,6 +16,7 @@
 #include "mysys_priv.h"
 #include <my_dir.h> /* for stat */
 #include <m_string.h>
+#include "mysys_err.h"
 #if defined(HAVE_UTIME_H)
 #include <utime.h>
 #elif defined(HAVE_SYS_UTIME_H)
@@ -56,7 +57,6 @@ int my_copy(const char *from, const char
   File from_file,to_file;
   uchar buff[IO_SIZE];
   MY_STAT stat_buff,new_stat_buff;
-  int res;
   DBUG_ENTER("my_copy");
   DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags));
 
@@ -102,9 +102,23 @@ int my_copy(const char *from, const char
 
     if (MyFlags & MY_HOLD_ORIGINAL_MODES && !new_file_stat)
 	DBUG_RETURN(0);			/* File copyed but not stat */
-    res= chmod(to, stat_buff.st_mode & 07777); /* Copy modes */
+    /* Copy modes */
+    if (chmod(to, stat_buff.st_mode & 07777))
+    {
+      my_errno= errno;
+      if (MyFlags & (MY_FAE+MY_WME))
+        my_error(EE_CHANGE_PERMISSIONS, MYF(ME_BELL+ME_WAITTANG), from, errno);
+      goto err;
+    }
 #if !defined(__WIN__) && !defined(__NETWARE__)
-    res= chown(to, stat_buff.st_uid,stat_buff.st_gid); /* Copy ownership */
+    /* Copy ownership */
+    if (chown(to, stat_buff.st_uid,stat_buff.st_gid))
+    {
+      my_errno= errno;
+      if (MyFlags & (MY_FAE+MY_WME))
+        my_error(EE_CHANGE_OWNERSHIP, MYF(ME_BELL+ME_WAITTANG), from, errno);
+      goto err;
+    }
 #endif
 #if !defined(VMS) && !defined(__ZTC__)
     if (MyFlags & MY_COPYTIME)

=== modified file 'mysys/my_redel.c'
--- a/mysys/my_redel.c	2009-09-02 15:45:33 +0000
+++ b/mysys/my_redel.c	2010-07-12 20:57:14 +0000
@@ -76,11 +76,8 @@ end:
 int my_copystat(const char *from, const char *to, int MyFlags)
 {
   struct stat statbuf;
-#if !defined(__WIN__) && !defined(__NETWARE__)
-  int res;
-#endif
 
-  if (stat((char*) from, &statbuf))
+  if (stat(from, &statbuf))
   {
     my_errno=errno;
     if (MyFlags & (MY_FAE+MY_WME))
@@ -89,7 +86,15 @@ int my_copystat(const char *from, const
   }
   if ((statbuf.st_mode & S_IFMT) != S_IFREG)
     return 1;
-  VOID(chmod(to, statbuf.st_mode & 07777));		/* Copy modes */
+
+  /* Copy modes */
+  if (chmod(to, statbuf.st_mode & 07777))
+  {
+    my_errno= errno;
+    if (MyFlags & (MY_FAE+MY_WME))
+      my_error(EE_CHANGE_PERMISSIONS, MYF(ME_BELL+ME_WAITTANG), from, errno);
+    return -1;
+  }
 
 #if !defined(__WIN__) && !defined(__NETWARE__)
   if (statbuf.st_nlink > 1 && MyFlags & MY_LINK_WARNING)
@@ -97,7 +102,14 @@ int my_copystat(const char *from, const
     if (MyFlags & MY_LINK_WARNING)
       my_error(EE_LINK_WARNING,MYF(ME_BELL+ME_WAITTANG),from,statbuf.st_nlink);
   }
-  res= chown(to, statbuf.st_uid, statbuf.st_gid);	/* Copy ownership */
+  /* Copy ownership */
+  if (chown(to, statbuf.st_uid, statbuf.st_gid))
+  {
+    my_errno= errno;
+    if (MyFlags & (MY_FAE+MY_WME))
+      my_error(EE_CHANGE_OWNERSHIP, MYF(ME_BELL+ME_WAITTANG), from, errno);
+    return -1;
+  }
 #endif /* !__WIN__ && !__NETWARE__ */
 
 #ifndef VMS

=== modified file 'regex/engine.c'
--- a/regex/engine.c	2005-09-29 01:20:31 +0000
+++ b/regex/engine.c	2010-07-12 20:57:14 +0000
@@ -256,7 +256,6 @@ sopno stopst;
 	register char *ssp;	/* start of string matched by subsubRE */
 	register char *sep;	/* end of string matched by subsubRE */
 	register char *oldssp;	/* previous ssp */
-	register char *dp;      /* used in debug mode to check asserts */
 
 	AT("diss", start, stop, startst, stopst);
 	sp = start;
@@ -314,11 +313,9 @@ sopno stopst;
 			ssub = ss + 1;
 			esub = es - 1;
 			/* did innards match? */
-			if (slow(charset, m, sp, rest, ssub, esub) != NULL) {
-				dp = dissect(charset, m, sp, rest, ssub, esub);
-				assert(dp == rest);
-			} else		/* no */
-				assert(sp == rest);
+			if (slow(charset, m, sp, rest, ssub, esub) != NULL)
+				sp = dissect(charset, m, sp, rest, ssub, esub);
+			assert(sp == rest);
 			sp = rest;
 			break;
 		case OPLUS_:
@@ -353,8 +350,8 @@ sopno stopst;
 			}
 			assert(sep == rest);	/* must exhaust substring */
 			assert(slow(charset, m, ssp, sep, ssub, esub) == rest);
-			dp = dissect(charset, m, ssp, sep, ssub, esub);
-			assert(dp == sep);
+			sp = dissect(charset, m, ssp, sep, ssub, esub);
+			assert(sp == sep);
 			sp = rest;
 			break;
 		case OCH_:
@@ -388,8 +385,8 @@ sopno stopst;
 				else
 					assert(OP(m->g->strip[esub]) == O_CH);
 			}
-			dp = dissect(charset, m, sp, rest, ssub, esub);
-			assert(dp == rest);
+			sp = dissect(charset, m, sp, rest, ssub, esub);
+			assert(sp == rest);
 			sp = rest;
 			break;
 		case O_PLUS:

=== modified file 'server-tools/instance-manager/instance_options.cc'
--- a/server-tools/instance-manager/instance_options.cc	2009-04-29 02:59:10 +0000
+++ b/server-tools/instance-manager/instance_options.cc	2010-07-12 20:57:14 +0000
@@ -303,7 +303,6 @@ bool Instance_options::fill_log_options(
   enum { MAX_LOG_OPTION_LENGTH= 256 };
   char datadir[MAX_LOG_OPTION_LENGTH];
   char hostname[MAX_LOG_OPTION_LENGTH];
-  uint hostname_length;
   struct log_files_st
   {
     const char *name;
@@ -335,8 +334,6 @@ bool Instance_options::fill_log_options(
     strmov(hostname, "mysql");
 
   hostname[MAX_LOG_OPTION_LENGTH - 1]= 0; /* Safety */
-  hostname_length= strlen(hostname);
-
 
   for (log_files= logs_st; log_files->name; log_files++)
   {

=== modified file 'sql/field.cc'
--- a/sql/field.cc	2010-07-09 12:00:17 +0000
+++ b/sql/field.cc	2010-07-12 20:57:14 +0000
@@ -5541,7 +5541,6 @@ int Field_date::store(const char *from,
 int Field_date::store(double nr)
 {
   longlong tmp;
-  int error= 0;
   if (nr >= 19000000000000.0 && nr <= 99991231235959.0)
     nr=floor(nr/1000000.0);			// Timestamp to date
   if (nr < 0.0 || nr > 99991231.0)
@@ -5550,7 +5549,6 @@ int Field_date::store(double nr)
     set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
                          ER_WARN_DATA_OUT_OF_RANGE,
                          nr, MYSQL_TIMESTAMP_DATE);
-    error= 1;
   }
   else
     tmp= (longlong) rint(nr);

=== modified file 'sql/item.cc'
--- a/sql/item.cc	2010-07-02 18:30:47 +0000
+++ b/sql/item.cc	2010-07-12 20:57:14 +0000
@@ -255,11 +255,10 @@ my_decimal *Item::val_decimal_from_int(m
 my_decimal *Item::val_decimal_from_string(my_decimal *decimal_value)
 {
   String *res;
-  char *end_ptr;
+
   if (!(res= val_str(&str_value)))
-    return 0;                                   // NULL or EOM
+    return NULL;
 
-  end_ptr= (char*) res->ptr()+ res->length();
   if (str2my_decimal(E_DEC_FATAL_ERROR & ~E_DEC_BAD_NUM,
                      res->ptr(), res->length(), res->charset(),
                      decimal_value) & E_DEC_BAD_NUM)

=== modified file 'sql/log.cc'
--- a/sql/log.cc	2010-07-02 18:30:47 +0000
+++ b/sql/log.cc	2010-07-12 20:57:14 +0000
@@ -5050,6 +5050,22 @@ void sql_perror(const char *message)
 }
 
 
+/*
+  Unfortunately, there seems to be no good way
+  to restore the original streams upon failure.
+*/
+static bool redirect_std_streams(const char *file)
+{
+  if (freopen(file, "a+", stdout) && freopen(file, "a+", stderr))
+  {
+    setbuf(stderr, NULL);
+    return FALSE;
+  }
+
+  return TRUE;
+}
+
+
 bool flush_error_log()
 {
   bool result=0;
@@ -5077,11 +5093,7 @@ bool flush_error_log()
       setbuf(stderr, NULL);
       (void) my_delete(err_renamed, MYF(0));
       my_rename(log_error_file,err_renamed,MYF(0));
-      if (freopen(log_error_file,"a+",stdout))
-      {
-        freopen(log_error_file,"a+",stderr);
-        setbuf(stderr, NULL);
-      }
+      redirect_std_streams(log_error_file);
 
       if ((fd = my_open(err_temp, O_RDONLY, MYF(0))) >= 0)
       {
@@ -5096,13 +5108,7 @@ bool flush_error_log()
      result= 1;
 #else
    my_rename(log_error_file,err_renamed,MYF(0));
-   if (freopen(log_error_file,"a+",stdout))
-   {
-     FILE *reopen;
-     reopen= freopen(log_error_file,"a+",stderr);
-     setbuf(stderr, NULL);
-   }
-   else
+   if (redirect_std_streams(log_error_file))
      result= 1;
 #endif
     VOID(pthread_mutex_unlock(&LOCK_error_log));
@@ -5153,25 +5159,9 @@ static void print_buffer_to_nt_eventlog(
 #endif /* __NT__ */
 
 
-/**
-  Prints a printf style message to the error log and, under NT, to the
-  Windows event log.
-
-  This function prints the message into a buffer and then sends that buffer
-  to other functions to write that message to other logging sources.
-
-  @param event_type          Type of event to write (Error, Warning, or Info)
-  @param format              Printf style format of message
-  @param args                va_list list of arguments for the message
-
-  @returns
-    The function always returns 0. The return value is present in the
-    signature to be compatible with other logging routines, which could
-    return an error (e.g. logging to the log tables)
-*/
-
 #ifndef EMBEDDED_LIBRARY
-static void print_buffer_to_file(enum loglevel level, const char *buffer)
+static void print_buffer_to_file(enum loglevel level, const char *buffer,
+                                 size_t length)
 {
   time_t skr;
   struct tm tm_tmp;
@@ -5185,7 +5175,7 @@ static void print_buffer_to_file(enum lo
   localtime_r(&skr, &tm_tmp);
   start=&tm_tmp;
 
-  fprintf(stderr, "%02d%02d%02d %2d:%02d:%02d [%s] %s\n",
+  fprintf(stderr, "%02d%02d%02d %2d:%02d:%02d [%s] %.*s\n",
           start->tm_year % 100,
           start->tm_mon+1,
           start->tm_mday,
@@ -5194,7 +5184,7 @@ static void print_buffer_to_file(enum lo
           start->tm_sec,
           (level == ERROR_LEVEL ? "ERROR" : level == WARNING_LEVEL ?
            "Warning" : "Note"),
-          buffer);
+          (int) length, buffer);
 
   fflush(stderr);
 
@@ -5202,7 +5192,22 @@ static void print_buffer_to_file(enum lo
   DBUG_VOID_RETURN;
 }
 
+/**
+  Prints a printf style message to the error log and, under NT, to the
+  Windows event log.
 
+  This function prints the message into a buffer and then sends that buffer
+  to other functions to write that message to other logging sources.
+
+  @param event_type          Type of event to write (Error, Warning, or Info)
+  @param format              Printf style format of message
+  @param args                va_list list of arguments for the message
+
+  @returns
+    The function always returns 0. The return value is present in the
+    signature to be compatible with other logging routines, which could
+    return an error (e.g. logging to the log tables)
+*/
 int vprint_msg_to_log(enum loglevel level, const char *format, va_list args)
 {
   char   buff[1024];
@@ -5210,7 +5215,7 @@ int vprint_msg_to_log(enum loglevel leve
   DBUG_ENTER("vprint_msg_to_log");
 
   length= my_vsnprintf(buff, sizeof(buff), format, args);
-  print_buffer_to_file(level, buff);
+  print_buffer_to_file(level, buff, length);
 
 #ifdef __NT__
   print_buffer_to_nt_eventlog(level, buff, length, sizeof(buff));
@@ -5218,7 +5223,7 @@ int vprint_msg_to_log(enum loglevel leve
 
   DBUG_RETURN(0);
 }
-#endif /*EMBEDDED_LIBRARY*/
+#endif /* EMBEDDED_LIBRARY */
 
 
 void sql_print_error(const char *format, ...) 

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2010-07-02 18:30:47 +0000
+++ b/sql/mysqld.cc	2010-07-12 20:57:14 +0000
@@ -3783,7 +3783,6 @@ static void end_ssl()
 
 static int init_server_components()
 {
-  FILE* reopen;
   DBUG_ENTER("init_server_components");
   /*
     We need to call each of these following functions to ensure that
@@ -3826,8 +3825,8 @@ static int init_server_components()
       if (freopen(log_error_file, "a+", stdout))
 #endif
       {
-        reopen= freopen(log_error_file, "a+", stderr);
-        setbuf(stderr, NULL);
+        if (freopen(log_error_file, "a+", stderr))
+          setbuf(stderr, NULL);
       }
     }
   }
@@ -8222,7 +8221,7 @@ mysqld_get_one_option(int optid,
     *val= 0;
     val+= 2;
     while (*val && my_isspace(mysqld_charset, *val))
-      *val++;
+      val++;
     if (!*val)
     {
       sql_print_error("Bad syntax in replicate-rewrite-db - empty TO db!\n");

=== modified file 'sql/partition_info.cc'
--- a/sql/partition_info.cc	2010-07-09 12:00:17 +0000
+++ b/sql/partition_info.cc	2010-07-12 20:57:14 +0000
@@ -1206,13 +1206,11 @@ bool partition_info::set_up_charset_fiel
     i= 0;
     while ((field= *(ptr++)))
     {
-      CHARSET_INFO *cs;
       uchar *field_buf;
       LINT_INIT(field_buf);
 
       if (!field_is_partition_charset(field))
         continue;
-      cs= ((Field_str*)field)->charset();
       size= field->pack_length();
       if (!(field_buf= (uchar*) sql_calloc(size)))
         goto error;

=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2010-07-02 18:30:47 +0000
+++ b/sql/slave.cc	2010-07-12 20:57:14 +0000
@@ -3035,11 +3035,8 @@ log '%s' at position %s, relay log '%s'
   pthread_mutex_lock(&rli->data_lock);
   if (rli->slave_skip_counter)
   {
-    char *pos;
-    pos= strmake(saved_log_name, rli->group_relay_log_name, FN_REFLEN - 1);
-    pos= '\0';
-    pos= strmake(saved_master_log_name, rli->group_master_log_name, FN_REFLEN - 1);
-    pos= '\0';
+    strmake(saved_log_name, rli->group_relay_log_name, FN_REFLEN - 1);
+    strmake(saved_master_log_name, rli->group_master_log_name, FN_REFLEN - 1);
     saved_log_pos= rli->group_relay_log_pos;
     saved_master_log_pos= rli->group_master_log_pos;
     saved_skip= rli->slave_skip_counter;

=== modified file 'sql/spatial.cc'
--- a/sql/spatial.cc	2009-08-28 16:21:54 +0000
+++ b/sql/spatial.cc	2010-07-12 20:57:14 +0000
@@ -150,11 +150,10 @@ Geometry *Geometry::construct(Geometry_b
 {
   uint32 geom_type;
   Geometry *result;
-  char byte_order;
 
   if (data_len < SRID_SIZE + WKB_HEADER_SIZE)   // < 4 + (1 + 4)
     return NULL;
-  byte_order= data[SRID_SIZE];
+  /* byte_order= data[SRID_SIZE]; */
   geom_type= uint4korr(data + SRID_SIZE + 1);
   if (!(result= create_by_typeid(buffer, (int) geom_type)))
     return NULL;

=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc	2010-07-09 12:00:17 +0000
+++ b/sql/sql_acl.cc	2010-07-12 20:57:14 +0000
@@ -5701,7 +5701,6 @@ bool mysql_create_user(THD *thd, List <L
 {
   int result;
   String wrong_users;
-  ulong sql_mode;
   LEX_USER *user_name, *tmp_user_name;
   List_iterator <LEX_USER> user_list(list);
   TABLE_LIST tables[GRANT_TABLES];
@@ -5748,7 +5747,6 @@ bool mysql_create_user(THD *thd, List <L
     }
 
     some_users_created= TRUE;
-    sql_mode= thd->variables.sql_mode;
     if (replace_user_table(thd, tables[0].table, *user_name, 0, 0, 1, 0))
     {
       append_user(&wrong_users, user_name);

=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc	2010-07-02 18:30:47 +0000
+++ b/sql/sql_base.cc	2010-07-12 20:57:14 +0000
@@ -5674,7 +5674,7 @@ static void update_field_dependencies(TH
   DBUG_ENTER("update_field_dependencies");
   if (thd->mark_used_columns != MARK_COLUMNS_NONE)
   {
-    MY_BITMAP *current_bitmap, *other_bitmap;
+    MY_BITMAP *bitmap;
 
     /*
       We always want to register the used keys, as the column bitmap may have
@@ -5685,15 +5685,9 @@ static void update_field_dependencies(TH
     table->merge_keys.merge(field->part_of_key);
 
     if (thd->mark_used_columns == MARK_COLUMNS_READ)
-    {
-      current_bitmap= table->read_set;
-      other_bitmap=   table->write_set;
-    }
+      bitmap= table->read_set;
     else
-    {
-      current_bitmap= table->write_set;
-      other_bitmap=   table->read_set;
-    }
+      bitmap= table->write_set;
 
     /* 
        The test-and-set mechanism in the bitmap is not reliable during
@@ -5702,7 +5696,7 @@ static void update_field_dependencies(TH
        only those columns that are used in the SET clause. I.e they are being
        set here. See multi_update::prepare()
     */
-    if (bitmap_fast_test_and_set(current_bitmap, field->field_index))
+    if (bitmap_fast_test_and_set(bitmap, field->field_index))
     {
       if (thd->mark_used_columns == MARK_COLUMNS_WRITE)
       {

=== modified file 'sql/sql_load.cc'
--- a/sql/sql_load.cc	2010-06-09 08:29:27 +0000
+++ b/sql/sql_load.cc	2010-07-12 20:57:14 +0000
@@ -128,6 +128,7 @@ int mysql_load(THD *thd,sql_exchange *ex
   bool is_fifo=0;
 #ifndef EMBEDDED_LIBRARY
   LOAD_FILE_INFO lf_info;
+  THD::killed_state killed_status;
 #endif
   char *db = table_list->db;			// This is never null
   /*
@@ -138,7 +139,6 @@ int mysql_load(THD *thd,sql_exchange *ex
   char *tdb= thd->db ? thd->db : db;		// Result is never null
   ulong skip_lines= ex->skip_lines;
   bool transactional_table;
-  THD::killed_state killed_status= THD::NOT_KILLED;
   DBUG_ENTER("mysql_load");
 
 #ifdef EMBEDDED_LIBRARY
@@ -455,7 +455,11 @@ int mysql_load(THD *thd,sql_exchange *ex
                     error=1;
                     thd->killed= THD::KILL_QUERY;
                   };);
-  killed_status= (error == 0)? THD::NOT_KILLED : thd->killed;
+
+#ifndef EMBEDDED_LIBRARY
+  killed_status= (error == 0) ? THD::NOT_KILLED : thd->killed;
+#endif
+
   /*
     We must invalidate the table in query cache before binlog writing and
     ha_autocommit_...
@@ -708,12 +712,9 @@ read_fixed_length(THD *thd, COPY_INFO &i
   List_iterator_fast<Item> it(fields_vars);
   Item_field *sql_field;
   TABLE *table= table_list->table;
-  ulonglong id;
   bool err;
   DBUG_ENTER("read_fixed_length");
 
-  id= 0;
- 
   while (!read_info.read_fixed_length())
   {
     if (thd->killed)
@@ -839,12 +840,10 @@ read_sep_field(THD *thd, COPY_INFO &info
   Item *item;
   TABLE *table= table_list->table;
   uint enclosed_length;
-  ulonglong id;
   bool err;
   DBUG_ENTER("read_sep_field");
 
   enclosed_length=enclosed.length();
-  id= 0;
 
   for (;;it.rewind())
   {

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2010-07-04 04:02:49 +0000
+++ b/sql/sql_parse.cc	2010-07-12 20:57:14 +0000
@@ -465,6 +465,12 @@ static void handle_bootstrap_impl(THD *t
       }
       buff= (char*) thd->net.buff;
       res= fgets(buff + length, thd->net.max_packet - length, file);
+      if (!res && !feof(file))
+      {
+        net_end_statement(thd);
+        bootstrap_error= 1;
+        break;
+      }
       length+= (ulong) strlen(buff + length);
       /* purecov: end */
     }
@@ -1535,7 +1541,7 @@ bool dispatch_command(enum enum_server_c
   {
     STATUS_VAR current_global_status_var;
     ulong uptime;
-    uint length;
+    uint length __attribute__((unused));
     ulonglong queries_per_second1000;
     char buff[250];
     uint buff_len= sizeof(buff);
@@ -1548,7 +1554,7 @@ bool dispatch_command(enum enum_server_c
     else
       queries_per_second1000= thd->query_id * LL(1000) / uptime;
 
-    length= my_snprintf((char*) buff, buff_len - 1,
+    length= my_snprintf(buff, buff_len - 1,
                         "Uptime: %lu  Threads: %d  Questions: %lu  "
                         "Slow queries: %lu  Opens: %lu  Flush tables: %lu  "
                         "Open tables: %u  Queries per second avg: %u.%u",
@@ -1563,7 +1569,7 @@ bool dispatch_command(enum enum_server_c
 #ifdef EMBEDDED_LIBRARY
     /* Store the buffer in permanent memory */
     my_ok(thd, 0, 0, buff);
-#endif
+#else
 #ifdef SAFEMALLOC
     if (sf_malloc_cur_memory)				// Using SAFEMALLOC
     {
@@ -1574,7 +1580,6 @@ bool dispatch_command(enum enum_server_c
                            (sf_malloc_max_memory+1023L)/1024L);
     }
 #endif
-#ifndef EMBEDDED_LIBRARY
     VOID(my_net_write(net, (uchar*) buff, length));
     VOID(net_flush(net));
     thd->main_da.disable_status();

=== modified file 'sql/sql_repl.cc'
--- a/sql/sql_repl.cc	2010-07-02 18:30:47 +0000
+++ b/sql/sql_repl.cc	2010-07-12 20:57:14 +0000
@@ -1168,12 +1168,9 @@ bool change_master(THD* thd, Master_info
   /*
     Before processing the command, save the previous state.
   */
-  char *pos;
-  pos= strmake(saved_host, mi->host, HOSTNAME_LENGTH);
-  pos= '\0';
+  strmake(saved_host, mi->host, HOSTNAME_LENGTH);
   saved_port= mi->port;
-  pos= strmake(saved_log_name, mi->master_log_name, FN_REFLEN - 1);
-  pos= '\0';
+  strmake(saved_log_name, mi->master_log_name, FN_REFLEN - 1);
   saved_log_pos= mi->master_log_pos;
 
   /*

=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2010-07-09 12:00:17 +0000
+++ b/sql/sql_show.cc	2010-07-12 20:57:14 +0000
@@ -3868,7 +3868,6 @@ static int get_schema_column_record(THD
     uint flags=field->flags;
     char tmp[MAX_FIELD_WIDTH];
     String type(tmp,sizeof(tmp), system_charset_info);
-    char *end;
     int decimals, field_length;
 
     if (wild && wild[0] &&
@@ -3889,7 +3888,7 @@ static int get_schema_column_record(THD
                                  field->field_name) & COL_ACLS;
     if (!tables->schema_table && !col_access)
       continue;
-    end= tmp;
+    char *end= tmp;
     for (uint bitnr=0; col_access ; col_access>>=1,bitnr++)
     {
       if (col_access & 1)
@@ -4012,7 +4011,6 @@ static int get_schema_column_record(THD
     table->field[15]->store((const char*) pos,
                             strlen((const char*) pos), cs);
 
-    end= tmp;
     if (field->unireg_check == Field::NEXT_NUMBER)
       table->field[16]->store(STRING_WITH_LEN("auto_increment"), cs);
     if (show_table->timestamp_field == field &&

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2010-06-10 20:45:22 +0000
+++ b/sql/sql_table.cc	2010-07-12 20:57:14 +0000
@@ -6507,7 +6507,6 @@ bool mysql_alter_table(THD *thd,char *ne
   uint index_add_count= 0;
   uint *index_add_buffer= NULL;
   uint candidate_key_count= 0;
-  bool committed= 0;
   bool no_pk;
   DBUG_ENTER("mysql_alter_table");
 
@@ -7372,7 +7371,6 @@ view_err:
     DBUG_PRINT("info", ("Committing before unlocking table"));
     if (ha_autocommit_or_rollback(thd, 0) || end_active_trans(thd))
       goto err1;
-    committed= 1;
   }
   /*end of if (! new_table) for add/drop index*/
 

=== modified file 'sql/table.cc'
--- a/sql/table.cc	2010-06-10 20:16:43 +0000
+++ b/sql/table.cc	2010-07-12 20:57:14 +0000
@@ -534,7 +534,7 @@ int open_table_def(THD *thd, TABLE_SHARE
   int error, table_type;
   bool error_given;
   File file;
-  uchar head[288], *disk_buff;
+  uchar head[288];
   char	path[FN_REFLEN];
   MEM_ROOT **root_ptr, *old_root;
   DBUG_ENTER("open_table_def");
@@ -543,7 +543,6 @@ int open_table_def(THD *thd, TABLE_SHARE
 
   error= 1;
   error_given= 0;
-  disk_buff= NULL;
 
   strxmov(path, share->normalized_path.str, reg_ext, NullS);
   if ((file= my_open(path, O_RDONLY | O_SHARE, MYF(0))) < 0)

=== modified file 'sql/udf_example.c'
--- a/sql/udf_example.c	2010-07-02 18:30:47 +0000
+++ b/sql/udf_example.c	2010-07-12 20:57:14 +0000
@@ -1067,7 +1067,7 @@ char *myfunc_argument_name(UDF_INIT *ini
 {
   if (!args->attributes[0])
   {
-    null_value= 0;
+    *null_value= 1;
     return 0;
   }
   (*length)--; /* space for ending \0 (for debugging purposes) */

=== modified file 'storage/csv/ha_tina.cc'
--- a/storage/csv/ha_tina.cc	2010-02-17 12:13:42 +0000
+++ b/storage/csv/ha_tina.cc	2010-07-12 20:57:14 +0000
@@ -468,7 +468,7 @@ int ha_tina::encode_quote(uchar *buf)
     const char *ptr;
     const char *end_ptr;
     const bool was_null= (*field)->is_null();
-    
+
     /*
       assistance for backwards compatibility in production builds.
       note: this will not work for ENUM columns.
@@ -480,7 +480,7 @@ int ha_tina::encode_quote(uchar *buf)
     }
 
     (*field)->val_str(&attribute,&attribute);
-    
+
     if (was_null)
       (*field)->set_null();
 
@@ -491,34 +491,30 @@ int ha_tina::encode_quote(uchar *buf)
 
       buffer.append('"');
 
-      while (ptr < end_ptr) 
+      for (; ptr < end_ptr; ptr++)
       {
         if (*ptr == '"')
         {
           buffer.append('\\');
           buffer.append('"');
-          *ptr++;
         }
         else if (*ptr == '\r')
         {
           buffer.append('\\');
           buffer.append('r');
-          *ptr++;
         }
         else if (*ptr == '\\')
         {
           buffer.append('\\');
           buffer.append('\\');
-          *ptr++;
         }
         else if (*ptr == '\n')
         {
           buffer.append('\\');
           buffer.append('n');
-          *ptr++;
         }
         else
-          buffer.append(*ptr++);
+          buffer.append(*ptr);
       }
       buffer.append('"');
     }

=== modified file 'storage/example/ha_example.cc'
--- a/storage/example/ha_example.cc	2008-02-24 13:12:17 +0000
+++ b/storage/example/ha_example.cc	2010-07-12 20:57:14 +0000
@@ -153,7 +153,7 @@ static int example_done_func(void *p)
   hash_free(&example_open_tables);
   pthread_mutex_destroy(&example_mutex);
 
-  DBUG_RETURN(0);
+  DBUG_RETURN(error);
 }
 
 

=== modified file 'storage/myisam/mi_locking.c'
--- a/storage/myisam/mi_locking.c	2010-02-12 12:47:43 +0000
+++ b/storage/myisam/mi_locking.c	2010-07-12 20:57:14 +0000
@@ -29,7 +29,6 @@ int mi_lock_database(MI_INFO *info, int
   int error;
   uint count;
   MYISAM_SHARE *share=info->s;
-  uint flag;
   DBUG_ENTER("mi_lock_database");
   DBUG_PRINT("enter",("lock_type: %d  old lock %d  r_locks: %u  w_locks: %u "
                       "global_changed:  %d  open_count: %u  name: '%s'",
@@ -48,7 +47,7 @@ int mi_lock_database(MI_INFO *info, int
     DBUG_RETURN(0);
   }
 
-  flag=error=0;
+  error= 0;
   pthread_mutex_lock(&share->intern_lock);
   if (share->kfile >= 0)		/* May only be false on windows */
   {
@@ -120,14 +119,12 @@ int mi_lock_database(MI_INFO *info, int
 	{
 	  if (share->r_locks)
 	  {					/* Only read locks left */
-	    flag=1;
 	    if (my_lock(share->kfile,F_RDLCK,0L,F_TO_EOF,
 			MYF(MY_WME | MY_SEEK_NOT_DONE)) && !error)
 	      error=my_errno;
 	  }
 	  else if (!share->w_locks)
 	  {					/* No more locks */
-	    flag=1;
 	    if (my_lock(share->kfile,F_UNLCK,0L,F_TO_EOF,
 			MYF(MY_WME | MY_SEEK_NOT_DONE)) && !error)
 	      error=my_errno;
@@ -148,7 +145,6 @@ int mi_lock_database(MI_INFO *info, int
         */
 	if (share->w_locks == 1)
 	{
-	  flag=1;
           if (my_lock(share->kfile,lock_type,0L,F_TO_EOF,
 		      MYF(MY_SEEK_NOT_DONE)))
 	  {
@@ -163,7 +159,6 @@ int mi_lock_database(MI_INFO *info, int
       }
       if (!share->r_locks && !share->w_locks)
       {
-	flag=1;
 	if (my_lock(share->kfile,lock_type,0L,F_TO_EOF,
 		    info->lock_wait | MY_SEEK_NOT_DONE))
 	{
@@ -188,7 +183,6 @@ int mi_lock_database(MI_INFO *info, int
       {						/* Change READONLY to RW */
 	if (share->r_locks == 1)
 	{
-	  flag=1;
 	  if (my_lock(share->kfile,lock_type,0L,F_TO_EOF,
 		      MYF(info->lock_wait | MY_SEEK_NOT_DONE)))
 	  {
@@ -205,7 +199,6 @@ int mi_lock_database(MI_INFO *info, int
       {
 	if (!share->w_locks)
 	{
-	  flag=1;
 	  if (my_lock(share->kfile,lock_type,0L,F_TO_EOF,
 		      info->lock_wait | MY_SEEK_NOT_DONE))
 	  {
@@ -252,11 +245,6 @@ int mi_lock_database(MI_INFO *info, int
   }
 #endif
   pthread_mutex_unlock(&share->intern_lock);
-#if defined(FULL_LOG) || defined(_lint)
-  lock_type|=(int) (flag << 8);		/* Set bit to set if real lock */
-  myisam_log_command(MI_LOG_LOCK,info,(uchar*) &lock_type,sizeof(lock_type),
-		     error);
-#endif
   DBUG_RETURN(error);
 } /* mi_lock_database */
 

=== modified file 'storage/myisam/rt_split.c'
--- a/storage/myisam/rt_split.c	2010-03-25 11:18:14 +0000
+++ b/storage/myisam/rt_split.c	2010-07-12 20:57:14 +0000
@@ -255,7 +255,6 @@ int rtree_split_page(MI_INFO *info, MI_K
   SplitStruct *stop;
   double *coord_buf;
   double *next_coord;
-  double *old_coord;
   int n_dim;
   uchar *source_cur, *cur1, *cur2;
   uchar *new_page= info->buff;
@@ -293,8 +292,6 @@ int rtree_split_page(MI_INFO *info, MI_K
   rtree_d_mbr(keyinfo->seg, key, key_length, cur->coords);
   cur->key = key;
 
-  old_coord = next_coord;
-
   if (split_rtree_node(task, max_keys + 1,
        mi_getint(page) + full_length + 2, full_length, 
        rt_PAGE_MIN_SIZE(keyinfo->block_length),

=== modified file 'storage/myisammrg/myrg_open.c'
--- a/storage/myisammrg/myrg_open.c	2010-03-03 10:49:03 +0000
+++ b/storage/myisammrg/myrg_open.c	2010-07-12 20:57:14 +0000
@@ -227,9 +227,7 @@ MYRG_INFO *myrg_parent_open(const char *
   int       save_errno;
   int       insert_method;
   uint      length;
-  uint      dir_length;
   uint      child_count;
-  size_t    name_buff_length;
   File      fd;
   IO_CACHE  file_cache;
   char      parent_name_buff[FN_REFLEN * 2];
@@ -299,7 +297,6 @@ MYRG_INFO *myrg_parent_open(const char *
   }
 
   /* Call callback for each child. */
-  dir_length= dirname_part(parent_name_buff, parent_name, &name_buff_length);
   my_b_seek(&file_cache, 0);
   while ((length= my_b_gets(&file_cache, child_name_buff, FN_REFLEN - 1)))
   {
@@ -379,7 +376,6 @@ int myrg_attach_children(MYRG_INFO *m_in
 {
   ulonglong  file_offset;
   MI_INFO    *myisam;
-  int        rc;
   int        errpos;
   int        save_errno;
   uint       idx;
@@ -398,7 +394,6 @@ int myrg_attach_children(MYRG_INFO *m_in
     here and in ha_myisammrg::store_lock() forces consistent data.
   */
   pthread_mutex_lock(&m_info->mutex);
-  rc= 1;
   errpos= 0;
   file_offset= 0;
   min_keys= 0;

=== modified file 'strings/decimal.c'
--- a/strings/decimal.c	2010-07-09 12:00:17 +0000
+++ b/strings/decimal.c	2010-07-12 20:57:14 +0000
@@ -1934,8 +1934,7 @@ static int do_sub(decimal_t *from1, deci
 int decimal_intg(decimal_t *from)
 {
   int res;
-  dec1 *tmp_res;
-  tmp_res= remove_leading_zeroes(from, &res);
+  remove_leading_zeroes(from, &res);
   return res;
 }
 


Attachment: [text/bzr-bundle] bzr/davi.arnaut@sun.com-20100712205714-jibzss3f7jgb7qix.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (davi:3478) Bug#45288Davi Arnaut12 Jul