mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Polishing: generate more warnings and make code warnings-free.
This commit is contained in:
@ -61,7 +61,7 @@ client_settings.h:
|
|||||||
|
|
||||||
libexec_PROGRAMS= mysqlmanager
|
libexec_PROGRAMS= mysqlmanager
|
||||||
|
|
||||||
mysqlmanager_CXXFLAGS= -Werror
|
mysqlmanager_CXXFLAGS= -Wall -Wextra -Werror
|
||||||
|
|
||||||
mysqlmanager_SOURCES= command.cc command.h mysqlmanager.cc \
|
mysqlmanager_SOURCES= command.cc command.h mysqlmanager.cc \
|
||||||
manager.h manager.cc log.h log.cc \
|
manager.h manager.cc log.h log.cc \
|
||||||
|
@ -130,7 +130,7 @@ Instance_name::Instance_name(const LEX_STRING *name)
|
|||||||
ER_OUT_OF_RESOURCES Not enough resources to complete the operation
|
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;
|
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))
|
if (send_eof(net) || net_flush(net))
|
||||||
return ER_OUT_OF_RESOURCES;
|
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))
|
if (send_eof(net) || net_flush(net))
|
||||||
return ER_OUT_OF_RESOURCES;
|
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
|
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;
|
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
|
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;
|
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
|
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;
|
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))
|
if (send_eof(net) || net_flush(net))
|
||||||
return ER_OUT_OF_RESOURCES;
|
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))
|
if (send_eof(net) || net_flush(net))
|
||||||
return ER_OUT_OF_RESOURCES;
|
return ER_OUT_OF_RESOURCES;
|
||||||
@ -1689,7 +1693,7 @@ int Unset_option::process_option(Instance *instance, Named_value *option)
|
|||||||
Implementation of Syntax_error.
|
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;
|
return ER_SYNTAX_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,10 @@
|
|||||||
|
|
||||||
class Show_instances : public Command
|
class Show_instances : public Command
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
Show_instances()
|
||||||
|
{ }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int execute(st_net *net, ulong connection_id);
|
int execute(st_net *net, ulong connection_id);
|
||||||
|
|
||||||
@ -53,6 +57,10 @@ private:
|
|||||||
|
|
||||||
class Flush_instances : public Command
|
class Flush_instances : public Command
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
Flush_instances()
|
||||||
|
{ }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int execute(st_net *net, ulong connection_id);
|
int execute(st_net *net, ulong connection_id);
|
||||||
};
|
};
|
||||||
@ -311,6 +319,10 @@ private:
|
|||||||
|
|
||||||
class Set_option : public Abstract_option_cmd
|
class Set_option : public Abstract_option_cmd
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
Set_option()
|
||||||
|
{ }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool parse_args(const char **text);
|
virtual bool parse_args(const char **text);
|
||||||
virtual int process_option(Instance *instance, Named_value *option);
|
virtual int process_option(Instance *instance, Named_value *option);
|
||||||
@ -324,6 +336,10 @@ protected:
|
|||||||
|
|
||||||
class Unset_option: public Abstract_option_cmd
|
class Unset_option: public Abstract_option_cmd
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
Unset_option()
|
||||||
|
{ }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool parse_args(const char **text);
|
virtual bool parse_args(const char **text);
|
||||||
virtual int process_option(Instance *instance, Named_value *option);
|
virtual int process_option(Instance *instance, Named_value *option);
|
||||||
@ -341,6 +357,10 @@ protected:
|
|||||||
|
|
||||||
class Syntax_error : public Command
|
class Syntax_error : public Command
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
Syntax_error()
|
||||||
|
{ }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int execute(st_net *net, ulong connection_id);
|
int execute(st_net *net, ulong connection_id);
|
||||||
};
|
};
|
||||||
|
@ -429,7 +429,7 @@ void Instance::set_crash_flag_n_wake_all()
|
|||||||
|
|
||||||
|
|
||||||
Instance::Instance(Thread_registry &thread_registry_arg):
|
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_mutex_init(&LOCK_instance, 0);
|
||||||
pthread_cond_init(&COND_instance_stopped, 0);
|
pthread_cond_init(&COND_instance_stopped, 0);
|
||||||
|
@ -86,7 +86,7 @@ private:
|
|||||||
int check_connection();
|
int check_connection();
|
||||||
int do_command();
|
int do_command();
|
||||||
int dispatch_command(enum enum_server_command 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;
|
(uchar) *packet;
|
||||||
log_info("connection %d: packet_length=%d, command=%d",
|
log_info("connection %d: packet_length=%d, command=%d",
|
||||||
(int) connection_id, (int) packet_length, (int) command);
|
(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,
|
int Mysql_connection_thread::dispatch_command(enum enum_server_command command,
|
||||||
const char *packet, uint len)
|
const char *packet)
|
||||||
{
|
{
|
||||||
switch (command) {
|
switch (command) {
|
||||||
case COM_QUIT: // client exit
|
case COM_QUIT: // client exit
|
||||||
|
@ -274,7 +274,6 @@ Command *parse_command(const char *text)
|
|||||||
uint word_len;
|
uint word_len;
|
||||||
LEX_STRING instance_name;
|
LEX_STRING instance_name;
|
||||||
Command *command= 0;
|
Command *command= 0;
|
||||||
const char *saved_text= text;
|
|
||||||
|
|
||||||
Token tok1= shift_token(&text, &word_len);
|
Token tok1= shift_token(&text, &word_len);
|
||||||
|
|
||||||
|
@ -186,7 +186,6 @@ int User_map::load(const char *password_file_name, const char **err_msg)
|
|||||||
2 + /* for newline */
|
2 + /* for newline */
|
||||||
1]; /* for trailing zero */
|
1]; /* for trailing zero */
|
||||||
User *user;
|
User *user;
|
||||||
int rc= 1;
|
|
||||||
|
|
||||||
if (my_access(password_file_name, F_OK) != 0)
|
if (my_access(password_file_name, F_OK) != 0)
|
||||||
{
|
{
|
||||||
|
@ -60,7 +60,7 @@ public:
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Iterator(User_map *user_map_arg) :
|
Iterator(User_map *user_map_arg) :
|
||||||
cur_idx(0), user_map(user_map_arg)
|
user_map(user_map_arg), cur_idx(0)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Reference in New Issue
Block a user