← Back to team overview

maria-developers team mailing list archive

[Branch ~maria-captains/maria/5.1] Rev 2841: Removed compiler warnings

 

------------------------------------------------------------
revno: 2841
committer: Michael Widenius <monty@xxxxxxxxxxxx>
branch nick: maria-5.1
timestamp: Wed 2010-04-07 01:47:08 +0300
message:
  Removed compiler warnings
  Removed random failures from test suite
added:
  mysql-test/suite/binlog/t/binlog_index-master.opt
  mysql-test/suite/pbxt/t/multi_statement-master.opt
modified:
  mysql-test/extra/rpl_tests/rpl_insert_id_pk.test
  mysql-test/include/maria_empty_logs.inc
  mysql-test/suite/binlog/r/binlog_index.result
  mysql-test/suite/binlog/t/binlog_index.test
  mysql-test/suite/pbxt/r/multi_statement.result
  sql/events.cc
  sql/handler.cc
  sql/log.cc
  sql/mysqld.cc
  sql/set_var.cc
  sql/slave.cc
  sql/sql_plugin.cc
  storage/xtradb/include/ut0lst.h
  support-files/compiler_warnings.supp


--
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 'mysql-test/extra/rpl_tests/rpl_insert_id_pk.test'
--- mysql-test/extra/rpl_tests/rpl_insert_id_pk.test	2007-06-06 17:57:07 +0000
+++ mysql-test/extra/rpl_tests/rpl_insert_id_pk.test	2010-04-06 22:47:08 +0000
@@ -82,7 +82,6 @@
 # Duplicate Key Errors codes
 --error 1022, ER_DUP_ENTRY
 INSERT INTO t1 VALUES (1),(1);
+drop table t1;
 sync_slave_with_master;
-connection master;
-drop table t1;
 # End of 4.1 tests

=== modified file 'mysql-test/include/maria_empty_logs.inc'
--- mysql-test/include/maria_empty_logs.inc	2009-10-13 12:47:17 +0000
+++ mysql-test/include/maria_empty_logs.inc	2010-04-06 22:47:08 +0000
@@ -11,9 +11,10 @@
 connection default;
 let $default_db=`select database()`;
 let $MYSQLD_DATADIR= `SELECT @@datadir`;
-# it will used at end of test for wait_for_status_var.inc primitive
-let $status_var= Threads_connected;
-let $status_var_value= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
+
+#it will used at end of test for wait_for_status_var.inc primitive
+#let $status_var= Threads_connected;
+#let $status_var_value= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
 
 connection admin;
 -- echo * shut down mysqld, removed logs, restarted it
@@ -77,12 +78,15 @@
 restart-maria_empty_logs.inc
 EOF
 
+connection default;
 --source include/wait_until_connected_again.inc
 
-connection default;
 # Make sure that all connections are restored
---source include/wait_for_status_var.inc
+# This is disabled as 'Threads_connected' can't be trusted'
+# (It may be affected by 'check_testcase()')
+# --source include/wait_for_status_var.inc
 # Restore current database as the effect of "use" was lost after restart
+
 --disable_query_log
 eval use $default_db;
 --enable_query_log

=== modified file 'mysql-test/suite/binlog/r/binlog_index.result'
--- mysql-test/suite/binlog/r/binlog_index.result	2009-12-16 19:52:56 +0000
+++ mysql-test/suite/binlog/r/binlog_index.result	2010-04-06 22:47:08 +0000
@@ -3,6 +3,7 @@
 call mtr.add_suppression('MSYQL_BIN_LOG::open failed to sync the index file');
 call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.');
 call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
+flush tables;
 flush logs;
 flush logs;
 flush logs;

=== added file 'mysql-test/suite/binlog/t/binlog_index-master.opt'
--- mysql-test/suite/binlog/t/binlog_index-master.opt	1970-01-01 00:00:00 +0000
+++ mysql-test/suite/binlog/t/binlog_index-master.opt	2010-04-06 22:47:08 +0000
@@ -0,0 +1,1 @@
+--skip-stack-trace --test-expect-abort --log-warnings=0

=== modified file 'mysql-test/suite/binlog/t/binlog_index.test'
--- mysql-test/suite/binlog/t/binlog_index.test	2009-12-08 16:03:19 +0000
+++ mysql-test/suite/binlog/t/binlog_index.test	2010-04-06 22:47:08 +0000
@@ -11,6 +11,8 @@
 call mtr.add_suppression('MSYQL_BIN_LOG::open failed to sync the index file');
 call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.');
 call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
+flush tables;
+
 let $old=`select @@debug`;
 
 let $MYSQLD_DATADIR= `select @@datadir`;

