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)
This commit is contained in:
parent
99b572b9eb
commit
ca99516cc7
@ -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
|
||||
|
@ -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,16 +2595,18 @@ sub do_before_run_mysqltest($)
|
||||
}
|
||||
|
||||
|
||||
# MASV cleanup...
|
||||
mtr_tonewfile($path_current_test_log,"$tname\n"); # Always tell where we are
|
||||
|
||||
# output current test to ndbcluster log file to enable diagnostics
|
||||
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 (!$opt_extern)
|
||||
{
|
||||
mtr_tofile($master->[1]->{'path_myerr'},"CURRENT_TEST: $tname\n");
|
||||
# MASV cleanup...
|
||||
mtr_tonewfile($path_current_test_log,"$tname\n"); # Always tell where we are
|
||||
|
||||
# output current test to ndbcluster log file to enable diagnostics
|
||||
mtr_tofile($file_ndb_testrun_log,"CURRENT TEST $tname\n");
|
||||
|
||||
mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n");
|
||||
if ( $master->[1]->{'pid'} ) {
|
||||
mtr_tofile($master->[1]->{'path_myerr'},"CURRENT_TEST: $tname\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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. */
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -150,9 +150,12 @@ mysql_tzinfo_to_sql.o: $(mysql_tzinfo_to_sql_SOURCES)
|
||||
# things like different grammars for different pars of MySQL can
|
||||
# happen if you are unlucky.
|
||||
sql_yacc.cc: sql_yacc.yy
|
||||
|
||||
sql_yacc.h: sql_yacc.yy
|
||||
|
||||
sql_yacc.o: sql_yacc.cc sql_yacc.h $(HEADERS)
|
||||
@SED@ -e 's/__attribute__ ((__unused__))//' sql_yacc.cc > sql_yacc.cc-new
|
||||
@MV@ sql_yacc.cc-new sql_yacc.cc
|
||||
@echo "Note: The following compile may take a long time."
|
||||
@echo "If it fails, re-run configure with --with-low-memory"
|
||||
$(CXXCOMPILE) $(LM_CFLAGS) -c $<
|
||||
|
@ -6488,7 +6488,7 @@ static int ndbcluster_init(void *p)
|
||||
}
|
||||
{
|
||||
char buf[128];
|
||||
my_snprintf(buf, sizeof(buf), "mysqld --server-id=%d", server_id);
|
||||
my_snprintf(buf, sizeof(buf), "mysqld --server-id=%lu", server_id);
|
||||
g_ndb_cluster_connection->set_name(buf);
|
||||
}
|
||||
g_ndb_cluster_connection->set_optimized_node_selection
|
||||
@ -7245,7 +7245,7 @@ int handle_trailing_share(NDB_SHARE *share)
|
||||
share->key_length= min_key_length;
|
||||
}
|
||||
share->key_length=
|
||||
my_snprintf(share->key, min_key_length + 1, "#leak%d",
|
||||
my_snprintf(share->key, min_key_length + 1, "#leak%lu",
|
||||
trailing_share_id++);
|
||||
}
|
||||
/* Keep it for possible the future trailing free */
|
||||
@ -9764,12 +9764,12 @@ ndbcluster_show_status(handlerton *hton, THD* thd, stat_print_fn *stat_print,
|
||||
update_status_variables(g_ndb_cluster_connection);
|
||||
buflen=
|
||||
my_snprintf(buf, sizeof(buf),
|
||||
"cluster_node_id=%u, "
|
||||
"cluster_node_id=%ld, "
|
||||
"connected_host=%s, "
|
||||
"connected_port=%u, "
|
||||
"number_of_data_nodes=%u, "
|
||||
"number_of_ready_data_nodes=%u, "
|
||||
"connect_count=%u",
|
||||
"connected_port=%ld, "
|
||||
"number_of_data_nodes=%ld, "
|
||||
"number_of_ready_data_nodes=%ld, "
|
||||
"connect_count=%ld",
|
||||
ndb_cluster_node_id,
|
||||
ndb_connected_host,
|
||||
ndb_connected_port,
|
||||
@ -10691,7 +10691,8 @@ static int ndbcluster_fill_files_table(handlerton *hton,
|
||||
table->field[c++]->store("NORMAL", 6, system_charset_info);
|
||||
|
||||
char extra[100];
|
||||
int len= my_snprintf(extra,sizeof(extra),"CLUSTER_NODE=%u;UNDO_BUFFER_SIZE=%lu",id,lfg.getUndoBufferSize());
|
||||
int len= my_snprintf(extra,sizeof(extra),"CLUSTER_NODE=%u;UNDO_BUFFER_SIZE=%lu",
|
||||
id, (ulong) lfg.getUndoBufferSize());
|
||||
table->field[c]->set_notnull();
|
||||
table->field[c]->store(extra, len, system_charset_info);
|
||||
schema_table_store_record(thd, table);
|
||||
@ -10708,7 +10709,6 @@ static int ndbcluster_fill_files_table(handlerton *hton,
|
||||
for (i= 0; i < lfglist.count; i++)
|
||||
{
|
||||
NdbDictionary::Dictionary::List::Element& elt= lfglist.elements[i];
|
||||
unsigned id;
|
||||
|
||||
NdbDictionary::LogfileGroup lfg= dict->getLogfileGroup(elt.name);
|
||||
ndberr= dict->getNdbError();
|
||||
@ -10779,7 +10779,8 @@ static int ndbcluster_fill_files_table(handlerton *hton,
|
||||
table->field[c++]->store("NORMAL", 6, system_charset_info);
|
||||
|
||||
char extra[100];
|
||||
int len= my_snprintf(extra,sizeof(extra),"UNDO_BUFFER_SIZE=%lu",id,lfg.getUndoBufferSize());
|
||||
int len= my_snprintf(extra, sizeof(extra), "UNDO_BUFFER_SIZE=%lu",
|
||||
(ulong) lfg.getUndoBufferSize());
|
||||
table->field[c]->set_notnull();
|
||||
table->field[c]->store(extra, len, system_charset_info);
|
||||
schema_table_store_record(thd, table);
|
||||
|
@ -3907,7 +3907,7 @@ err:
|
||||
close_thread_tables(thd);
|
||||
pthread_mutex_lock(&injector_mutex);
|
||||
/* don't mess with the injector_ndb anymore from other threads */
|
||||
int ndb_obj_cnt= 1; // g_ndb
|
||||
uint ndb_obj_cnt= 1; // g_ndb
|
||||
ndb_obj_cnt+= injector_ndb == 0 ? 0 : 1;
|
||||
ndb_obj_cnt+= schema_ndb == 0 ? 0 : 1;
|
||||
ndb_obj_cnt+= ndbcluster_util_inited ? 1 : 0;
|
||||
@ -3930,7 +3930,8 @@ err:
|
||||
* otherwise user thread can have ongoing SUB_DATA
|
||||
*/
|
||||
int sleep_cnt= 0;
|
||||
while (sleep_cnt < 300 && g_ndb_cluster_connection->get_active_ndb_objects() > ndb_obj_cnt)
|
||||
while (sleep_cnt < 300 &&
|
||||
g_ndb_cluster_connection->get_active_ndb_objects() > ndb_obj_cnt)
|
||||
{
|
||||
my_sleep(10000); // 10ms
|
||||
sleep_cnt++;
|
||||
|
@ -2947,15 +2947,15 @@ static my_bool binlog_func_list(THD *thd, st_plugin_int *plugin, void *arg)
|
||||
|
||||
static my_bool binlog_func_foreach(THD *thd, binlog_func_st *bfn)
|
||||
{
|
||||
handlerton *hton;
|
||||
hton_list_st hton_list;
|
||||
uint i, sz;
|
||||
|
||||
hton_list.sz= 0;
|
||||
plugin_foreach(thd, binlog_func_list,
|
||||
MYSQL_STORAGE_ENGINE_PLUGIN, &hton_list);
|
||||
|
||||
uint i= 0, sz= hton_list.sz;
|
||||
while(i < sz)
|
||||
hton_list.hton[i++]->binlog_func(hton, thd, bfn->fn, bfn->arg);
|
||||
for (i= 0, sz= hton_list.sz; i < sz ; i++)
|
||||
hton_list.hton[i]->binlog_func(hton_list.hton[i], thd, bfn->fn, bfn->arg);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -275,6 +275,9 @@ static bool convert_constant_item(THD *thd, Field *field, Item **item)
|
||||
my_bitmap_map *old_write_map;
|
||||
my_bitmap_map *old_read_map;
|
||||
|
||||
LINT_INIT(old_write_map);
|
||||
LINT_INIT(old_read_map);
|
||||
|
||||
if (table)
|
||||
{
|
||||
old_write_map= dbug_tmp_use_all_columns(table, table->write_set);
|
||||
|
@ -1249,6 +1249,11 @@ bool get_interval_value(Item *args,interval_type int_type,
|
||||
interval->second= array[0];
|
||||
interval->second_part= array[1];
|
||||
break;
|
||||
/* purecov: begin deadcode */
|
||||
case INTERVAL_LAST:
|
||||
DBUG_ASSERT(0);
|
||||
break;
|
||||
/* purecov: end */
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -2088,6 +2093,7 @@ void Item_extract::fix_length_and_dec()
|
||||
case INTERVAL_HOUR_MICROSECOND: max_length=13; date_value=0; break;
|
||||
case INTERVAL_MINUTE_MICROSECOND: max_length=11; date_value=0; break;
|
||||
case INTERVAL_SECOND_MICROSECOND: max_length=9; date_value=0; break;
|
||||
case INTERVAL_LAST: DBUG_ASSERT(0); break; /* purecov: deadcode */
|
||||
}
|
||||
}
|
||||
|
||||
@ -2157,6 +2163,8 @@ longlong Item_extract::val_int()
|
||||
ltime.second_part)*neg;
|
||||
case INTERVAL_SECOND_MICROSECOND: return ((longlong)ltime.second*1000000L+
|
||||
ltime.second_part)*neg;
|
||||
case INTERVAL_LAST: DBUG_ASSERT(0); return(0); /* purecov: deadcode */
|
||||
/* purecov: end */
|
||||
}
|
||||
return 0; // Impossible
|
||||
}
|
||||
@ -2271,7 +2279,7 @@ String *Item_char_typecast::val_str(String *str)
|
||||
{ // Safe even if const arg
|
||||
char char_type[40];
|
||||
my_snprintf(char_type, sizeof(char_type), "%s(%lu)",
|
||||
cast_cs == &my_charset_bin ? "BINARY" : "CHAR", length);
|
||||
cast_cs == &my_charset_bin ? "BINARY" : "CHAR", (ulong) length);
|
||||
|
||||
if (!res->alloced_length())
|
||||
{ // Don't change const str
|
||||
|
@ -2010,7 +2010,7 @@ bool MYSQL_QUERY_LOG::write(time_t event_time, const char *user_host,
|
||||
goto err;
|
||||
|
||||
/* command_type, thread_id */
|
||||
length= my_snprintf(buff, 32, "%5ld ", thread_id);
|
||||
length= my_snprintf(buff, 32, "%5ld ", (long) thread_id);
|
||||
|
||||
if (my_b_write(&log_file, (byte*) buff, length))
|
||||
goto err;
|
||||
|
@ -1609,7 +1609,7 @@ static void network_init(void)
|
||||
|
||||
if (strlen(mysqld_unix_port) > (sizeof(UNIXaddr.sun_path) - 1))
|
||||
{
|
||||
sql_print_error("The socket file path is too long (> %lu): %s",
|
||||
sql_print_error("The socket file path is too long (> %u): %s",
|
||||
sizeof(UNIXaddr.sun_path) - 1, mysqld_unix_port);
|
||||
unireg_abort(1);
|
||||
}
|
||||
@ -3506,7 +3506,7 @@ int main(int argc, char **argv)
|
||||
{
|
||||
if (global_system_variables.log_warnings)
|
||||
sql_print_warning("Asked for %ld thread stack, but got %ld",
|
||||
thread_stack, stack_size);
|
||||
thread_stack, (long) stack_size);
|
||||
#if defined(__ia64__) || defined(__ia64)
|
||||
thread_stack= stack_size*2;
|
||||
#else
|
||||
@ -5316,7 +5316,7 @@ master-ssl",
|
||||
(gptr*) &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"merge", OPT_MERGE, "Enable Merge storage engine. Disable with \
|
||||
--skip-merge.",
|
||||
(gptr*) &opt_merge, (gptr*) &opt_merge, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0},
|
||||
(gptr*) &opt_merge, (gptr*) &opt_merge, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
{"myisam-recover", OPT_MYISAM_RECOVER,
|
||||
"Syntax: myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP, FORCE or QUICK.",
|
||||
(gptr*) &myisam_recover_options_str, (gptr*) &myisam_recover_options_str, 0,
|
||||
|
@ -485,6 +485,8 @@ bool partition_info::check_range_constants()
|
||||
DBUG_ENTER("partition_info::check_range_constants");
|
||||
DBUG_PRINT("enter", ("INT_RESULT with %d parts", no_parts));
|
||||
|
||||
LINT_INIT(current_largest);
|
||||
|
||||
part_result_type= INT_RESULT;
|
||||
range_int_array= (longlong*)sql_alloc(no_parts * sizeof(longlong));
|
||||
if (unlikely(range_int_array == NULL))
|
||||
@ -877,7 +879,6 @@ void partition_info::print_no_partition_found(TABLE *table)
|
||||
bool partition_info::set_up_charset_field_preps()
|
||||
{
|
||||
Field *field, **ptr;
|
||||
char *field_buf;
|
||||
char **char_ptrs;
|
||||
unsigned i;
|
||||
bool found;
|
||||
@ -919,6 +920,7 @@ bool partition_info::set_up_charset_field_preps()
|
||||
{
|
||||
if (field_is_partition_charset(field))
|
||||
{
|
||||
char *field_buf;
|
||||
CHARSET_INFO *cs= ((Field_str*)field)->charset();
|
||||
size= field->pack_length();
|
||||
if (!(field_buf= sql_calloc(size)))
|
||||
@ -956,6 +958,8 @@ bool partition_info::set_up_charset_field_preps()
|
||||
unsigned j= 0;
|
||||
Field *part_field;
|
||||
CHARSET_INFO *cs;
|
||||
char *field_buf;
|
||||
LINT_INIT(field_buf);
|
||||
|
||||
if (!field_is_partition_charset(field))
|
||||
continue;
|
||||
|
@ -79,6 +79,7 @@ void net_send_error(THD *thd, uint sql_errno, const char *err)
|
||||
if (net && net->no_send_error)
|
||||
{
|
||||
thd->clear_error();
|
||||
thd->is_fatal_error= 0; // Error message is given
|
||||
DBUG_PRINT("info", ("sending error messages prohibited"));
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
@ -111,7 +112,7 @@ void net_send_error(THD *thd, uint sql_errno, const char *err)
|
||||
|
||||
net_send_error_packet(thd, sql_errno, err);
|
||||
|
||||
thd->is_fatal_error=0; // Error message is given
|
||||
thd->is_fatal_error= 0; // Error message is given
|
||||
thd->net.report_error= 0;
|
||||
|
||||
/* Abort multi-result sets */
|
||||
@ -156,6 +157,7 @@ net_printf_error(THD *thd, uint errcode, ...)
|
||||
if (net && net->no_send_error)
|
||||
{
|
||||
thd->clear_error();
|
||||
thd->is_fatal_error= 0; // Error message is given
|
||||
DBUG_PRINT("info", ("sending error messages prohibited"));
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
@ -1143,6 +1143,7 @@ sp_head::execute(THD *thd)
|
||||
ctx->clear_handler();
|
||||
ctx->enter_handler(hip);
|
||||
thd->clear_error();
|
||||
thd->is_fatal_error= 0;
|
||||
thd->killed= THD::NOT_KILLED;
|
||||
continue;
|
||||
}
|
||||
@ -1170,8 +1171,9 @@ sp_head::execute(THD *thd)
|
||||
state= EXECUTED;
|
||||
|
||||
done:
|
||||
DBUG_PRINT("info", ("err_status: %d killed: %d query_error: %d",
|
||||
err_status, thd->killed, thd->query_error));
|
||||
DBUG_PRINT("info", ("err_status: %d killed: %d query_error: %d report_error: %d",
|
||||
err_status, thd->killed, thd->query_error,
|
||||
thd->net.report_error));
|
||||
|
||||
if (thd->killed)
|
||||
err_status= TRUE;
|
||||
@ -2375,6 +2377,7 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp,
|
||||
bool open_tables, sp_instr* instr)
|
||||
{
|
||||
int res= 0;
|
||||
DBUG_ENTER("reset_lex_and_exec_core");
|
||||
|
||||
DBUG_ASSERT(!thd->derived_tables);
|
||||
DBUG_ASSERT(thd->change_list.is_empty());
|
||||
@ -2419,7 +2422,10 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp,
|
||||
res= -1;
|
||||
|
||||
if (!res)
|
||||
{
|
||||
res= instr->exec_core(thd, nextp);
|
||||
DBUG_PRINT("info",("exec_core returned: %d", res));
|
||||
}
|
||||
|
||||
m_lex->unit.cleanup();
|
||||
|
||||
@ -2457,7 +2463,7 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp,
|
||||
|
||||
cleanup_items() is called in sp_head::execute()
|
||||
*/
|
||||
return res || thd->net.report_error;
|
||||
DBUG_RETURN(res || thd->net.report_error);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6558,6 +6558,8 @@ static bool
|
||||
has_two_write_locked_tables_with_auto_increment(TABLE_LIST *tables)
|
||||
{
|
||||
char *first_table_name= NULL, *first_db;
|
||||
LINT_INIT(first_db);
|
||||
|
||||
for (TABLE_LIST *table= tables; table; table= table->next_global)
|
||||
{
|
||||
/* we must do preliminary checks as table->table may be NULL */
|
||||
|
@ -1449,10 +1449,12 @@ public:
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
inline void clear_error()
|
||||
{
|
||||
DBUG_ENTER("clear_error");
|
||||
net.last_error[0]= 0;
|
||||
net.last_errno= 0;
|
||||
net.report_error= 0;
|
||||
query_error= 0;
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
inline bool vio_ok() const { return net.vio != 0; }
|
||||
#else
|
||||
|
@ -261,6 +261,8 @@ static int check_update_fields(THD *thd, TABLE_LIST *insert_table_list,
|
||||
TABLE *table= insert_table_list->table;
|
||||
my_bool timestamp_mark;
|
||||
|
||||
LINT_INIT(timestamp_mark);
|
||||
|
||||
if (table->timestamp_field)
|
||||
{
|
||||
/*
|
||||
@ -1699,7 +1701,7 @@ static int
|
||||
write_delayed(THD *thd,TABLE *table, enum_duplicates duplic,
|
||||
LEX_STRING query, bool ignore, bool log_on)
|
||||
{
|
||||
delayed_row *row;
|
||||
delayed_row *row= 0;
|
||||
delayed_insert *di=thd->di;
|
||||
const Discrete_interval *forced_auto_inc;
|
||||
DBUG_ENTER("write_delayed");
|
||||
@ -2306,14 +2308,18 @@ bool delayed_insert::handle_inserts(void)
|
||||
DBUG_RETURN(0);
|
||||
|
||||
err:
|
||||
DBUG_EXECUTE("error", max_rows= 0;);
|
||||
#ifndef DBUG_OFF
|
||||
max_rows= 0; // For DBUG output
|
||||
#endif
|
||||
/* Remove all not used rows */
|
||||
while ((row=rows.get()))
|
||||
{
|
||||
delete row;
|
||||
thread_safe_increment(delayed_insert_errors,&LOCK_delayed_status);
|
||||
stacked_inserts--;
|
||||
DBUG_EXECUTE("error", max_rows++;);
|
||||
#ifndef DBUG_OFF
|
||||
max_rows++;
|
||||
#endif
|
||||
}
|
||||
DBUG_PRINT("error", ("dropped %lu rows after an error", max_rows));
|
||||
thread_safe_increment(delayed_insert_errors, &LOCK_delayed_status);
|
||||
|
@ -4633,7 +4633,10 @@ end_with_restore_list:
|
||||
send_ok(thd, (ulong) (thd->row_count_func < 0 ? 0 :
|
||||
thd->row_count_func));
|
||||
else
|
||||
{
|
||||
DBUG_ASSERT(thd->net.report_error == 1 || thd->killed);
|
||||
goto error; // Substatement should already have sent error
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -4918,7 +4921,7 @@ end_with_restore_list:
|
||||
LEX_STRING *name;
|
||||
int i;
|
||||
|
||||
for (i= 0; name= names++; i++)
|
||||
for (i= 0; (name= names++); i++)
|
||||
{
|
||||
buff.append(i ? ", " : "(");
|
||||
append_identifier(thd, &buff, name->str, name->length);
|
||||
|
@ -502,7 +502,7 @@ void plugin_deinitialize(struct st_plugin_int *plugin)
|
||||
if ((*plugin_type_deinitialize[plugin->plugin->type])(plugin))
|
||||
{
|
||||
sql_print_error("Plugin '%s' of type %s failed deinitialization",
|
||||
plugin->name.str, plugin_type_names[plugin->plugin->type]);
|
||||
plugin->name.str, plugin_type_names[plugin->plugin->type].str);
|
||||
}
|
||||
}
|
||||
else if (plugin->plugin->deinit)
|
||||
@ -562,7 +562,7 @@ static int plugin_initialize(struct st_plugin_int *plugin)
|
||||
if ((*plugin_type_initialize[plugin->plugin->type])(plugin))
|
||||
{
|
||||
sql_print_error("Plugin '%s' registration as a %s failed.",
|
||||
plugin->name.str, plugin_type_names[plugin->plugin->type]);
|
||||
plugin->name.str, plugin_type_names[plugin->plugin->type].str);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
@ -3598,7 +3598,7 @@ best_access_path(JOIN *join,
|
||||
double best= DBL_MAX;
|
||||
double best_time= DBL_MAX;
|
||||
double records= DBL_MAX;
|
||||
table_map best_ref_depends_map;
|
||||
table_map best_ref_depends_map= 0;
|
||||
double tmp;
|
||||
ha_rows rec;
|
||||
|
||||
@ -10099,7 +10099,8 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
|
||||
enum_nested_loop_state error= NESTED_LOOP_OK;
|
||||
JOIN_TAB *join_tab;
|
||||
DBUG_ENTER("do_select");
|
||||
|
||||
LINT_INIT(join_tab);
|
||||
|
||||
join->procedure=procedure;
|
||||
join->tmp_table= table; /* Save for easy recursion */
|
||||
join->fields= fields;
|
||||
@ -10129,9 +10130,9 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
|
||||
*/
|
||||
if (!join->conds || join->conds->val_int())
|
||||
{
|
||||
error= (*end_select)(join,join_tab,0);
|
||||
error= (*end_select)(join, 0, 0);
|
||||
if (error == NESTED_LOOP_OK || error == NESTED_LOOP_QUERY_LIMIT)
|
||||
error= (*end_select)(join,join_tab,1);
|
||||
error= (*end_select)(join, 0, 1);
|
||||
}
|
||||
else if (join->send_row_on_empty_set())
|
||||
{
|
||||
@ -10687,7 +10688,7 @@ int report_error(TABLE *table, int error)
|
||||
*/
|
||||
if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT)
|
||||
sql_print_error("Got error %d when reading table '%s'",
|
||||
error, table->s->path);
|
||||
error, table->s->path.str);
|
||||
table->file->print_error(error,MYF(0));
|
||||
return 1;
|
||||
}
|
||||
|
@ -1073,6 +1073,8 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
|
||||
bool view_is_mergeable= (table->algorithm != VIEW_ALGORITHM_TMPTABLE &&
|
||||
lex->can_be_merged());
|
||||
TABLE_LIST *view_main_select_tables;
|
||||
LINT_INIT(view_main_select_tables);
|
||||
|
||||
if (view_is_mergeable)
|
||||
{
|
||||
/*
|
||||
|
@ -480,7 +480,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
|
||||
sql_print_warning("'%s' had no or invalid character set, "
|
||||
"and default character set is multi-byte, "
|
||||
"so character column sizes may have changed",
|
||||
share->path);
|
||||
share->path.str);
|
||||
}
|
||||
share->table_charset= default_charset_info;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user