diff options
-rw-r--r-- | BUILD/FINISH.sh | 3 | ||||
-rwxr-xr-x | BUILD/compile-solaris-amd64-debug | 2 | ||||
-rw-r--r-- | configure.cmake | 3 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test | 1 | ||||
-rw-r--r-- | sql-common/client.c | 7 | ||||
-rw-r--r-- | sql/item_strfunc.cc | 5 | ||||
-rw-r--r-- | sql/log.cc | 8 | ||||
-rw-r--r-- | sql/multi_range_read.cc | 4 | ||||
-rw-r--r-- | sql/opt_range.cc | 38 | ||||
-rw-r--r-- | sql/rpl_gtid.cc | 16 | ||||
-rw-r--r-- | sql/rpl_gtid.h | 2 | ||||
-rw-r--r-- | sql/set_var.cc | 2 | ||||
-rw-r--r-- | sql/sql_join_cache.cc | 4 | ||||
-rw-r--r-- | sql/sql_show.cc | 4 | ||||
-rw-r--r-- | sql/sql_statistics.cc | 2 | ||||
-rw-r--r-- | storage/xtradb/os/os0file.c | 3 | ||||
-rw-r--r-- | support-files/compiler_warnings.supp | 3 | ||||
-rw-r--r-- | vio/viosocket.c | 7 |
18 files changed, 73 insertions, 41 deletions
diff --git a/BUILD/FINISH.sh b/BUILD/FINISH.sh index e29b6936849..86085fcc593 100644 --- a/BUILD/FINISH.sh +++ b/BUILD/FINISH.sh @@ -42,8 +42,7 @@ path=`dirname $0` if [ -z "$just_clean" ] then commands="$commands -CC=\"$CC\" CFLAGS=\"$cflags\" CXX=\"$CXX\" CXXFLAGS=\"$cxxflags\" CXXLDFLAGS=\"$CXXLDFLAGS\" \ -$configure" +CC=\"$CC\" CFLAGS=\"$cflags\" CXX=\"$CXX\" CXXFLAGS=\"$cxxflags\" CXXLDFLAGS=\"$CXXLDFLAGS\" $configure" fi if [ -z "$just_configure" -a -z "$just_clean" ] diff --git a/BUILD/compile-solaris-amd64-debug b/BUILD/compile-solaris-amd64-debug index 4d6d3f6fce4..770572bd1d7 100755 --- a/BUILD/compile-solaris-amd64-debug +++ b/BUILD/compile-solaris-amd64-debug @@ -20,7 +20,7 @@ path=`dirname $0` extra_flags="$amd64_cflags -D__sun -m64 -mtune=athlon64 $debug_cflags" extra_configs="$amd64_configs $debug_configs $max_configs --with-libevent" -LDFLAGS="-lmtmalloc -R/usr/sfw/lib/64" +LDFLAGS="-m64 -lmtmalloc -R/usr/sfw/lib/64" export LDFLAGS . "$path/FINISH.sh" diff --git a/configure.cmake b/configure.cmake index f98b42ec159..23fa3a7c5c2 100644 --- a/configure.cmake +++ b/configure.cmake @@ -951,12 +951,15 @@ CHECK_CXX_SOURCE_COMPILES(" # they are silently ignored. For those OS's we will not attempt # to use SO_SNDTIMEO and SO_RCVTIMEO even if it is said to work. # See Bug#29093 for the problem with SO_SND/RCVTIMEO on HP/UX. +# Solaris11 has a similar problem # To use alarm is simple, simply avoid setting anything. IF(WIN32) SET(HAVE_SOCKET_TIMEOUT 1) ELSEIF(CMAKE_SYSTEM MATCHES "HP-UX") SET(HAVE_SOCKET_TIMEOUT 0) +ELSEIF(CMAKE_SYSTEM_NAME MATCHES "SunOS") + SET(HAVE_SOCKET_TIMEOUT 0) ELSEIF(CMAKE_CROSSCOMPILING) SET(HAVE_SOCKET_TIMEOUT 0) ELSE() diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test b/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test index 549d11e9d1c..57f1975ed77 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test @@ -48,6 +48,7 @@ let $binlog_file=LAST; source include/show_binlog_events.inc; connection server_1; +--sync_with_master source include/stop_slave.inc; source include/wait_for_slave_to_stop.inc; reset slave all; diff --git a/sql-common/client.c b/sql-common/client.c index 507917b0722..a1904bae93a 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -3420,8 +3420,11 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, strmov(mysql->server_version,(char*) net->read_pos+1); mysql->port=port; - /* remove the rpl hack from the version string, see RPL_VERSION_HACK comment */ - if (mysql->server_capabilities & CLIENT_PLUGIN_AUTH && + /* + remove the rpl hack from the version string, see RPL_VERSION_HACK + comment + */ + if ((mysql->server_capabilities & CLIENT_PLUGIN_AUTH) && strncmp(mysql->server_version, RPL_VERSION_HACK, sizeof(RPL_VERSION_HACK) - 1) == 0) mysql->server_version+= sizeof(RPL_VERSION_HACK) - 1; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 1ee4a4436fe..15b1cedf346 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -3866,7 +3866,10 @@ bool Item_func_dyncol_create::fix_fields(THD *thd, Item **ref) vals= (DYNAMIC_COLUMN_VALUE *) alloc_root(thd->mem_root, sizeof(DYNAMIC_COLUMN_VALUE) * (arg_count / 2)); - for (i= 0; i + 1 < arg_count && args[i]->result_type() == INT_RESULT; i+= 2); + for (i= 0; + i + 1 < arg_count && args[i]->result_type() == INT_RESULT; + i+= 2) + ; if (i + 1 < arg_count) { names= TRUE; diff --git a/sql/log.cc b/sql/log.cc index a4ec5583dc9..a96ec830b01 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -119,7 +119,6 @@ static MYSQL_BIN_LOG::xid_count_per_binlog * static bool start_binlog_background_thread(); - static rpl_binlog_state rpl_global_gtid_binlog_state; /** @@ -2994,6 +2993,13 @@ void MYSQL_BIN_LOG::cleanup() mysql_cond_destroy(&COND_binlog_background_thread); mysql_cond_destroy(&COND_binlog_background_thread_end); } + + /* + Free data for global binlog state. + We can't do that automaticly as we need to do this before + safemalloc is shut down + */ + rpl_global_gtid_binlog_state.free(); DBUG_VOID_RETURN; } diff --git a/sql/multi_range_read.cc b/sql/multi_range_read.cc index e3719600dff..ceb6b16ec7a 100644 --- a/sql/multi_range_read.cc +++ b/sql/multi_range_read.cc @@ -1199,9 +1199,9 @@ bool DsMrr_impl::setup_buffer_sharing(uint key_size_in_keybuf, statistics? */ uint parts= my_count_bits(key_tuple_map); - ulong rpc; + ha_rows rpc; ulonglong rowids_size= rowid_buf_elem_size; - if ((rpc= key_info->actual_rec_per_key(parts - 1))) + if ((rpc= (ha_rows) key_info->actual_rec_per_key(parts - 1))) rowids_size= rowid_buf_elem_size * rpc; double fraction_for_rowids= diff --git a/sql/opt_range.cc b/sql/opt_range.cc index b736f898768..85c9c9fd394 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -5919,8 +5919,8 @@ ha_rows records_in_index_intersect_extension(PARTIAL_INDEX_INTERSECT_INFO *curr, ha_rows ext_records= ext_index_scan->records; if (i < used_key_parts) { - ulong f1= key_info->actual_rec_per_key(i-1); - ulong f2= key_info->actual_rec_per_key(i); + double f1= key_info->actual_rec_per_key(i-1); + double f2= key_info->actual_rec_per_key(i); ext_records= (ha_rows) ((double) ext_records / f2 * f1); } if (ext_records < table_cardinality) @@ -13157,11 +13157,11 @@ void cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts, double *read_cost, ha_rows *records) { ha_rows table_records; - uint num_groups; - uint num_blocks; - uint keys_per_block; - uint keys_per_group; - uint keys_per_subgroup; /* Average number of keys in sub-groups */ + ha_rows num_groups; + ha_rows num_blocks; + uint keys_per_block; + ha_rows keys_per_group; + ha_rows keys_per_subgroup; /* Average number of keys in sub-groups */ /* formed by a key infix. */ double p_overlap; /* Probability that a sub-group overlaps two blocks. */ double quick_prefix_selectivity; @@ -13170,24 +13170,24 @@ void cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts, DBUG_ENTER("cost_group_min_max"); table_records= table->stat_records(); - keys_per_block= (table->file->stats.block_size / 2 / - (index_info->key_length + table->file->ref_length) - + 1); - num_blocks= (uint)(table_records / keys_per_block) + 1; + keys_per_block= (uint) (table->file->stats.block_size / 2 / + (index_info->key_length + table->file->ref_length) + + 1); + num_blocks= (ha_rows)(table_records / keys_per_block) + 1; /* Compute the number of keys in a group. */ - keys_per_group= index_info->actual_rec_per_key(group_key_parts - 1); + keys_per_group= (ha_rows) index_info->actual_rec_per_key(group_key_parts - 1); if (keys_per_group == 0) /* If there is no statistics try to guess */ /* each group contains 10% of all records */ - keys_per_group= (uint)(table_records / 10) + 1; - num_groups= (uint)(table_records / keys_per_group) + 1; + keys_per_group= (table_records / 10) + 1; + num_groups= (table_records / keys_per_group) + 1; /* Apply the selectivity of the quick select for group prefixes. */ if (range_tree && (quick_prefix_records != HA_POS_ERROR)) { quick_prefix_selectivity= (double) quick_prefix_records / (double) table_records; - num_groups= (uint) rint(num_groups * quick_prefix_selectivity); + num_groups= (ha_rows) rint(num_groups * quick_prefix_selectivity); set_if_bigger(num_groups, 1); } @@ -13196,7 +13196,7 @@ void cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts, Compute the probability that two ends of a subgroup are inside different blocks. */ - keys_per_subgroup= index_info->actual_rec_per_key(used_key_parts - 1); + keys_per_subgroup= (ha_rows) index_info->actual_rec_per_key(used_key_parts - 1); if (keys_per_subgroup >= keys_per_block) /* If a subgroup is bigger than */ p_overlap= 1.0; /* a block, it will overlap at least two blocks. */ else @@ -13224,9 +13224,9 @@ void cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts, *records= num_groups; DBUG_PRINT("info", - ("table rows: %lu keys/block: %u keys/group: %u result rows: %lu blocks: %u", - (ulong)table_records, keys_per_block, keys_per_group, - (ulong) *records, num_blocks)); + ("table rows: %lu keys/block: %u keys/group: %lu result rows: %lu blocks: %lu", + (ulong)table_records, keys_per_block, (ulong) keys_per_group, + (ulong) *records, (ulong) num_blocks)); DBUG_VOID_RETURN; } diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc index d6a6ed90bd3..bda060115ed 100644 --- a/sql/rpl_gtid.cc +++ b/sql/rpl_gtid.cc @@ -686,6 +686,7 @@ rpl_binlog_state::rpl_binlog_state() sizeof(uint32), NULL, my_free, HASH_UNIQUE); mysql_mutex_init(key_LOCK_binlog_state, &LOCK_binlog_state, MY_MUTEX_INIT_SLOW); + initialized= 1; } @@ -699,11 +700,20 @@ rpl_binlog_state::reset() my_hash_reset(&hash); } +void rpl_binlog_state::free() +{ + if (initialized) + { + initialized= 0; + reset(); + my_hash_free(&hash); + mysql_mutex_destroy(&LOCK_binlog_state); + } +} + rpl_binlog_state::~rpl_binlog_state() { - reset(); - my_hash_free(&hash); - mysql_mutex_destroy(&LOCK_binlog_state); + free(); } diff --git a/sql/rpl_gtid.h b/sql/rpl_gtid.h index e63d8439803..046533fd760 100644 --- a/sql/rpl_gtid.h +++ b/sql/rpl_gtid.h @@ -135,11 +135,13 @@ struct rpl_binlog_state HASH hash; /* Mutex protecting access to the state. */ mysql_mutex_t LOCK_binlog_state; + my_bool initialized; rpl_binlog_state(); ~rpl_binlog_state(); void reset(); + void free(); int update(const struct rpl_gtid *gtid); uint64 seq_no_from_state(); int write_to_iocache(IO_CACHE *dest); diff --git a/sql/set_var.cc b/sql/set_var.cc index 48f7cc7a054..97545778f18 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -315,7 +315,7 @@ longlong sys_var::val_int(bool *is_null, { case_get_string_as_lex_string; case_for_integers(return val); - case_for_double(return val); + case_for_double(return (longlong) val); default: my_error(ER_VAR_CANT_BE_READ, MYF(0), name.str); return 0; diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index 6b0882bda80..9fca8730cb5 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -3812,8 +3812,8 @@ uint JOIN_TAB_SCAN_MRR::aux_buffer_incr(ulong recno) uint incr= 0; TABLE_REF *ref= &join_tab->ref; TABLE *tab= join_tab->table; - uint rec_per_key= - tab->key_info[ref->key].actual_rec_per_key(ref->key_parts-1); + ha_rows rec_per_key= + (ha_rows) tab->key_info[ref->key].actual_rec_per_key(ref->key_parts-1); set_if_bigger(rec_per_key, 1); if (recno == 1) incr= ref->key_length + tab->file->ref_length; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 46cc157061d..b448e5a64b9 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -5977,8 +5977,8 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables, KEY *key=show_table->key_info+i; if (key->rec_per_key[j]) { - ha_rows records=((double) show_table->stat_records() / - key->actual_rec_per_key(j)); + ha_rows records= (ha_rows) ((double) show_table->stat_records() / + key->actual_rec_per_key(j)); table->field[9]->store((longlong) records, TRUE); table->field[9]->set_notnull(); } diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index f355f2c7760..2e2886a1d3f 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -337,7 +337,7 @@ protected: void store_record_for_lookup() { - store_record(stat_table, record[0]); + DBUG_ASSERT(record[0] == stat_table->record[0]); } bool update_record() diff --git a/storage/xtradb/os/os0file.c b/storage/xtradb/os/os0file.c index 8f7f8216782..1724e39d342 100644 --- a/storage/xtradb/os/os0file.c +++ b/storage/xtradb/os/os0file.c @@ -1475,7 +1475,8 @@ static int os_file_set_atomic_writes(os_file_t file, const char *name) return ret; } #else -static int os_file_set_atomic_writes(os_file_t file, const char *name) +static int os_file_set_atomic_writes(os_file_t file __attribute__ ((unused)), + const char *name) { fprintf(stderr, "InnoDB : can't use atomic writes on %s - not implemented on this platform." diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp index 34f368c4373..7454eacfb34 100644 --- a/support-files/compiler_warnings.supp +++ b/support-files/compiler_warnings.supp @@ -48,7 +48,8 @@ btr/btr0cur\.c: .*value computed is not used.*: 3175-3375 btr/btr0sea\.c: passing argument 2 .* discards qualifiers from pointer target type ibuf/ibuf0ibuf.c: null argument where non-null required: 700-1000 fsp0fsp\.c: result of 32-bit shift implicitly converted to 64 bits - +log/log0log\.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type +log/log0online.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type # # bdb is not critical to keep up to date # diff --git a/vio/viosocket.c b/vio/viosocket.c index baefa1c6d06..960b49276a8 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -322,7 +322,9 @@ int vio_fastsend(Vio * vio __attribute__((unused))) } if (r) { - DBUG_PRINT("warning", ("Couldn't set socket option for fast send")); + DBUG_PRINT("warning", + ("Couldn't set socket option for fast send, error %d", + socket_errno)); r= -1; } DBUG_PRINT("exit", ("%d", r)); @@ -819,7 +821,7 @@ void vio_timeout(Vio *vio, uint which, uint timeout) #if defined(SO_SNDTIMEO) && defined(SO_RCVTIMEO) int r; DBUG_ENTER("vio_timeout"); - + DBUG_PRINT("enter", ("which: %u timeout: %u", which, timeout)); { #ifdef __WIN__ /* Windows expects time in milliseconds as int */ @@ -846,6 +848,7 @@ void vio_timeout(Vio *vio, uint which, uint timeout) Platforms not suporting setting of socket timeout should either use thr_alarm or just run without read/write timeout(s) */ + DBUG_PRINT("warning", ("timeout ignored")); #endif /* Make timeout values available for async operations. */ if (which) |