← Back to team overview

maria-developers team mailing list archive

bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (monty:2798)

 

#At lp:maria based on revid:monty@xxxxxxxxxxxx-20100114163241-cvhq8ezp8psqy1aa

 2798 Michael Widenius	2010-01-14
      Fix for compiler warnings on windows
      Fix wrong cast of time()
      modified:
        include/my_pthread.h
        sql/handler.h
        storage/maria/ma_check.c
        storage/maria/ma_create.c
        storage/myisam/mi_check.c
        storage/myisam/mi_create.c
        storage/xtradb/handler/ha_innodb.cc

per-file messages:
  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
=== modified file 'include/my_pthread.h'
--- a/include/my_pthread.h	2009-06-30 12:01:29 +0000
+++ b/include/my_pthread.h	2010-01-14 16:51:00 +0000
@@ -543,9 +543,9 @@ void safe_mutex_free_deadlock_data(safe_
 #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)

=== modified file 'sql/handler.h'
--- a/sql/handler.h	2010-01-04 13:12:53 +0000
+++ b/sql/handler.h	2010-01-14 16:51:00 +0000
@@ -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():

=== modified file 'storage/maria/ma_check.c'
--- a/storage/maria/ma_check.c	2009-11-29 23:08:56 +0000
+++ b/storage/maria/ma_check.c	2010-01-14 16:51:00 +0000
@@ -6018,7 +6018,7 @@ int maria_update_state_info(HA_CHECK *pa
   {
     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;
     }

=== modified file 'storage/maria/ma_create.c'
--- a/storage/maria/ma_create.c	2009-02-19 09:01:25 +0000
+++ b/storage/maria/ma_create.c	2010-01-14 16:51:00 +0000
@@ -772,7 +772,7 @@ int maria_create(const char *name, enum
     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);
 

=== modified file 'storage/myisam/mi_check.c'
--- a/storage/myisam/mi_check.c	2009-12-03 11:34:11 +0000
+++ b/storage/myisam/mi_check.c	2010-01-14 16:51:00 +0000
@@ -4447,7 +4447,7 @@ int update_state_info(HA_CHECK *param, M
   {
     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;
     }

=== modified file 'storage/myisam/mi_create.c'
--- a/storage/myisam/mi_create.c	2009-10-15 21:38:29 +0000
+++ b/storage/myisam/mi_create.c	2010-01-14 16:51:00 +0000
@@ -575,7 +575,7 @@ int mi_create(const char *name,uint keys
     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);
 

=== modified file 'storage/xtradb/handler/ha_innodb.cc'
--- a/storage/xtradb/handler/ha_innodb.cc	2009-12-03 11:34:11 +0000
+++ b/storage/xtradb/handler/ha_innodb.cc	2010-01-14 16:51:00 +0000
@@ -61,7 +61,9 @@ with this program; if not, write to the
 #pragma implementation				// gcc: Class implementation
 #endif
 
+#ifndef MYSQL_SERVER
 #define MYSQL_SERVER
+#endif
 
 #include <mysql_priv.h>
 #ifdef MYSQL_SERVER