diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2017-09-29 16:44:53 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2017-09-29 17:27:21 +0000 |
commit | 24d9664ad0c594ba76c0a134a5e07799f097b57a (patch) | |
tree | a7755297b8cbe12ae3a5842cf91694abdd253f2a /sql/table_cache.cc | |
parent | 8e8a7f85a96c4a8cb86e0da6db38c3ff5f6c909c (diff) | |
download | mariadb-git-24d9664ad0c594ba76c0a134a5e07799f097b57a.tar.gz |
In table cache code, fix casts from longlong to long for
'version' variables.
The warnings occur on Windows build, yet they are also are valid
on 32bit Unix.
Fix is to consistently use 64bit integer on all platforms.
Diffstat (limited to 'sql/table_cache.cc')
-rw-r--r-- | sql/table_cache.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sql/table_cache.cc b/sql/table_cache.cc index 8c14b60e73c..be990543757 100644 --- a/sql/table_cache.cc +++ b/sql/table_cache.cc @@ -68,7 +68,7 @@ I_P_List <TDC_element, I_P_List_null_counter, I_P_List_fast_push_back<TDC_element> > unused_shares; -static int64 tdc_version; /* Increments on each reload */ +static tdc_version_t tdc_version; /* Increments on each reload */ static bool tdc_inited; @@ -945,7 +945,7 @@ void tdc_release_share(TABLE_SHARE *share) mysql_mutex_lock(&share->tdc->LOCK_table_share); DBUG_PRINT("enter", - ("share: %p table: %s.%s ref_count: %u version: %lu", + ("share: %p table: %s.%s ref_count: %u version: %lld", share, share->db.str, share->table_name.str, share->tdc->ref_count, share->tdc->version)); DBUG_ASSERT(share->tdc->ref_count); @@ -1181,8 +1181,7 @@ bool tdc_remove_table(THD *thd, enum_tdc_remove_table_type remove_type, */ int tdc_wait_for_old_version(THD *thd, const char *db, const char *table_name, - ulong wait_timeout, uint deadlock_weight, - ulong refresh_version) + ulong wait_timeout, uint deadlock_weight, tdc_version_t refresh_version) { TDC_element *element; @@ -1201,16 +1200,16 @@ int tdc_wait_for_old_version(THD *thd, const char *db, const char *table_name, } -ulong tdc_refresh_version(void) +tdc_version_t tdc_refresh_version(void) { - return (ulong)my_atomic_load64_explicit(&tdc_version, MY_MEMORY_ORDER_RELAXED); + return (tdc_version_t)my_atomic_load64_explicit(&tdc_version, MY_MEMORY_ORDER_RELAXED); } -ulong tdc_increment_refresh_version(void) +tdc_version_t tdc_increment_refresh_version(void) { - ulong v= (ulong)my_atomic_add64_explicit(&tdc_version, 1, MY_MEMORY_ORDER_RELAXED); - DBUG_PRINT("tcache", ("incremented global refresh_version to: %lu", v)); + tdc_version_t v= (tdc_version_t)my_atomic_add64_explicit(&tdc_version, 1, MY_MEMORY_ORDER_RELAXED); + DBUG_PRINT("tcache", ("incremented global refresh_version to: %lld", v)); return v + 1; } |