Commit a0a20345 authored by unknown's avatar unknown

portability fixes


mysql-test/r/mysqlbinlog.result:
  result fixed
parent 10db96fe
......@@ -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
......
......@@ -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);
......
......@@ -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;
......@@ -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
......@@ -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 @@ int TC_LOG_MMAP::recover()
"--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
......
......@@ -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;
......
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