Commit d121e663 authored by Michael Widenius's avatar Michael Widenius

Fix for compiler warnings on windows

Fix wrong cast of time()

include/my_pthread.h:
  Safety fix that also removes compiler warnings
sql/handler.h:
  Changed timestamp columns to be of type time_t
storage/maria/ma_check.c:
  Removed wrong cast
storage/maria/ma_create.c:
  Removed wrong cast
storage/myisam/mi_check.c:
  Removed wrong cast
storage/myisam/mi_create.c:
  Removed wrong cast
storage/xtradb/handler/ha_innodb.cc:
  Removed compiler warning on windows
parent e4535de1
......@@ -543,9 +543,9 @@ void safe_mutex_free_deadlock_data(safe_mutex_t *mp);
#else
#define my_pthread_mutex_init(A,B,C,D) pthread_mutex_init((A),(B))
#define my_pthread_mutex_lock(A,B) pthread_mutex_lock(A)
#define safe_mutex_assert_owner(mp)
#define safe_mutex_assert_not_owner(mp)
#define safe_mutex_free_deadlock_data(mp)
#define safe_mutex_assert_owner(mp) do {} while(0)
#define safe_mutex_assert_not_owner(mp) do {} while(0)
#define safe_mutex_free_deadlock_data(mp) do {} while(0)
#endif /* SAFE_MUTEX */
#if defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX)
......
......@@ -891,9 +891,9 @@ typedef struct {
ulonglong delete_length;
ha_rows records;
ulong mean_rec_length;
ulong create_time;
ulong check_time;
ulong update_time;
time_t create_time;
time_t check_time;
time_t update_time;
ulonglong check_sum;
} PARTITION_INFO;
......@@ -1060,9 +1060,9 @@ public:
ha_rows records;
ha_rows deleted; /* Deleted records */
ulong mean_rec_length; /* physical reclength */
ulong create_time; /* When table was created */
ulong check_time;
ulong update_time;
time_t create_time; /* When table was created */
time_t check_time;
time_t update_time;
uint block_size; /* index block size */
ha_statistics():
......
......@@ -6018,7 +6018,7 @@ int maria_update_state_info(HA_CHECK *param, MARIA_HA *info,uint update)
{
if (update & UPDATE_TIME)
{
share->state.check_time= (long) time((time_t*) 0);
share->state.check_time= time((time_t*) 0);
if (!share->state.create_time)
share->state.create_time= share->state.check_time;
}
......
......@@ -772,7 +772,7 @@ int maria_create(const char *name, enum data_file_type datafile_type,
share.base.min_block_length= share.base.pack_reclength;
if (! (flags & HA_DONT_TOUCH_DATA))
share.state.create_time= (long) time((time_t*) 0);
share.state.create_time= time((time_t*) 0);
pthread_mutex_lock(&THR_LOCK_maria);
......
......@@ -4447,7 +4447,7 @@ int update_state_info(HA_CHECK *param, MI_INFO *info,uint update)
{
if (update & UPDATE_TIME)
{
share->state.check_time= (long) time((time_t*) 0);
share->state.check_time= time((time_t*) 0);
if (!share->state.create_time)
share->state.create_time=share->state.check_time;
}
......
......@@ -575,7 +575,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
max(share.base.pack_reclength,MI_MIN_BLOCK_LENGTH) :
MI_EXTEND_BLOCK_LENGTH;
if (! (flags & HA_DONT_TOUCH_DATA))
share.state.create_time= (long) time((time_t*) 0);
share.state.create_time= time((time_t*) 0);
pthread_mutex_lock(&THR_LOCK_myisam);
......
......@@ -61,7 +61,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#pragma implementation // gcc: Class implementation
#endif
#ifndef MYSQL_SERVER
#define MYSQL_SERVER
#endif
#include <mysql_priv.h>
#ifdef MYSQL_SERVER
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment