diff options
author | unknown <serg@serg.mylan> | 2005-02-20 20:08:33 +0100 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2005-02-20 20:08:33 +0100 |
commit | a0a20345b9869731cac43438ed5c23709aa6fc14 (patch) | |
tree | 350d45d1c0dbdf570edc1a23e51a170a8404e777 | |
parent | 10db96fe432886f15bc489b6f27540b6fa3463a7 (diff) | |
download | mariadb-git-a0a20345b9869731cac43438ed5c23709aa6fc14.tar.gz |
portability fixes
mysql-test/r/mysqlbinlog.result:
result fixed
-rw-r--r-- | include/config-win.h | 3 | ||||
-rw-r--r-- | include/my_sys.h | 3 | ||||
-rw-r--r-- | mysql-test/r/mysqlbinlog.result | 8 | ||||
-rw-r--r-- | mysys/my_mmap.c | 4 | ||||
-rw-r--r-- | sql/log.cc | 14 | ||||
-rw-r--r-- | sql/sql_class.h | 7 |
6 files changed, 22 insertions, 17 deletions
diff --git a/include/config-win.h b/include/config-win.h index 475141a1989..ba1a987f14c 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -310,9 +310,6 @@ inline double ulonglong2double(ulonglong value) #define HAVE_SETFILEPOINTER #define HAVE_VIO -#define HAME_MMAP /* in mysys/my_mmap.c */ -#define HAVE_GETPAGESIZE /* in mysys/my_mmap.c */ - #ifdef NOT_USED #define HAVE_SNPRINTF /* Gave link error */ #define _snprintf snprintf diff --git a/include/my_sys.h b/include/my_sys.h index 9cce13e53dd..498a1bd30fe 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -796,7 +796,7 @@ void my_free_open_file_info(void); ulonglong my_getsystime(void); my_bool my_gethwaddr(uchar *to); -#ifdef HAVE_MMAP +#ifdef HAVE_SYS_MMAN_H #include <sys/mman.h> #ifndef MAP_NOSYNC @@ -815,6 +815,7 @@ my_bool my_gethwaddr(uchar *to); #define MAP_NOSYNC 0x0800 #define MAP_FAILED ((void *)-1) #define MS_SYNC 0x0000 +#define HAVE_MMAP int my_getpagesize(void); void *my_mmap(void *, size_t, int, int, int, my_off_t); diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index ee0047934ab..df117479814 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -111,10 +111,14 @@ insert into t1 values ("Alas"); /*!40019 SET @@session.max_insert_delayed_threads=0*/; ROLLBACK; use test; -SET TIMESTAMP=1065204671; +SET TIMESTAMP=1108844556; BEGIN; +SET TIMESTAMP=1108844555; +insert t1 values (1); /*!40019 SET @@session.max_insert_delayed_threads=0*/; use test; -SET TIMESTAMP=1065204671; +SET TIMESTAMP=1108844556; BEGIN; +SET TIMESTAMP=1108844555; +insert t1 values (1); drop table t1, t2; diff --git a/mysys/my_mmap.c b/mysys/my_mmap.c index 883181edd6c..0225e7fac24 100644 --- a/mysys/my_mmap.c +++ b/mysys/my_mmap.c @@ -16,7 +16,7 @@ #include "mysys_priv.h" -#ifdef HAVE_MMAP +#ifdef HAVE_SYS_MMAN_H /* system msync() only syncs mmap'ed area to fs cache. @@ -84,6 +84,6 @@ int my_msync(int fd, void *addr, size_t len, int flags) } #endif -#error "no mmap!" +#warning "no mmap!" #endif diff --git a/sql/log.cc b/sql/log.cc index cb776cff0e9..b048323aa76 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2415,6 +2415,7 @@ void sql_print_information(const char *format, ...) DBUG_VOID_RETURN; } +#ifdef HAVE_MMAP /********* transaction coordinator log for 2pc - mmap() based solution *******/ /* @@ -2460,10 +2461,6 @@ uint opt_tc_log_size=TC_LOG_MIN_SIZE; uint tc_log_max_pages_used=0, tc_log_page_size=0, tc_log_page_waits=0, tc_log_cur_pages_used=0; -TC_LOG *tc_log; -TC_LOG_MMAP tc_log_mmap; -TC_LOG_DUMMY tc_log_dummy; - int TC_LOG_MMAP::open(const char *opt_name) { uint i; @@ -2473,12 +2470,8 @@ int TC_LOG_MMAP::open(const char *opt_name) DBUG_ASSERT(total_ha_2pc > 1); DBUG_ASSERT(opt_name && opt_name[0]); -#ifdef HAVE_GETPAGESIZE tc_log_page_size= my_getpagesize(); DBUG_ASSERT(TC_LOG_PAGE_SIZE % tc_log_page_size == 0); -#else - tc_log_page_size= TC_LOG_PAGE_SIZE; -#endif fn_format(logname,opt_name,mysql_data_home,"",MY_UNPACK_FILENAME); fd= my_open(logname, O_RDWR, MYF(0)); @@ -2861,6 +2854,11 @@ err1: "--tc-heuristic-recover={commit|rollback}"); return 1; } +#endif + +TC_LOG *tc_log; +TC_LOG_DUMMY tc_log_dummy; +TC_LOG_MMAP tc_log_mmap; /* Perform heuristic recovery, if --tc-heuristic-recover was used diff --git a/sql/sql_class.h b/sql/sql_class.h index 05fd1fdea58..34019e73f96 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -80,6 +80,7 @@ class TC_LOG_DUMMY: public TC_LOG // use it to disable the logging void unlog(ulong cookie, my_xid xid) { } }; +#ifdef HAVE_MMAP class TC_LOG_MMAP: public TC_LOG { private: @@ -103,7 +104,8 @@ class TC_LOG_MMAP: public TC_LOG char logname[FN_REFLEN]; File fd; - uint file_length, npages, inited; + my_off_t file_length; + uint npages, inited; uchar *data; struct st_page *pages, *syncing, *active, *pool, *pool_last; /* @@ -128,6 +130,9 @@ class TC_LOG_MMAP: public TC_LOG int sync(); int overflow(); }; +#else +#define TC_LOG_MMAP TC_LOG_DUMMY +#endif extern TC_LOG *tc_log; extern TC_LOG_MMAP tc_log_mmap; |