=== modified file 'mysql-test/suite/pbxt/r/multi_statement.result'
--- mysql-test/suite/pbxt/r/multi_statement.result	2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/multi_statement.result	2010-04-06 22:47:08 +0000
@@ -47,5 +47,5 @@
 3
 show status like 'Slow_queries'||||
 Variable_name	Value
-Slow_queries	0
+Slow_queries	3
 drop table t1||||

=== added file 'mysql-test/suite/pbxt/t/multi_statement-master.opt'
--- mysql-test/suite/pbxt/t/multi_statement-master.opt	1970-01-01 00:00:00 +0000
+++ mysql-test/suite/pbxt/t/multi_statement-master.opt	2010-04-06 22:47:08 +0000
@@ -0,0 +1,3 @@
+--slow-query-log
+--slow-query-log-file=slow.log
+--log-queries-not-using-indexes

=== modified file 'sql/events.cc'
--- sql/events.cc	2010-03-04 08:03:07 +0000
+++ sql/events.cc	2010-04-06 22:47:08 +0000
@@ -1263,8 +1263,9 @@
       }
     }
   }
-  sql_print_information("Event Scheduler: Loaded %d event%s",
-                        count, (count == 1) ? "" : "s");
+  if (global_system_variables.log_warnings)
+    sql_print_information("Event Scheduler: Loaded %d event%s",
+                          count, (count == 1) ? "" : "s");
   ret= FALSE;
 
 end:

