Commit 07d8be45 authored by unknown's avatar unknown
Browse files

Fixed a lot of compiler warnings (Mainly in mysqld and instance manager)

Fixed some possible fatal wrong arguments to printf() style functions
Initialized some not initialized variables
Fixed bug in stored procedure and continue handlers
(Fixes Bug#22150)


include/mysql/plugin.h:
  Remove compiler warning
mysql-test/mysql-test-run.pl:
  Ensure that --extern works on a clean tree (when 'var' directory doesn't exists)
server-tools/instance-manager/commands.cc:
  Fixed possible use of unitialized variable
server-tools/instance-manager/guardian.cc:
  Fixed wrong arguments to log_info() that could cause crashes
server-tools/instance-manager/instance.cc:
  Fixed wrong arguments to log_info() and log_error() that could cause crashes
server-tools/instance-manager/instance_options.cc:
  Fixed wrong arguments to log_error() that could cause crashes
server-tools/instance-manager/mysql_connection.cc:
  Fixed wrong arguments to log_info()
server-tools/instance-manager/parse.cc:
  Fixed possible use of unitialized variable
server-tools/instance-manager/user_map.cc:
  Fixed wrong arguments to log_error() that could cause crashes
sql/Makefile.am:
  Fix for bison 1.875
  (It write an __attribute__() tag that was causing compiler failures)
sql/ha_ndbcluster.cc:
  Fixed wrong snprintf() arguments
  Remoed not used variables
sql/ha_ndbcluster_binlog.cc:
  Fixed compiler warning (unsigned/signed comparision)
sql/handler.cc:
  Fixed wrong parameter to hton->binlog_func()
sql/item_cmpfunc.cc:
  Removed compiler warnings
sql/item_timefunc.cc:
  Removed compiler warnings
sql/log.cc:
  fixed wrong argument to snprintf()
sql/mysqld.cc:
  Removed compiler warnings
  Fixed wrong arguments to printf()
sql/partition_info.cc:
  Removed compiler warnings
sql/protocol.cc:
  reset is_fatal_error for stored procedures
  (Fix for Bug#22150)
sql/sp_head.cc:
  More DBUG information
  Reset is_fatal_error in case of continue handler.
  (Fix for Bug#22150)
sql/sql_base.cc:
  Removed compiler warnings
sql/sql_class.h:
  More DBUG information
sql/sql_insert.cc:
  Removed compiler warnings
  Initialize not initialized variable (fatal bug)
sql/sql_parse.cc:
  Added DBUG_ASSERT to detect if stored procedure code returns with a wrong state
  Removed compiler warning
sql/sql_plugin.cc:
  Fied wrong aruguments to printf() (Fatal bug)
sql/sql_select.cc:
  Initailize not initialized variable.
  Remove compiler warnings
  Fixed wrong argument to printf() (Possible fatal error)
sql/sql_view.cc:
  Removed compiler warnings
sql/table.cc:
  Fixed wrong argument to printf() (Possible fatal)
parent 9852dfbc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ __MYSQL_DECLARE_PLUGIN(NAME, \
                 builtin_ ## NAME ## _sizeof_struct_st_plugin, \
                 builtin_ ## NAME ## _plugin)

#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0}}
#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0}}

/*
  declarations for SHOW STATUS support in plugins
+16 −9
Original line number Diff line number Diff line
@@ -1633,7 +1633,7 @@ sub environment_setup () {
  # ----------------------------------------------------
  # We are nice and report a bit about our settings
  # ----------------------------------------------------
  if (!$opt_extern)
  if (!$opt_extern && $opt_verbose)
  {
    print "Using MTR_BUILD_THREAD      = $ENV{MTR_BUILD_THREAD}\n";
    print "Using MASTER_MYPORT         = $ENV{MASTER_MYPORT}\n";
@@ -2270,6 +2270,11 @@ sub initialize_servers () {
    }
    check_running_as_root();
  }
  else
  {
    # We have to create the 'var' and related directories
    cleanup_stale_files();
  }
}

sub mysql_install_db () {
@@ -2590,6 +2595,8 @@ sub do_before_run_mysqltest($)
  }


  if (!$opt_extern)
  {
    # MASV cleanup...
    mtr_tonewfile($path_current_test_log,"$tname\n"); # Always tell where we are

@@ -2597,11 +2604,11 @@ sub do_before_run_mysqltest($)
    mtr_tofile($file_ndb_testrun_log,"CURRENT TEST $tname\n");

    mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n");
  if ( $master->[1]->{'pid'} )
  {
    if ( $master->[1]->{'pid'} ) {
      mtr_tofile($master->[1]->{'path_myerr'},"CURRENT_TEST: $tname\n");
    }
  }
}

sub do_after_run_mysqltest($)
{
+1 −1
Original line number Diff line number Diff line
@@ -1351,7 +1351,7 @@ Abstract_option_cmd::get_instance_options_list(const LEX_STRING *instance_name)

int Abstract_option_cmd::execute_impl(st_net *net, ulong connection_id)
{
  int err_code;
  int err_code= 0;

  /* Check that all the specified instances exist and are offline. */

+5 −5
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ void Guardian_thread::process_instance(Instance *instance,
    {
      /* clear status fields */
      log_info("guardian: instance %s is running, set state to STARTED",
               instance->options.instance_name);
               instance->options.instance_name.str);
      current_node->restart_counter= 0;
      current_node->crash_moment= 0;
      current_node->state= STARTED;
@@ -169,7 +169,7 @@ void Guardian_thread::process_instance(Instance *instance,
    switch (current_node->state) {
    case NOT_STARTED:
      log_info("guardian: starting instance %s",
               instance->options.instance_name);
               instance->options.instance_name.str);

      /* NOTE, set state to STARTING _before_ start() is called */
      current_node->state= STARTING;
@@ -194,7 +194,7 @@ void Guardian_thread::process_instance(Instance *instance,
        {
          instance->start();
          log_info("guardian: starting instance %s",
                   instance->options.instance_name);
                   instance->options.instance_name.str);
        }
      }
      else
@@ -212,13 +212,13 @@ void Guardian_thread::process_instance(Instance *instance,
            current_node->last_checked= current_time;
            current_node->restart_counter++;
            log_info("guardian: restarting instance %s",
                     instance->options.instance_name);
                     instance->options.instance_name.str);
          }
        }
        else
        {
          log_info("guardian: cannot start instance %s. Abandoning attempts "
                   "to (re)start it", instance->options.instance_name);
                   "to (re)start it", instance->options.instance_name.str);
          current_node->state= CRASHED_AND_ABANDONED;
        }
      }
+5 −5
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ static int start_process(Instance_options *instance_options,
    exit(1);
  case -1:
    log_info("cannot create a new process to start instance %s",
             instance_options->instance_name);
             instance_options->instance_name.str);
    return 1;
  }
  return 0;
@@ -311,9 +311,9 @@ void Instance::remove_pid()
  int pid;
  if ((pid= options.get_pid()) != 0)          /* check the pidfile */
    if (options.unlink_pidfile())             /* remove stalled pidfile */
      log_error("cannot remove pidfile for instance %i, this might be \
                since IM lacks permmissions or hasn't found the pidifle",
                options.instance_name);
      log_error("cannot remove pidfile for instance %s, this might be "
                "since IM lacks permmissions or hasn't found the pidfile",
                options.instance_name.str);
}


@@ -619,7 +619,7 @@ void Instance::kill_instance(int signum)
        log_error("The instance %s is being stopped forcibly. Normally" \
                  "it should not happen. Probably the instance has been" \
                  "hanging. You should also check your IM setup",
                  options.instance_name);
                  options.instance_name.str);
        /* After sucessful hard kill the pidfile need to be removed */
        options.unlink_pidfile();
      }
Loading