maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #02795
[Branch ~maria-captains/maria/5.1] Rev 2836: Removed compiler warning
------------------------------------------------------------
revno: 2836
committer: Michael Widenius <monty@xxxxxxxxxxxx>
branch nick: maria-5.1
timestamp: Tue 2010-03-30 15:36:49 +0300
message:
Removed compiler warning
Disable pbxt for test cases not using pbxt (speeds up test suite)
added:
mysql-test/suite/pbxt/t/suite.opt
modified:
extra/comp_err.c
extra/libevent/kqueue.c
mysql-test/lib/mtr_cases.pm
mysys/mf_keycache.c
mysys/my_gethostbyname.c
sql/handler.cc
sql/item.h
sql/mysqld.cc
sql/sql_class.h
sql/sql_table.cc
sql/sql_view.cc
storage/maria/ma_loghandler.c
storage/myisammrg/ha_myisammrg.cc
storage/myisammrg/myrg_open.c
storage/xtradb/include/ut0lst.h
strings/ctype-ucs2.c
strings/ctype-utf8.c
support-files/compiler_warnings.supp
unittest/mysys/waiting_threads-t.c
--
lp:maria
https://code.launchpad.net/~maria-captains/maria/5.1
Your team Maria developers is subscribed to branch lp:maria.
To unsubscribe from this branch go to https://code.launchpad.net/~maria-captains/maria/5.1/+edit-subscription.
=== modified file 'extra/comp_err.c'
--- extra/comp_err.c 2009-11-20 10:11:31 +0000
+++ extra/comp_err.c 2010-03-30 12:36:49 +0000
@@ -660,7 +660,7 @@
case 'u':
case 'x':
case 's':
- chksum= my_checksum(chksum, start, (uint) (p + 1 - start));
+ chksum= my_checksum(chksum, (uchar*) start, (uint) (p + 1 - start));
start= 0; /* Not in format specifier anymore */
break;
=== modified file 'extra/libevent/kqueue.c'
--- extra/libevent/kqueue.c 2009-03-12 22:27:35 +0000
+++ extra/libevent/kqueue.c 2010-03-30 12:36:49 +0000
@@ -144,7 +144,7 @@
*/
if (kevent(kq,
kqueueop->changes, 1, kqueueop->events, NEVENT, NULL) != 1 ||
- kqueueop->events[0].ident != -1 ||
+ ((int) kqueueop->events[0].ident) != -1 ||
kqueueop->events[0].flags != EV_ERROR) {
event_warn("%s: detected broken kqueue; not using.", __func__);
free(kqueueop->changes);
=== modified file 'mysql-test/lib/mtr_cases.pm'
--- mysql-test/lib/mtr_cases.pm 2010-01-15 15:27:55 +0000
+++ mysql-test/lib/mtr_cases.pm 2010-03-30 12:36:49 +0000
@@ -681,6 +681,8 @@
if ( $default_engine =~ /^ndb/i );
$tinfo->{'innodb_test'}= 1
if ( $default_engine =~ /^innodb/i );
+ $tinfo->{'pbxt_test'}= 1
+ if ( $default_engine =~ /^pbxt/i );
}
}
@@ -778,6 +780,8 @@
my $disabled= shift;
my $suite_opts= shift;
+ my $local_default_storage_engine= $default_storage_engine;
+
#print "collect_one_test_case\n";
#print " suitedir: $suitedir\n";
#print " testdir: $testdir\n";
@@ -932,15 +936,26 @@
tags_from_test_file($tinfo,"$testdir/${tname}.test");
- if ( defined $default_storage_engine )
+ # Get default storage engine from suite.opt file
+
+ if (defined $suite_opts &&
+ "@$suite_opts" =~ "default-storage-engine=\s*([^\s]*)")
+ {
+ $local_default_storage_engine= $1;
+ }
+
+ if ( defined $local_default_storage_engine )
{
# Different default engine is used
# tag test to require that engine
$tinfo->{'ndb_test'}= 1
- if ( $default_storage_engine =~ /^ndb/i );
+ if ( $local_default_storage_engine =~ /^ndb/i );
$tinfo->{'innodb_test'}= 1
- if ( $default_storage_engine =~ /^innodb/i );
+ if ( $local_default_storage_engine =~ /^innodb/i );
+
+ $tinfo->{'pbxt_test'}= 1
+ if ( $local_default_storage_engine =~ /^pbxt/i );
}
@@ -1103,6 +1118,28 @@
$tinfo->{template_path}= $config;
}
+ if ( $tinfo->{'pbxt_test'} )
+ {
+ # This is a test that needs pbxt
+ if ( $::mysqld_variables{'pbxt'} eq "OFF" ||
+ ! exists $::mysqld_variables{'pbxt'} )
+ {
+ # Engine is not supported, skip it
+ $tinfo->{'skip'}= 1;
+ return $tinfo;
+ }
+ }
+ else
+ {
+ # Only disable engine if it's on by default (to avoid warnings about
+ # not existing loose options
+ if ( $::mysqld_variables{'pbxt'} eq "ON")
+ {
+ push(@{$tinfo->{'master_opt'}}, "--loose-skip-pbxt");
+ push(@{$tinfo->{'slave_opt'}}, "--loose-skip-pbxt");
+ }
+ }
+
if ( $tinfo->{'example_plugin_test'} )
{
if ( !$ENV{'EXAMPLE_PLUGIN'} )
@@ -1156,6 +1193,7 @@
["include/have_log_bin.inc", "need_binlog", 1],
["include/have_innodb.inc", "innodb_test", 1],
+ ["include/have_pbxt.inc", "pbxt_test", 1],
["include/big_test.inc", "big_test", 1],
["include/have_debug.inc", "need_debug", 1],
["include/have_ndb.inc", "ndb_test", 1],
=== added file 'mysql-test/suite/pbxt/t/suite.opt'
--- mysql-test/suite/pbxt/t/suite.opt 1970-01-01 00:00:00 +0000
+++ mysql-test/suite/pbxt/t/suite.opt 2010-03-30 12:36:49 +0000
@@ -0,0 +1,1 @@
+--default-storage-engine=pbxt
=== modified file 'mysys/mf_keycache.c'
--- mysys/mf_keycache.c 2009-12-03 11:19:05 +0000
+++ mysys/mf_keycache.c 2010-03-30 12:36:49 +0000
@@ -3924,6 +3924,12 @@
uint next_status;
uint hash_requests;
+ LINT_INIT(next_hash_link);
+ LINT_INIT(next_diskpos);
+ LINT_INIT(next_file);
+ LINT_INIT(next_status);
+ LINT_INIT(hash_requests);
+
total_found++;
found++;
KEYCACHE_DBUG_ASSERT(found <= keycache->blocks_used);
=== modified file 'mysys/my_gethostbyname.c'
--- mysys/my_gethostbyname.c 2006-12-31 00:32:21 +0000
+++ mysys/my_gethostbyname.c 2010-03-30 12:36:49 +0000
@@ -91,9 +91,12 @@
is finished with the structure.
*/
-struct hostent *my_gethostbyname_r(const char *name,
- struct hostent *result, char *buffer,
- int buflen, int *h_errnop)
+struct hostent *
+my_gethostbyname_r(const char *name,
+ struct hostent *result __attribute__((unused)),
+ char *buffer __attribute__((unused)),
+ int buflen__attribute__((unused)),
+ int *h_errnop)
{
struct hostent *hp;
pthread_mutex_lock(&LOCK_gethostbyname_r);
=== modified file 'sql/handler.cc'
--- sql/handler.cc 2010-03-08 13:57:32 +0000
+++ sql/handler.cc 2010-03-30 12:36:49 +0000
@@ -4129,7 +4129,7 @@
*/
int handler::read_multi_range_next(KEY_MULTI_RANGE **found_range_p)
{
- int result;
+ int result= 0;
DBUG_ENTER("handler::read_multi_range_next");
/* We should not be called after the last call returned EOF. */
=== modified file 'sql/item.h'
--- sql/item.h 2010-03-28 18:10:00 +0000
+++ sql/item.h 2010-03-30 12:36:49 +0000
@@ -1077,7 +1077,8 @@
{
public:
virtual void visit_field(Field *field)= 0;
- virtual ~Field_enumerator() {}; /* purecov: inspected */
+ virtual ~Field_enumerator() {}; /* purecov: inspected */
+ Field_enumerator() {} /* Remove gcc warning */
};
=== modified file 'sql/mysqld.cc'
--- sql/mysqld.cc 2010-03-10 09:12:23 +0000
+++ sql/mysqld.cc 2010-03-30 12:36:49 +0000
@@ -8323,6 +8323,8 @@
case (int) OPT_INIT_RPL_ROLE:
{
int role;
+ LINT_INIT(role);
+
if (!find_opt_type(argument, &rpl_role_typelib, opt->name, &role))
{
rpl_status = (role == 1) ? RPL_AUTH_MASTER : RPL_IDLE_SLAVE;
@@ -8378,6 +8380,8 @@
case OPT_BINLOG_FORMAT:
{
int id;
+ LINT_INIT(id);
+
if (!find_opt_type(argument, &binlog_format_typelib, opt->name, &id))
{
global_system_variables.binlog_format= opt_binlog_format_id= id - 1;
@@ -8628,6 +8632,8 @@
else
{
int type;
+ LINT_INIT(type);
+
if (!find_opt_type(argument, &delay_key_write_typelib, opt->name, &type))
delay_key_write_options= (uint) type-1;
}
@@ -8639,6 +8645,8 @@
case OPT_TX_ISOLATION:
{
int type;
+ LINT_INIT(type);
+
if (!find_opt_type(argument, &tx_isolation_typelib, opt->name, &type))
global_system_variables.tx_isolation= (type-1);
break;
@@ -8726,6 +8734,7 @@
ulong method_conv;
int method;
LINT_INIT(method_conv);
+ LINT_INIT(method);
myisam_stats_method_str= argument;
if (!find_opt_type(argument, &myisam_stats_method_typelib,
@@ -8788,6 +8797,7 @@
case OPT_THREAD_HANDLING:
{
int id;
+ LINT_INIT(id);
if (!find_opt_type(argument, &thread_handling_typelib, opt->name, &id))
global_system_variables.thread_handling= id - 1;
opt_thread_handling= thread_handling_typelib.type_names[global_system_variables.thread_handling];
=== modified file 'sql/sql_class.h'
--- sql/sql_class.h 2010-03-04 08:03:07 +0000
+++ sql/sql_class.h 2010-03-30 12:36:49 +0000
@@ -63,6 +63,7 @@
bool report_error(THD *thd);
bool is_invalidated() const { return m_invalidated; }
void reset_reprepare_observer() { m_invalidated= FALSE; }
+ Reprepare_observer() {} /* Remove gcc warning */
private:
bool m_invalidated;
};
@@ -1107,6 +1108,7 @@
/* Ignore error */
return TRUE;
}
+ Dummy_error_handler() {} /* Remove gcc warning */
};
=== modified file 'sql/sql_table.cc'
--- sql/sql_table.cc 2010-03-04 08:03:07 +0000
+++ sql/sql_table.cc 2010-03-30 12:36:49 +0000
@@ -5668,6 +5668,10 @@
*/
Alter_info tmp_alter_info(*alter_info, thd->mem_root);
uint db_options= 0; /* not used */
+
+ /* Set default value for return value (to ensure it's always set) */
+ *need_copy_table= ALTER_TABLE_DATA_CHANGED;
+
/* Create the prepared information. */
if (mysql_prepare_create_table(thd, create_info,
&tmp_alter_info,
@@ -5726,7 +5730,6 @@
(table->s->frm_version < FRM_VER_TRUE_VARCHAR && varchar))
{
DBUG_PRINT("info", ("Basic checks -> ALTER_TABLE_DATA_CHANGED"));
- *need_copy_table= ALTER_TABLE_DATA_CHANGED;
DBUG_RETURN(0);
}
@@ -5756,7 +5759,6 @@
{
DBUG_PRINT("info", ("NULL behaviour difference in field '%s' -> "
"ALTER_TABLE_DATA_CHANGED", new_field->field_name));
- *need_copy_table= ALTER_TABLE_DATA_CHANGED;
DBUG_RETURN(0);
}
@@ -5779,7 +5781,6 @@
{
DBUG_PRINT("info", ("!field_is_equal('%s') -> ALTER_TABLE_DATA_CHANGED",
new_field->field_name));
- *need_copy_table= ALTER_TABLE_DATA_CHANGED;
DBUG_RETURN(0);
}
// Clear indexed marker
@@ -5914,7 +5915,6 @@
{
DBUG_PRINT("info", ("check_if_incompatible_data() -> "
"ALTER_TABLE_DATA_CHANGED"));
- *need_copy_table= ALTER_TABLE_DATA_CHANGED;
DBUG_RETURN(0);
}
=== modified file 'sql/sql_view.cc'
--- sql/sql_view.cc 2010-03-04 08:03:07 +0000
+++ sql/sql_view.cc 2010-03-30 12:36:49 +0000
@@ -1034,10 +1034,12 @@
bool parse_status;
bool result, view_is_mergeable;
TABLE_LIST *UNINIT_VAR(view_main_select_tables);
-
DBUG_ENTER("mysql_make_view");
DBUG_PRINT("info", ("table: 0x%lx (%s)", (ulong) table, table->table_name));
+ LINT_INIT(parse_status);
+ LINT_INIT(view_select);
+
if (table->view)
{
/*
=== modified file 'storage/maria/ma_loghandler.c'
--- storage/maria/ma_loghandler.c 2010-03-10 10:32:14 +0000
+++ storage/maria/ma_loghandler.c 2010-03-30 12:36:49 +0000
@@ -1211,6 +1211,8 @@
for (file= from_file; file <= to_file; file++)
{
LOGHANDLER_FILE_INFO info;
+ LINT_INIT(info.max_lsn);
+
File fd= open_logfile_by_number_no_cache(file);
if ((fd < 0) ||
((translog_read_file_header(&info, fd) ||
@@ -3845,6 +3847,8 @@
if (!old_log_was_recovered && old_flags == flags)
{
LOGHANDLER_FILE_INFO info;
+ LINT_INIT(info.maria_version);
+
/*
Accessing &log_descriptor.open_files without mutex is safe
because it is initialization
=== modified file 'storage/myisammrg/ha_myisammrg.cc'
--- storage/myisammrg/ha_myisammrg.cc 2010-03-04 08:03:07 +0000
+++ storage/myisammrg/ha_myisammrg.cc 2010-03-30 12:36:49 +0000
@@ -382,7 +382,7 @@
my_errno= HA_ERR_WRONG_MRG_TABLE_DEF;
}
DBUG_PRINT("myrg", ("MyISAM handle: 0x%lx my_errno: %d",
- my_errno ? NULL : (long) myisam, my_errno));
+ my_errno ? 0L : (long) myisam, my_errno));
err:
DBUG_RETURN(my_errno ? NULL : myisam);
=== modified file 'storage/myisammrg/myrg_open.c'
--- storage/myisammrg/myrg_open.c 2009-09-23 13:21:29 +0000
+++ storage/myisammrg/myrg_open.c 2010-03-30 12:36:49 +0000
@@ -239,6 +239,7 @@
rc= 1;
errpos= 0;
bzero((char*) &file_cache, sizeof(file_cache));
+ LINT_INIT(m_info);
/* Open MERGE meta file. */
if ((fd= my_open(fn_format(parent_name_buff, parent_name, "", MYRG_NAME_EXT,
=== modified file 'storage/xtradb/include/ut0lst.h'
--- storage/xtradb/include/ut0lst.h 2009-09-07 10:22:53 +0000
+++ storage/xtradb/include/ut0lst.h 2010-03-30 12:36:49 +0000
@@ -158,7 +158,7 @@
/** Invalidate the pointers in a list node.
@param NAME list name
@param N pointer to the node that was removed */
-# define UT_LIST_REMOVE_CLEAR(NAME, N) while (0)
+# define UT_LIST_REMOVE_CLEAR(NAME, N) {} while (0)
#endif
/*******************************************************************//**
=== modified file 'strings/ctype-ucs2.c'
--- strings/ctype-ucs2.c 2010-03-04 08:03:07 +0000
+++ strings/ctype-ucs2.c 2010-03-30 12:36:49 +0000
@@ -203,7 +203,7 @@
my_bool t_is_prefix)
{
int s_res,t_res;
- my_wc_t UNINIT_VAR(s_wc),t_wc;
+ my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
const uchar *se=s+slen;
const uchar *te=t+tlen;
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
@@ -317,7 +317,7 @@
const char *s, const char *t, size_t len)
{
int s_res,t_res;
- my_wc_t UNINIT_VAR(s_wc),t_wc;
+ my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
const char *se=s+len;
const char *te=t+len;
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
@@ -1384,7 +1384,7 @@
my_bool t_is_prefix)
{
int s_res,t_res;
- my_wc_t UNINIT_VAR(s_wc),t_wc;
+ my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
const uchar *se=s+slen;
const uchar *te=t+tlen;
=== modified file 'strings/ctype-utf8.c'
--- strings/ctype-utf8.c 2009-10-15 21:38:29 +0000
+++ strings/ctype-utf8.c 2010-03-30 12:36:49 +0000
@@ -2310,7 +2310,7 @@
my_bool t_is_prefix)
{
int s_res,t_res;
- my_wc_t UNINIT_VAR(s_wc), t_wc;
+ my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
const uchar *se=s+slen;
const uchar *te=t+tlen;
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
@@ -2380,7 +2380,7 @@
my_bool diff_if_only_endspace_difference)
{
int s_res, t_res, res;
- my_wc_t UNINIT_VAR(s_wc),t_wc;
+ my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
const uchar *se= s+slen, *te= t+tlen;
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
=== modified file 'support-files/compiler_warnings.supp'
--- support-files/compiler_warnings.supp 2010-03-29 19:07:45 +0000
+++ support-files/compiler_warnings.supp 2010-03-30 12:36:49 +0000
@@ -72,6 +72,11 @@
.*: break strict-aliasing rules
#
+# Ignore not important declaration warnings
+#
+.*: only defines private constructors and has no friends
+
+#
# Ignore all conversion warnings on windows 64
# (Is safe as we are not yet supporting strings >= 2G)
#
@@ -106,6 +111,11 @@
storage/maria/ma_pagecache.c: .*'info_check_pin' defined but not used
#
+# Pbxt
+#
+xaction_xt\.cc: may be used uninitialized in this function
+
+#
# I think these are due to mix of C and C++.
#
storage/pbxt/ : typedef.*was ignored in this declaration
@@ -118,6 +128,7 @@
.*/extra/yassl/taocrypt/src/blowfish\.cpp: array subscript is above array bounds
.*/extra/yassl/taocrypt/src/file\.cpp: ignoring return value
.*/extra/yassl/taocrypt/src/integer\.cpp: control reaches end of non-void function
+mySTL/algorithm\.hpp: is used uninitialized in this function
#
# Groff warnings on OpenSUSE.
=== modified file 'unittest/mysys/waiting_threads-t.c'
--- unittest/mysys/waiting_threads-t.c 2010-01-28 14:49:14 +0000
+++ unittest/mysys/waiting_threads-t.c 2010-03-30 12:36:49 +0000
@@ -258,7 +258,7 @@
#define test_kill_strategy(X) \
diag("kill strategy: " #X); \
DBUG_EXECUTE("reset_file", \
- { rewind(DBUG_FILE); (void) ftruncate(fileno(DBUG_FILE), 0); }); \
+ { rewind(DBUG_FILE); my_chsize(fileno(DBUG_FILE), 0, 0, MYF(MY_WME)); }); \
DBUG_PRINT("info", ("kill strategy: " #X)); \
kill_strategy=X; \
do_one_test();