Commit 3bb26768 authored by unknown's avatar unknown
Browse files

Polishing: generate more warnings and make code warnings-free.


server-tools/instance-manager/Makefile.am:
  Generate more warnings.
server-tools/instance-manager/commands.cc:
  Eliminate warnings.
server-tools/instance-manager/commands.h:
  Eliminate warnings.
server-tools/instance-manager/instance.cc:
  Eliminate warnings.
server-tools/instance-manager/mysql_connection.cc:
  Eliminate warnings.
server-tools/instance-manager/parse.cc:
  Eliminate warnings.
server-tools/instance-manager/user_map.cc:
  Eliminate warnings.
server-tools/instance-manager/user_map.h:
  Eliminate warnings.
parent ec0f78f4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ client_settings.h:

libexec_PROGRAMS= mysqlmanager

mysqlmanager_CXXFLAGS=  -Werror
mysqlmanager_CXXFLAGS=  -Wall -Wextra -Werror

mysqlmanager_SOURCES=	command.cc command.h mysqlmanager.cc \
			manager.h manager.cc log.h log.cc \
+13 −9
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ Instance_name::Instance_name(const LEX_STRING *name)
    ER_OUT_OF_RESOURCES         Not enough resources to complete the operation
*/

int Show_instances::execute(st_net *net, ulong connection_id)
int Show_instances::execute(st_net *net, ulong /* connection_id */)
{
  int err_code;

@@ -309,7 +309,8 @@ int Show_instance_status::execute_impl(st_net *net, Instance *instance)
}


int Show_instance_status::send_ok_response(st_net *net, ulong connection_id)
int Show_instance_status::send_ok_response(st_net *net,
                                           ulong /* connection_id */)
{
  if (send_eof(net) || net_flush(net))
    return ER_OUT_OF_RESOURCES;
@@ -429,7 +430,8 @@ int Show_instance_options::execute_impl(st_net *net, Instance *instance)
}


int Show_instance_options::send_ok_response(st_net *net, ulong connection_id)
int Show_instance_options::send_ok_response(st_net *net,
                                            ulong /* connection_id */)
{
  if (send_eof(net) || net_flush(net))
    return ER_OUT_OF_RESOURCES;
@@ -512,7 +514,7 @@ Start_instance::Start_instance(const LEX_STRING *instance_name_arg)
    ER_OUT_OF_RESOURCES         Not enough resources to complete the operation
*/

int Start_instance::execute_impl(st_net *net, Instance *instance)
int Start_instance::execute_impl(st_net * /* net */, Instance *instance)
{
  int err_code;

@@ -553,7 +555,7 @@ Stop_instance::Stop_instance(const LEX_STRING *instance_name_arg)
    ER_OUT_OF_RESOURCES         Not enough resources to complete the operation
*/

int Stop_instance::execute_impl(st_net *net, Instance *instance)
int Stop_instance::execute_impl(st_net * /* net */, Instance *instance)
{
  int err_code;

@@ -803,7 +805,7 @@ Drop_instance::Drop_instance(const LEX_STRING *instance_name_arg)
    ER_OUT_OF_RESOURCES         Not enough resources to complete the operation
*/

int Drop_instance::execute_impl(st_net *net, Instance *instance)
int Drop_instance::execute_impl(st_net * /* net */, Instance *instance)
{
  int err_code;

@@ -899,7 +901,8 @@ int Show_instance_log::execute_impl(st_net *net, Instance *instance)
}


int Show_instance_log::send_ok_response(st_net *net, ulong connection_id)
int Show_instance_log::send_ok_response(st_net *net,
                                        ulong /* connection_id */)
{
  if (send_eof(net) || net_flush(net))
    return ER_OUT_OF_RESOURCES;
@@ -1030,7 +1033,8 @@ int Show_instance_log_files::execute_impl(st_net *net, Instance *instance)
}


int Show_instance_log_files::send_ok_response(st_net *net, ulong connection_id)
int Show_instance_log_files::send_ok_response(st_net *net,
                                              ulong /* connection_id */)
{
  if (send_eof(net) || net_flush(net))
    return ER_OUT_OF_RESOURCES;
@@ -1689,7 +1693,7 @@ int Unset_option::process_option(Instance *instance, Named_value *option)
 Implementation of Syntax_error.
**************************************************************************/

int Syntax_error::execute(st_net *net, ulong connection_id)
int Syntax_error::execute(st_net * /* net */, ulong /* connection_id */)
{
  return ER_SYNTAX_ERROR;
}
+20 −0
Original line number Diff line number Diff line
@@ -37,6 +37,10 @@

class Show_instances : public Command
{
public:
  Show_instances()
  { }

public:
  int execute(st_net *net, ulong connection_id);

@@ -53,6 +57,10 @@ class Show_instances : public Command

class Flush_instances : public Command
{
public:
  Flush_instances()
  { }

public:
  int execute(st_net *net, ulong connection_id);
};
@@ -311,6 +319,10 @@ class Abstract_option_cmd : public Command

class Set_option : public Abstract_option_cmd
{
public:
  Set_option()
  { }

protected:
  virtual bool parse_args(const char **text);
  virtual int process_option(Instance *instance, Named_value *option);
@@ -324,6 +336,10 @@ class Set_option : public Abstract_option_cmd

class Unset_option: public Abstract_option_cmd
{
public:
  Unset_option()
  { }

protected:
  virtual bool parse_args(const char **text);
  virtual int process_option(Instance *instance, Named_value *option);
@@ -341,6 +357,10 @@ class Unset_option: public Abstract_option_cmd

class Syntax_error : public Command
{
public:
  Syntax_error()
  { }

public:
  int execute(st_net *net, ulong connection_id);
};
+1 −1
Original line number Diff line number Diff line
@@ -429,7 +429,7 @@ void Instance::set_crash_flag_n_wake_all()


Instance::Instance(Thread_registry &thread_registry_arg):
  crashed(FALSE), configured(FALSE), thread_registry(thread_registry_arg)
  thread_registry(thread_registry_arg), crashed(FALSE), configured(FALSE)
{
  pthread_mutex_init(&LOCK_instance, 0);
  pthread_cond_init(&COND_instance_stopped, 0);
+3 −3
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ class Mysql_connection_thread: public Mysql_connection_thread_args
  int check_connection();
  int do_command();
  int dispatch_command(enum enum_server_command command,
                       const char *text, uint len);
                       const char *text);
};


@@ -317,12 +317,12 @@ int Mysql_connection_thread::do_command()
                                      (uchar) *packet;
    log_info("connection %d: packet_length=%d, command=%d",
             (int) connection_id, (int) packet_length, (int) command);
    return dispatch_command(command, packet + 1, packet_length - 1);
    return dispatch_command(command, packet + 1);
  }
}

int Mysql_connection_thread::dispatch_command(enum enum_server_command command,
                                              const char *packet, uint len)
                                              const char *packet)
{
  switch (command) {
  case COM_QUIT:                                // client exit
Loading