1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

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)
This commit is contained in:
unknown
2006-11-01 19:41:09 +02:00
parent 9852dfbcf5
commit 07d8be4544
28 changed files with 127 additions and 77 deletions

View File

@ -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. */

View File

@ -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;
}
}

View File

@ -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();
}

View File

@ -182,7 +182,7 @@ int Instance_options::fill_instance_version()
err:
if (rc)
log_error("fill_instance_version: Failed to get version of '%s'",
mysqld_path);
mysqld_path.str);
return rc;
}

View File

@ -165,7 +165,7 @@ Mysql_connection_thread::~Mysql_connection_thread()
void Mysql_connection_thread::run()
{
log_info("accepted mysql connection %d", connection_id);
log_info("accepted mysql connection %lu", connection_id);
my_thread_init();
@ -175,7 +175,7 @@ void Mysql_connection_thread::run()
return;
}
log_info("connection %d is checked successfully", connection_id);
log_info("connection %lu is checked successfully", connection_id);
vio_keepalive(vio, TRUE);
@ -314,7 +314,7 @@ int Mysql_connection_thread::do_command()
packet= (char*) net.read_pos;
enum enum_server_command command= (enum enum_server_command)
(uchar) *packet;
log_info("connection %d: packet_length=%d, command=%d",
log_info("connection %lu: packet_length=%lu, command=%d",
connection_id, packet_length, command);
return dispatch_command(command, packet + 1, packet_length - 1);
}
@ -325,27 +325,27 @@ int Mysql_connection_thread::dispatch_command(enum enum_server_command command,
{
switch (command) {
case COM_QUIT: // client exit
log_info("query for connection %d received quit command", connection_id);
log_info("query for connection %lu received quit command", connection_id);
return 1;
case COM_PING:
log_info("query for connection %d received ping command", connection_id);
log_info("query for connection %lu received ping command", connection_id);
net_send_ok(&net, connection_id, NULL);
break;
case COM_QUERY:
{
log_info("query for connection %d : ----\n%s\n-------------------------",
log_info("query for connection %lu : ----\n%s\n-------------------------",
connection_id,packet);
if (Command *command= parse_command(&instance_map, packet))
{
int res= 0;
log_info("query for connection %d successfully parsed",connection_id);
log_info("query for connection %lu successfully parsed",connection_id);
res= command->execute(&net, connection_id);
delete command;
if (!res)
log_info("query for connection %d executed ok",connection_id);
log_info("query for connection %lu executed ok",connection_id);
else
{
log_info("query for connection %d executed err=%d",connection_id,res);
log_info("query for connection %lu executed err=%d",connection_id,res);
net_send_error(&net, res);
return 0;
}
@ -358,7 +358,7 @@ int Mysql_connection_thread::dispatch_command(enum enum_server_command command,
break;
}
default:
log_info("query for connection %d received unknown command",connection_id);
log_info("query for connection %lu received unknown command",connection_id);
net_send_error(&net, ER_UNKNOWN_COM_ERROR);
break;
}

View File

@ -273,7 +273,7 @@ Command *parse_command(Instance_map *map, const char *text)
{
uint word_len;
LEX_STRING instance_name;
Command *command;
Command *command= 0;
const char *saved_text= text;
Token tok1= shift_token(&text, &word_len);

View File

@ -74,11 +74,10 @@ int User::init(const char *line)
password_length= strlen(password);
if (password_length > SCRAMBLED_PASSWORD_CHAR_LENGTH)
{
log_info("Error: password is too long (%d). Max length: %d. ",
"User line: '%s'.",
(int) password_length,
(int) SCRAMBLED_PASSWORD_CHAR_LENGTH,
(const char *) line);
log_info("Error: password is too long (%d). Max length: %d. User line: '%s'.",
(int) password_length,
(int) SCRAMBLED_PASSWORD_CHAR_LENGTH,
line);
return 1;
}