diff options
-rw-r--r-- | extra/comp_err.c | 2 | ||||
-rw-r--r-- | extra/libevent/kqueue.c | 2 | ||||
-rw-r--r-- | mysql-test/lib/mtr_cases.pm | 44 | ||||
-rw-r--r-- | mysql-test/suite/pbxt/t/suite.opt | 1 | ||||
-rw-r--r-- | mysys/mf_keycache.c | 6 | ||||
-rw-r--r-- | mysys/my_gethostbyname.c | 9 | ||||
-rw-r--r-- | sql/handler.cc | 2 | ||||
-rw-r--r-- | sql/item.h | 3 | ||||
-rw-r--r-- | sql/mysqld.cc | 10 | ||||
-rw-r--r-- | sql/sql_class.h | 2 | ||||
-rw-r--r-- | sql/sql_table.cc | 8 | ||||
-rw-r--r-- | sql/sql_view.cc | 4 | ||||
-rw-r--r-- | storage/maria/ma_loghandler.c | 4 | ||||
-rw-r--r-- | storage/myisammrg/ha_myisammrg.cc | 2 | ||||
-rw-r--r-- | storage/myisammrg/myrg_open.c | 1 | ||||
-rw-r--r-- | storage/xtradb/include/ut0lst.h | 2 | ||||
-rw-r--r-- | strings/ctype-ucs2.c | 6 | ||||
-rw-r--r-- | strings/ctype-utf8.c | 4 | ||||
-rw-r--r-- | support-files/compiler_warnings.supp | 11 | ||||
-rw-r--r-- | unittest/mysys/waiting_threads-t.c | 2 |
20 files changed, 102 insertions, 23 deletions
diff --git a/extra/comp_err.c b/extra/comp_err.c index 9326444ade9..bca8d3895cb 100644 --- a/extra/comp_err.c +++ b/extra/comp_err.c @@ -660,7 +660,7 @@ static ha_checksum checksum_format_specifier(const char* msg) 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; diff --git a/extra/libevent/kqueue.c b/extra/libevent/kqueue.c index 775698baa67..eec5a6ab6fb 100644 --- a/extra/libevent/kqueue.c +++ b/extra/libevent/kqueue.c @@ -144,7 +144,7 @@ kq_init(struct event_base *base) */ 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); diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index 220db3d6217..ad8a204db47 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -681,6 +681,8 @@ sub optimize_cases { 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 @@ sub collect_one_test_case { 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 @@ sub collect_one_test_case { 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 @@ sub collect_one_test_case { $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 @@ my @tags= ["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], diff --git a/mysql-test/suite/pbxt/t/suite.opt b/mysql-test/suite/pbxt/t/suite.opt new file mode 100644 index 00000000000..3036df38940 --- /dev/null +++ b/mysql-test/suite/pbxt/t/suite.opt @@ -0,0 +1 @@ +--default-storage-engine=pbxt diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 0630d194234..f7b420c3bf2 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -3924,6 +3924,12 @@ restart: 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); diff --git a/mysys/my_gethostbyname.c b/mysys/my_gethostbyname.c index 067fdfee9db..985a76faf0d 100644 --- a/mysys/my_gethostbyname.c +++ b/mysys/my_gethostbyname.c @@ -91,9 +91,12 @@ extern pthread_mutex_t LOCK_gethostbyname_r; 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); diff --git a/sql/handler.cc b/sql/handler.cc index 72c78727111..876512ed87f 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -4129,7 +4129,7 @@ int handler::read_multi_range_first(KEY_MULTI_RANGE **found_range_p, */ 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. */ diff --git a/sql/item.h b/sql/item.h index beed859a2c7..8bcfaa286c7 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1077,7 +1077,8 @@ class Field_enumerator { public: virtual void visit_field(Field *field)= 0; - virtual ~Field_enumerator() {}; /* purecov: inspected */ + virtual ~Field_enumerator() {}; /* purecov: inspected */ + Field_enumerator() {} /* Remove gcc warning */ }; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 0eeea729adc..6b5783b7e2e 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -8323,6 +8323,8 @@ mysqld_get_one_option(int optid, 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 @@ mysqld_get_one_option(int optid, 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 @@ mysqld_get_one_option(int optid, 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 @@ mysqld_get_one_option(int optid, 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 @@ mysqld_get_one_option(int optid, 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 @@ mysqld_get_one_option(int optid, 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]; diff --git a/sql/sql_class.h b/sql/sql_class.h index 841acae0bf8..aa39ddb2b15 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -63,6 +63,7 @@ public: 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 @@ public: /* Ignore error */ return TRUE; } + Dummy_error_handler() {} /* Remove gcc warning */ }; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 6d20ea0d3e5..6b7b3e2c0ab 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -5668,6 +5668,10 @@ compare_tables(TABLE *table, */ 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 @@ compare_tables(TABLE *table, (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 @@ compare_tables(TABLE *table, { 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 @@ compare_tables(TABLE *table, { 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 @@ compare_tables(TABLE *table, { DBUG_PRINT("info", ("check_if_incompatible_data() -> " "ALTER_TABLE_DATA_CHANGED")); - *need_copy_table= ALTER_TABLE_DATA_CHANGED; DBUG_RETURN(0); } diff --git a/sql/sql_view.cc b/sql/sql_view.cc index c6d412112c2..e1e0b3ff6c4 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1034,10 +1034,12 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, 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) { /* diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c index aff2b638e4e..5e316e2d776 100644 --- a/storage/maria/ma_loghandler.c +++ b/storage/maria/ma_loghandler.c @@ -1211,6 +1211,8 @@ static my_bool translog_set_lsn_for_files(uint32 from_file, uint32 to_file, 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 @@ my_bool translog_init_with_table(const char *directory, 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 diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index 0d4ab20a834..9dac355fd0a 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -382,7 +382,7 @@ static MI_INFO *myisammrg_attach_children_callback(void *callback_param) 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); diff --git a/storage/myisammrg/myrg_open.c b/storage/myisammrg/myrg_open.c index 7b310dc2eed..32ac719ec4d 100644 --- a/storage/myisammrg/myrg_open.c +++ b/storage/myisammrg/myrg_open.c @@ -239,6 +239,7 @@ MYRG_INFO *myrg_parent_open(const char *parent_name, 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, diff --git a/storage/xtradb/include/ut0lst.h b/storage/xtradb/include/ut0lst.h index 261d33963dc..fa7a186dfb1 100644 --- a/storage/xtradb/include/ut0lst.h +++ b/storage/xtradb/include/ut0lst.h @@ -158,7 +158,7 @@ Inserts a NODE2 after NODE1 in a list. /** 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 /*******************************************************************//** diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index bf9c6f9626a..9e37518fb1b 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -203,7 +203,7 @@ static int my_strnncoll_ucs2(CHARSET_INFO *cs, 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 @@ static int my_strncasecmp_ucs2(CHARSET_INFO *cs, 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 @@ int my_strnncoll_ucs2_bin(CHARSET_INFO *cs, 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; diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 91f633e45ce..f99c34ec39a 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -2310,7 +2310,7 @@ static int my_strnncoll_utf8(CHARSET_INFO *cs, 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 @@ static int my_strnncollsp_utf8(CHARSET_INFO *cs, 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; diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp index 0a5aa645d3a..fbac70c4ebb 100644 --- a/support-files/compiler_warnings.supp +++ b/support-files/compiler_warnings.supp @@ -72,6 +72,11 @@ db_vrfy.c : .*comparison is always false due to limited range of data type.* .*: 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 @@ db_vrfy.c : .*comparison is always false due to limited range of data type.* 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 @@ include/runtime.hpp: .*pure_error.* .*/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. diff --git a/unittest/mysys/waiting_threads-t.c b/unittest/mysys/waiting_threads-t.c index 79dee219efb..e32a83ef172 100644 --- a/unittest/mysys/waiting_threads-t.c +++ b/unittest/mysys/waiting_threads-t.c @@ -258,7 +258,7 @@ void do_tests() #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(); |