← Back to team overview

maria-developers team mailing list archive

[Branch ~maria-captains/maria/5.1] Rev 2828: Fix some compiler warnings seen in Buildbot.

 

------------------------------------------------------------
revno: 2828
committer: knielsen@xxxxxxxxxxxxxxx
branch nick: mariadb-5.1
timestamp: Wed 2010-03-10 11:32:14 +0100
message:
  Fix some compiler warnings seen in Buildbot.
  
  Add some extra error output and code cleanup in an attempt to fix/debug
  a rare random testsuite problem in check_warnings, where the exit code
  from mysqltest is somehow corrupted inside mysql-test-run.pl.
modified:
  include/my_global.h
  mysql-test/lib/My/SafeProcess.pm
  mysql-test/mysql-test-run.pl
  sql/sql_lex.cc
  sql/table.cc
  storage/federatedx/ha_federatedx.cc
  storage/maria/ma_delete.c
  storage/maria/ma_loghandler.c
  storage/myisam/ft_stopwords.c
  storage/myisam/mi_write.c
  storage/xtradb/btr/btr0cur.c
  support-files/compiler_warnings.supp
  vio/viossl.c


--
lp:maria
https://code.launchpad.net/~maria-captains/maria/5.1

Your team Maria developers is subscribed to branch lp:maria.
To unsubscribe from this branch go to https://code.launchpad.net/~maria-captains/maria/5.1/+edit-subscription.
=== modified file 'include/my_global.h'
--- include/my_global.h	2010-03-04 08:03:07 +0000
+++ include/my_global.h	2010-03-10 10:32:14 +0000
@@ -1260,9 +1260,9 @@
                          } while (0)
 #define float4get(V,M)   do { *((float *) &(V)) = *((const float*) (M)); } while(0)
 #define float8get(V,M)   doubleget((V),(M))
-#define float4store(V,M) memcpy((uchar*) V,(const uchar*) (&M),sizeof(float))
-#define floatstore(T,V)  memcpy((uchar*)(T), (const uchar*)(&V),sizeof(float))
-#define floatget(V,M)    memcpy((uchar*) &V,(const uchar*) (M),sizeof(float))
+#define float4store(V,M) memcpy((uchar*) V,(uchar*) (&M),sizeof(float))
+#define floatstore(T,V)  memcpy((uchar*)(T), (uchar*)(&V),sizeof(float))
+#define floatget(V,M)    memcpy((uchar*) &V,(uchar*) (M),sizeof(float))
 #define float8store(V,M) doublestore((V),(M))
 #else
 

=== modified file 'mysql-test/lib/My/SafeProcess.pm'
--- mysql-test/lib/My/SafeProcess.pm	2009-04-29 14:13:38 +0000
+++ mysql-test/lib/My/SafeProcess.pm	2010-03-10 10:32:14 +0000
@@ -384,9 +384,9 @@
 
 
 sub _collect {
-  my ($self)= @_;
+  my ($self, $exit_code)= @_;
 
-  $self->{EXIT_STATUS}= $?;
+  $self->{EXIT_STATUS}= $exit_code;
   _verbose("_collect: $self");
 
   # Take the process out of running list
@@ -453,6 +453,7 @@
   #_verbose("blocking: $blocking, use_alarm: $use_alarm");
 
   my $retpid;
+  my $exit_code;
   eval
   {
     # alarm should break the wait
@@ -461,6 +462,7 @@
     alarm($timeout) if $use_alarm;
 
     $retpid= waitpid($pid, $blocking ? 0 : &WNOHANG);
+    $exit_code= $?;
 
     alarm(0) if $use_alarm;
   };
@@ -492,7 +494,7 @@
   #warn "wait_one: expected pid $pid but got $retpid"
   #  unless( $retpid == $pid );
 
-  $self->_collect();
+  $self->_collect($exit_code);
   return 0;
 }
 
@@ -505,6 +507,8 @@
 #
 sub wait_any {
   my $ret_pid;
+  my $exit_code;
+
   if (IS_WIN32PERL) {
     # Can't wait for -1 => use a polling loop
     do {
@@ -514,6 +518,7 @@
 	last if $pid == $ret_pid;
       }
     } while ($ret_pid == 0);
+    $exit_code= $?;
   }
   else
   {
@@ -523,6 +528,7 @@
       print STDERR "wait_any, got invalid pid: $ret_pid\n";
       return undef;
     }
