[Maria-developers] bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (monty:2836)
#At lp:maria based on revid:monty@askmonty.org-20100329190745-m4fvzr3pr6phn93h 2836 Michael Widenius 2010-03-30 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 per-file messages: extra/comp_err.c Added cast to get rid of compiler warning extra/libevent/kqueue.c Added cast to get rid of compiler warning mysql-test/lib/mtr_cases.pm Use --skip-pbxt for test cases that doesn't need pbxt Collect default-storage-engine from suite.opt file (should actually be my.cnf file, but that wasn't easy to do) mysql-test/suite/pbxt/t/suite.opt Added marker for mysql-test-run.pl that this suite require pbxt mysys/mf_keycache.c Use LINT_INIT() to remove compiler warnings mysys/my_gethostbyname.c Remove compiler warnings sql/handler.cc Reset variable that may be used uninitialized sql/item.h Remove compiler warning sql/mysqld.cc Use LINT_INIT() to remove compiler warnings sql/sql_class.h Remove compiler warning sql/sql_table.cc Ensure variable is always set (to remove compiler warning) sql/sql_view.cc Use LINT_INIT() to remove compiler warnings storage/maria/ma_loghandler.c Use LINT_INIT() to remove compiler warnings storage/myisammrg/ha_myisammrg.cc Fixed wrong type to printf storage/myisammrg/myrg_open.c Use LINT_INIT() to remove compiler warnings storage/xtradb/include/ut0lst.h Trivial change of macro to remove compiler warning strings/ctype-ucs2.c Use LINT_INIT() to remove compiler warnings strings/ctype-utf8.c Use LINT_INIT() to remove compiler warnings support-files/compiler_warnings.supp Suppress some not relevant warnings unittest/mysys/waiting_threads-t.c Don't use ftruncate() as this gives warning about ignored return value === modified file 'extra/comp_err.c' --- a/extra/comp_err.c 2009-11-20 10:11:31 +0000 +++ b/extra/comp_err.c 2010-03-30 12:36:49 +0000 @@ -660,7 +660,7 @@ static ha_checksum checksum_format_speci 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' --- a/extra/libevent/kqueue.c 2009-03-12 22:27:35 +0000 +++ b/extra/libevent/kqueue.c 2010-03-30 12:36:49 +0000 @@ -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); === modified file 'mysql-test/lib/mtr_cases.pm' --- a/mysql-test/lib/mtr_cases.pm 2010-01-15 15:27:55 +0000 +++ b/mysql-test/lib/mtr_cases.pm 2010-03-30 12:36:49 +0000 @@ -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], === added file 'mysql-test/suite/pbxt/t/suite.opt' --- a/mysql-test/suite/pbxt/t/suite.opt 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/pbxt/t/suite.opt 2010-03-30 12:36:49 +0000 @@ -0,0 +1 @@ +--default-storage-engine=pbxt === modified file 'mysys/mf_keycache.c' --- a/mysys/mf_keycache.c 2009-12-03 11:19:05 +0000 +++ b/mysys/mf_keycache.c 2010-03-30 12:36:49 +0000 @@ -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); === modified file 'mysys/my_gethostbyname.c' --- a/mysys/my_gethostbyname.c 2006-12-31 00:32:21 +0000 +++ b/mysys/my_gethostbyname.c 2010-03-30 12:36:49 +0000 @@ -91,9 +91,12 @@ extern pthread_mutex_t LOCK_gethostbynam 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' --- a/sql/handler.cc 2010-03-08 13:57:32 +0000 +++ b/sql/handler.cc 2010-03-30 12:36:49 +0000 @@ -4129,7 +4129,7 @@ int handler::read_multi_range_first(KEY_ */ 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' --- a/sql/item.h 2010-03-28 18:10:00 +0000 +++ b/sql/item.h 2010-03-30 12:36:49 +0000 @@ -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 */ }; === modified file 'sql/mysqld.cc' --- a/sql/mysqld.cc 2010-03-10 09:12:23 +0000 +++ b/sql/mysqld.cc 2010-03-30 12:36:49 +0000 @@ -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]; === modified file 'sql/sql_class.h' --- a/sql/sql_class.h 2010-03-04 08:03:07 +0000 +++ b/sql/sql_class.h 2010-03-30 12:36:49 +0000 @@ -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 */ }; === modified file 'sql/sql_table.cc' --- a/sql/sql_table.cc 2010-03-04 08:03:07 +0000 +++ b/sql/sql_table.cc 2010-03-30 12:36:49 +0000 @@ -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); } === modified file 'sql/sql_view.cc' --- a/sql/sql_view.cc 2010-03-04 08:03:07 +0000 +++ b/sql/sql_view.cc 2010-03-30 12:36:49 +0000 @@ -1034,10 +1034,12 @@ bool mysql_make_view(THD *thd, File_pars 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' --- a/storage/maria/ma_loghandler.c 2010-03-10 10:32:14 +0000 +++ b/storage/maria/ma_loghandler.c 2010-03-30 12:36:49 +0000 @@ -1211,6 +1211,8 @@ static my_bool translog_set_lsn_for_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 c 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' --- a/storage/myisammrg/ha_myisammrg.cc 2010-03-04 08:03:07 +0000 +++ b/storage/myisammrg/ha_myisammrg.cc 2010-03-30 12:36:49 +0000 @@ -382,7 +382,7 @@ static MI_INFO *myisammrg_attach_childre 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' --- a/storage/myisammrg/myrg_open.c 2009-09-23 13:21:29 +0000 +++ b/storage/myisammrg/myrg_open.c 2010-03-30 12:36:49 +0000 @@ -239,6 +239,7 @@ MYRG_INFO *myrg_parent_open(const char * 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' --- a/storage/xtradb/include/ut0lst.h 2009-09-07 10:22:53 +0000 +++ b/storage/xtradb/include/ut0lst.h 2010-03-30 12:36:49 +0000 @@ -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 /*******************************************************************//** === modified file 'strings/ctype-ucs2.c' --- a/strings/ctype-ucs2.c 2010-03-04 08:03:07 +0000 +++ b/strings/ctype-ucs2.c 2010-03-30 12:36:49 +0000 @@ -203,7 +203,7 @@ static int my_strnncoll_ucs2(CHARSET_INF 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_I 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 * 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' --- a/strings/ctype-utf8.c 2009-10-15 21:38:29 +0000 +++ b/strings/ctype-utf8.c 2010-03-30 12:36:49 +0000 @@ -2310,7 +2310,7 @@ static int my_strnncoll_utf8(CHARSET_INF 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_I 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' --- a/support-files/compiler_warnings.supp 2010-03-29 19:07:45 +0000 +++ b/support-files/compiler_warnings.supp 2010-03-30 12:36:49 +0000 @@ -72,6 +72,11 @@ db_vrfy.c : .*comparison is always false .*: 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 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. === modified file 'unittest/mysys/waiting_threads-t.c' --- a/unittest/mysys/waiting_threads-t.c 2010-01-28 14:49:14 +0000 +++ b/unittest/mysys/waiting_threads-t.c 2010-03-30 12:36:49 +0000 @@ -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();
participants (1)
-
Michael Widenius