=== modified file 'sql/handler.cc'
--- sql/handler.cc	2010-03-30 12:36:49 +0000
+++ sql/handler.cc	2010-04-06 22:47:08 +0000
@@ -4298,6 +4298,8 @@
                                 enum ha_rkey_function find_flag)
 {
   int error, error1;
+  LINT_INIT(error1);
+
   error= index_init(index, 0);
   if (!error)
   {

=== modified file 'sql/log.cc'
--- sql/log.cc	2010-03-24 22:12:39 +0000
+++ sql/log.cc	2010-04-06 22:47:08 +0000
@@ -1216,6 +1216,7 @@
 {
   my_bool *tmp_opt= 0;
   MYSQL_LOG *file_log;
+  LINT_INIT(file_log);
 
   switch (log_type) {
   case QUERY_LOG_SLOW:

=== modified file 'sql/mysqld.cc'
--- sql/mysqld.cc	2010-03-30 12:36:49 +0000
+++ sql/mysqld.cc	2010-04-06 22:47:08 +0000
@@ -1,4 +1,5 @@
 /* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+   2009-2010 Monty Program Ab
 
    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
@@ -382,7 +383,7 @@
 static bool volatile ready_to_exit;
 static my_bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0;
 static my_bool opt_short_log_format= 0;
-static my_bool opt_ignore_wrong_options= 0;
+static my_bool opt_ignore_wrong_options= 0, opt_expect_abort= 0;
 static uint kill_cached_threads, wake_thread;
 ulong thread_created;
 static ulong max_used_connections;
@@ -2530,13 +2531,19 @@
   curr_time= my_time(0);
   localtime_r(&curr_time, &tm);
 
-  fprintf(stderr,"\
-%02d%02d%02d %2d:%02d:%02d - mysqld got " SIGNAL_FMT " ;\n\
+  fprintf(stderr, "%02d%02d%02d %2d:%02d:%02d ",
+          tm.tm_year % 100, tm.tm_mon+1, tm.tm_mday,
+          tm.tm_hour, tm.tm_min, tm.tm_sec);
+  if (opt_expect_abort && sig == SIGABRT)
+  {
+    fprintf(stderr,"[Note] mysqld did an expected abort\n");
+    goto end;
+  }
+
+  fprintf(stderr,"[ERROR] mysqld got " SIGNAL_FMT " ;\n\
 This could be because you hit a bug. It is also possible that this binary\n\
 or one of the libraries it was linked against is corrupt, improperly built,\n\
 or misconfigured. This error can also be caused by malfunctioning hardware.\n",
-          tm.tm_year % 100, tm.tm_mon+1, tm.tm_mday,
-          tm.tm_hour, tm.tm_min, tm.tm_sec,
 	  sig);
   fprintf(stderr, "\
 We will try our best to scrape up some info that will hopefully help diagnose\n\
@@ -2655,6 +2662,7 @@
   }
 #endif
 
+end:
 #ifndef __WIN__
   /* On Windows, do not terminate, but pass control to exception filter */
   exit(1);
@@ -5888,7 +5896,7 @@
   OPT_MIN_EXAMINED_ROW_LIMIT,
   OPT_LOG_SLOW_SLAVE_STATEMENTS,
   OPT_DEBUG_CRC, OPT_DEBUG_ON, OPT_OLD_MODE,
-  OPT_TEST_IGNORE_WRONG_OPTIONS, 
+  OPT_TEST_IGNORE_WRONG_OPTIONS, OPT_TEST_RESTART,
 #if defined(ENABLED_DEBUG_SYNC)
   OPT_DEBUG_SYNC_TIMEOUT,
 #endif /* defined(ENABLED_DEBUG_SYNC) */
@@ -6737,6 +6745,10 @@
    "Ignore wrong enums values in command line arguments. Useful only for test scripts",
    (uchar**) &opt_ignore_wrong_options, (uchar**) &opt_ignore_wrong_options,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"test-expect-abort", OPT_TEST_RESTART,
+   "Expect that server aborts with 'abort'; Don't write out server variables on 'abort'. Useful only for test scripts",
+   (uchar**) &opt_expect_abort, (uchar**) &opt_expect_abort,
+   0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"timed_mutexes", OPT_TIMED_MUTEXES,
    "Specify whether to time mutexes (only InnoDB mutexes are currently supported)",
    (uchar**) &timed_mutexes, (uchar**) &timed_mutexes, 0, GET_BOOL, NO_ARG, 0,

=== modified file 'sql/set_var.cc'
--- sql/set_var.cc	2010-03-28 18:10:00 +0000
+++ sql/set_var.cc	2010-04-06 22:47:08 +0000
@@ -2590,7 +2590,7 @@
   char path[FN_REFLEN], buff[FN_REFLEN];
   MY_STAT f_stat;
   String str(buff, sizeof(buff), system_charset_info), *res;
-  const char *log_file_str;
+  const char *log_file_str= 0;
   size_t path_length;
 
   if (!(res= var->value->val_str(&str)))
@@ -2640,7 +2640,7 @@
 
 err:
   my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name, 
-           res ? log_file_str : "NULL");
+           log_file_str ? log_file_str : "NULL");
   return 1;
 }
 
@@ -2649,7 +2649,7 @@
 			     set_var *var, const char *log_ext,
 			     bool log_state, uint log_type)
 {
-  MYSQL_QUERY_LOG *file_log;
+  MYSQL_QUERY_LOG *file_log= 0;
   char buff[FN_REFLEN];
   char *res= 0, *old_value=(char *)(var ? var->value->str_value.ptr() : 0);
   bool result= 0;

=== modified file 'sql/slave.cc'
--- sql/slave.cc	2010-03-04 08:03:07 +0000
+++ sql/slave.cc	2010-04-06 22:47:08 +0000
@@ -2255,6 +2255,7 @@
     if (slave_trans_retries)
     {
       int temp_err;
+      LINT_INIT(temp_err);
       if (exec_res && (temp_err= has_temporary_error(thd)))
       {
         const char *errmsg;

=== modified file 'sql/sql_plugin.cc'
--- sql/sql_plugin.cc	2010-03-12 19:05:21 +0000
+++ sql/sql_plugin.cc	2010-04-06 22:47:08 +0000
@@ -1701,9 +1701,10 @@
 
   if (tmp->state == PLUGIN_IS_DISABLED)
   {
-    push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
-                        ER_CANT_INITIALIZE_UDF, ER(ER_CANT_INITIALIZE_UDF),
-                        name->str, "Plugin is disabled");
+    if (global_system_variables.log_warnings)
+      push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+                          ER_CANT_INITIALIZE_UDF, ER(ER_CANT_INITIALIZE_UDF),
+                          name->str, "Plugin is disabled");
   }
   else
   {

=== modified file 'storage/xtradb/include/ut0lst.h'
--- storage/xtradb/include/ut0lst.h	2010-03-30 12:36:49 +0000
+++ storage/xtradb/include/ut0lst.h	2010-04-06 22:47:08 +0000
@@ -158,7 +158,7 @@
 /** Invalidate the pointers in a list node.
 @param NAME	list name
 @param N	pointer to the node that was removed */
-# define UT_LIST_REMOVE_CLEAR(NAME, N) {} while (0)
+# define UT_LIST_REMOVE_CLEAR(NAME, N) do {} while (0)
 #endif
 
 /*******************************************************************//**

=== modified file 'support-files/compiler_warnings.supp'
--- support-files/compiler_warnings.supp	2010-04-01 09:40:11 +0000
+++ support-files/compiler_warnings.supp	2010-04-06 22:47:08 +0000
@@ -40,6 +40,7 @@
 sync/sync0sync\.c: unused variable
 ut/ut0ut\.c: ignoring return value of
 srv/srv0srv\.c: value computed is not used
+buf/buf0buf\.c: warning: .*block_mutex.* might be used uninitialized
 
 #
 # bdb is not critical to keep up to date