+    $exit_code= $?;
   }
 
   # Look it up in "running" table
@@ -532,7 +538,7 @@
     print STDERR "running: ". join(", ", keys(%running)). "\n";
     return undef;
   }
-  $proc->_collect;
+  $proc->_collect($exit_code);
   return $proc;
 }
 

=== modified file 'mysql-test/mysql-test-run.pl'
--- mysql-test/mysql-test-run.pl	2010-03-04 08:03:07 +0000
+++ mysql-test/mysql-test-run.pl	2010-03-10 10:32:14 +0000
@@ -4102,7 +4102,7 @@
      error         => $errfile,
      output        => $errfile,
      args          => \$args,
-     user_data     => $errfile,
+     user_data     => [$errfile, $mysqld],
      verbose       => $opt_verbose,
     );
   mtr_verbose("Started $proc");
@@ -4148,7 +4148,7 @@
     if ( delete $started{$proc->pid()} ) {
       # One check warning process returned
       my $res= $proc->exit_status();
-      my $err_file= $proc->user_data();
+      my ($err_file, $mysqld)= @{$proc->user_data()};
 
       if ( $res == 0 or $res == 62 ){
 
@@ -4184,7 +4184,8 @@
 	my $report= mtr_grab_file($err_file);
 	$tinfo->{comment}.=
 	  "Could not execute 'check-warnings' for ".
-	    "testcase '$tname' (res: $res):\n";
+	    "testcase '$tname' (res: $res) server: '".
+              $mysqld->name() .":\n";
 	$tinfo->{comment}.= $report;
 
 	$result= 2;

=== modified file 'sql/sql_lex.cc'
--- sql/sql_lex.cc	2009-12-03 11:19:05 +0000
+++ sql/sql_lex.cc	2010-03-10 10:32:14 +0000
@@ -1842,13 +1842,15 @@
 void st_select_lex::mark_as_dependent(st_select_lex *last, Item *dependency)
 {
   SELECT_LEX *next_to_last;
+
+  DBUG_ASSERT(this != last);
+
   /*
     Mark all selects from resolved to 1 before select where was
     found table as depended (of select where was found table)
   */
-  for (SELECT_LEX *s= this;
-       s && s != last;
-       s= s->outer_select())
+  SELECT_LEX *s= this;
+  do
   {
     if (!(s->uncacheable & UNCACHEABLE_DEPENDENT))
     {
@@ -1866,7 +1868,8 @@
       }
     }
     next_to_last= s;
-  }
+  } while ((s= s->outer_select()) != last && s != 0);
+
   is_correlated= TRUE;
   this->master_unit()->item->is_correlated= TRUE;
   if (dependency)

=== modified file 'sql/table.cc'
--- sql/table.cc	2010-03-09 19:23:30 +0000
+++ sql/table.cc	2010-03-10 10:32:14 +0000
@@ -2053,6 +2053,8 @@
   ulong ret_value=0;
   DBUG_ENTER("get_form_pos");
 
+  LINT_INIT(buf);
+
   names=uint2korr(head+8);
   a_length=(names+2)*sizeof(char *);		/* Room for two extra */
 

=== modified file 'storage/federatedx/ha_federatedx.cc'
--- storage/federatedx/ha_federatedx.cc	2009-12-03 11:34:11 +0000
+++ storage/federatedx/ha_federatedx.cc	2010-03-10 10:32:14 +0000
@@ -1783,7 +1783,7 @@
 
 int ha_federatedx::close(void)
 {
-  int retval, error;
+  int retval= 0, error;
   THD *thd= current_thd;
   DBUG_ENTER("ha_federatedx::close");
 

=== modified file 'storage/maria/ma_delete.c'
--- storage/maria/ma_delete.c	2009-01-12 11:12:00 +0000
+++ storage/maria/ma_delete.c	2010-03-10 10:32:14 +0000
@@ -169,6 +169,8 @@
   MARIA_KEY org_key;
   DBUG_ENTER("_ma_ck_delete");
 
+  LINT_INIT_STRUCT(org_key);
+
   save_key_data= key->data;
   if (share->now_transactional)
   {

=== modified file 'storage/maria/ma_loghandler.c'
--- storage/maria/ma_loghandler.c	2010-01-06 21:27:53 +0000
+++ storage/maria/ma_loghandler.c	2010-03-10 10:32:14 +0000
@@ -1394,6 +1394,7 @@
 
   {
     LOGHANDLER_FILE_INFO info;
+    LINT_INIT_STRUCT(info);
     File fd= open_logfile_by_number_no_cache(file);
     if ((fd < 0) ||
         (translog_read_file_header(&info, fd) | my_close(fd, MYF(MY_WME))))

=== modified file 'storage/myisam/ft_stopwords.c'
--- storage/myisam/ft_stopwords.c	2010-01-28 14:49:14 +0000
+++ storage/myisam/ft_stopwords.c	2010-03-10 10:32:14 +0000
@@ -45,7 +45,7 @@
 {
   FT_STOPWORD sw;
   return !w ||
-         (((sw.len= (uint) strlen(sw.pos=w)) >= ft_min_word_len) &&
+    (((sw.len= (uint) strlen(sw.pos=(const uchar *)w)) >= ft_min_word_len) &&
           (tree_insert(stopwords3, &sw, 0, stopwords3->custom_arg)==NULL));
 }
 

=== modified file 'storage/myisam/mi_write.c'
--- storage/myisam/mi_write.c	2009-12-03 11:19:05 +0000
+++ storage/myisam/mi_write.c	2010-03-10 10:32:14 +0000
@@ -735,10 +735,12 @@
   }
 
   end=page+length-key_ref_length;
+  DBUG_ASSERT(page < end);
   *key='\0';
   length=0;
   lastpos=page;
-  while (page < end)
+
+  do
   {
     prevpos=lastpos; lastpos=page;
     last_length=length;
@@ -749,7 +751,8 @@
       my_errno=HA_ERR_CRASHED;
       DBUG_RETURN(0);
     }
-  }
+  } while (page < end);
+
   *return_key_length=last_length;
   *after_key=lastpos;
   DBUG_PRINT("exit",("returns: 0x%lx  page: 0x%lx  end: 0x%lx",

=== modified file 'storage/xtradb/btr/btr0cur.c'
--- storage/xtradb/btr/btr0cur.c	2009-11-13 21:26:08 +0000
+++ storage/xtradb/btr/btr0cur.c	2010-03-10 10:32:14 +0000
@@ -3233,7 +3233,7 @@
 	ulint		matched_bytes;
 	ib_int64_t	n_recs	= 0;
 	ib_int64_t*	n_diff;
-	ib_int64_t*	n_not_nulls;
+	ib_int64_t*	n_not_nulls= 0;
 	ullint		n_sample_pages; /* number of pages to sample */
 	ulint		not_empty_flag	= 0;
 	ulint		total_external_size = 0;

=== modified file 'support-files/compiler_warnings.supp'
--- support-files/compiler_warnings.supp	2010-01-28 14:49:14 +0000
+++ support-files/compiler_warnings.supp	2010-03-10 10:32:14 +0000
@@ -108,7 +108,7 @@
 #
 # Yassl
 include/runtime.hpp: .*pure_error.*
-.*/extra/yassl/taocrypt/.*: comparison with string literal
+.*/extra/yassl/.*taocrypt/.*: comparison with string literal
 .*/extra/yassl/taocrypt/src/blowfish\.cpp: array subscript is above array bounds
 .*/extra/yassl/taocrypt/src/file\.cpp: ignoring return value
 .*/extra/yassl/taocrypt/src/integer\.cpp: control reaches end of non-void function

=== modified file 'vio/viossl.c'
--- vio/viossl.c	2010-01-29 10:42:31 +0000
+++ vio/viossl.c	2010-03-10 10:32:14 +0000
@@ -75,9 +75,11 @@
 
   if (ssl)
   {
+#ifndef DBUG_OFF
     int error= SSL_get_error(ssl, l);
     DBUG_PRINT("error", ("error: %s (%d)",
                          ERR_error_string(error, buf), error));
+#endif
   }
 
   DBUG_PRINT("info", ("socket_errno: %d", socket_errno));