windows compilation fixes
This commit is contained in:
parent
cee85887df
commit
e29191e5c5
@ -353,6 +353,8 @@ inline double ulonglong2double(ulonglong value)
|
|||||||
|
|
||||||
#define DO_NOT_REMOVE_THREAD_WRAPPERS
|
#define DO_NOT_REMOVE_THREAD_WRAPPERS
|
||||||
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
|
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
|
||||||
|
#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V))
|
||||||
|
#define thread_safe_dec_and_test(V, L) thread_safe_decrement(V,L)
|
||||||
/* The following is only used for statistics, so it should be good enough */
|
/* The following is only used for statistics, so it should be good enough */
|
||||||
#ifdef __NT__ /* This should also work on Win98 but .. */
|
#ifdef __NT__ /* This should also work on Win98 but .. */
|
||||||
#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C))
|
#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C))
|
||||||
@ -366,6 +368,7 @@ inline double ulonglong2double(ulonglong value)
|
|||||||
#define statistic_add(V,C,L) (V)+=(C)
|
#define statistic_add(V,C,L) (V)+=(C)
|
||||||
#endif
|
#endif
|
||||||
#define statistic_increment(V,L) thread_safe_increment((V),(L))
|
#define statistic_increment(V,L) thread_safe_increment((V),(L))
|
||||||
|
#define statistic_decrement(V,L) thread_safe_decrement((V),(L))
|
||||||
|
|
||||||
#define shared_memory_buffer_length 16000
|
#define shared_memory_buffer_length 16000
|
||||||
#define default_shared_memory_base_name "MYSQL"
|
#define default_shared_memory_base_name "MYSQL"
|
||||||
|
@ -811,7 +811,8 @@ my_bool my_gethwaddr(uchar *to);
|
|||||||
/* not a complete set of mmap() flags, but only those that nesessary */
|
/* not a complete set of mmap() flags, but only those that nesessary */
|
||||||
#define PROT_READ 1
|
#define PROT_READ 1
|
||||||
#define PROT_WRITE 2
|
#define PROT_WRITE 2
|
||||||
#define MAP_NOSYNC 0x800
|
#define MAP_SHARED 0x0001
|
||||||
|
#define MAP_NOSYNC 0x0800
|
||||||
#define MAP_FAILED ((void *)-1)
|
#define MAP_FAILED ((void *)-1)
|
||||||
#define MS_SYNC 0x0000
|
#define MS_SYNC 0x0000
|
||||||
|
|
||||||
|
@ -215,6 +215,7 @@ bool berkeley_end(void)
|
|||||||
static int berkeley_close_connection(THD *thd)
|
static int berkeley_close_connection(THD *thd)
|
||||||
{
|
{
|
||||||
my_free((gptr)thd->ha_data[berkeley_hton.slot], MYF(0));
|
my_free((gptr)thd->ha_data[berkeley_hton.slot], MYF(0));
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool berkeley_flush_logs()
|
bool berkeley_flush_logs()
|
||||||
|
@ -2652,7 +2652,7 @@ ha_innobase::write_row(
|
|||||||
no need to re-acquire locks on it. */
|
no need to re-acquire locks on it. */
|
||||||
|
|
||||||
/* Altering to InnoDB format */
|
/* Altering to InnoDB format */
|
||||||
innobase_commit(user_thd, prebuilt->trx);
|
innobase_commit(user_thd, 1);
|
||||||
/* Note that this transaction is still active. */
|
/* Note that this transaction is still active. */
|
||||||
prebuilt->trx->active_trans = 1;
|
prebuilt->trx->active_trans = 1;
|
||||||
/* We will need an IX lock on the destination table. */
|
/* We will need an IX lock on the destination table. */
|
||||||
@ -2667,7 +2667,7 @@ ha_innobase::write_row(
|
|||||||
|
|
||||||
/* Commit the transaction. This will release the table
|
/* Commit the transaction. This will release the table
|
||||||
locks, so they have to be acquired again. */
|
locks, so they have to be acquired again. */
|
||||||
innobase_commit(user_thd, prebuilt->trx);
|
innobase_commit(user_thd, 1);
|
||||||
/* Note that this transaction is still active. */
|
/* Note that this transaction is still active. */
|
||||||
prebuilt->trx->active_trans = 1;
|
prebuilt->trx->active_trans = 1;
|
||||||
/* Re-acquire the table lock on the source table. */
|
/* Re-acquire the table lock on the source table. */
|
||||||
@ -4247,7 +4247,7 @@ ha_innobase::delete_all_rows(void)
|
|||||||
goto fallback;
|
goto fallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
innobase_commit(thd, trx);
|
innobase_commit(thd, 1);
|
||||||
|
|
||||||
error = convert_error_code_to_mysql(error, NULL);
|
error = convert_error_code_to_mysql(error, NULL);
|
||||||
|
|
||||||
|
@ -757,7 +757,7 @@ int ha_recover(HASH *commit_list)
|
|||||||
if (!x) // not "mine" - that is generated by external TM
|
if (!x) // not "mine" - that is generated by external TM
|
||||||
continue;
|
continue;
|
||||||
if (commit_list ?
|
if (commit_list ?
|
||||||
hash_search(commit_list, (char *)&x, sizeof(x)) != 0 :
|
hash_search(commit_list, (byte *)&x, sizeof(x)) != 0 :
|
||||||
tc_heuristic_recover == TC_HEURISTIC_RECOVER_COMMIT)
|
tc_heuristic_recover == TC_HEURISTIC_RECOVER_COMMIT)
|
||||||
(*(*ht)->commit_by_xid)(list+i);
|
(*(*ht)->commit_by_xid)(list+i);
|
||||||
else
|
else
|
||||||
|
10
sql/log.cc
10
sql/log.cc
@ -2096,7 +2096,7 @@ void MYSQL_LOG::close(uint exiting)
|
|||||||
if (log_file.type == WRITE_CACHE && log_type == LOG_BIN)
|
if (log_file.type == WRITE_CACHE && log_type == LOG_BIN)
|
||||||
{
|
{
|
||||||
my_off_t offset= BIN_LOG_HEADER_SIZE + FLAGS_OFFSET;
|
my_off_t offset= BIN_LOG_HEADER_SIZE + FLAGS_OFFSET;
|
||||||
char flags=0; // clearing LOG_EVENT_BINLOG_IN_USE_F
|
byte flags=0; // clearing LOG_EVENT_BINLOG_IN_USE_F
|
||||||
my_pwrite(log_file.file, &flags, 1, offset, MYF(0));
|
my_pwrite(log_file.file, &flags, 1, offset, MYF(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2474,7 +2474,7 @@ int TC_LOG_MMAP::open(const char *opt_name)
|
|||||||
DBUG_ASSERT(opt_name && opt_name[0]);
|
DBUG_ASSERT(opt_name && opt_name[0]);
|
||||||
|
|
||||||
#ifdef HAVE_GETPAGESIZE
|
#ifdef HAVE_GETPAGESIZE
|
||||||
tc_log_page_size=getpagesize();
|
tc_log_page_size= my_getpagesize();
|
||||||
DBUG_ASSERT(TC_LOG_PAGE_SIZE % tc_log_page_size == 0);
|
DBUG_ASSERT(TC_LOG_PAGE_SIZE % tc_log_page_size == 0);
|
||||||
#else
|
#else
|
||||||
tc_log_page_size= TC_LOG_PAGE_SIZE;
|
tc_log_page_size= TC_LOG_PAGE_SIZE;
|
||||||
@ -2781,6 +2781,7 @@ void TC_LOG_MMAP::unlog(ulong cookie, my_xid xid)
|
|||||||
|
|
||||||
void TC_LOG_MMAP::close()
|
void TC_LOG_MMAP::close()
|
||||||
{
|
{
|
||||||
|
uint i;
|
||||||
switch (inited) {
|
switch (inited) {
|
||||||
case 6:
|
case 6:
|
||||||
pthread_mutex_destroy(&LOCK_sync);
|
pthread_mutex_destroy(&LOCK_sync);
|
||||||
@ -2790,7 +2791,7 @@ void TC_LOG_MMAP::close()
|
|||||||
case 5:
|
case 5:
|
||||||
data[0]='A'; // garble the first (signature) byte, in case my_delete fails
|
data[0]='A'; // garble the first (signature) byte, in case my_delete fails
|
||||||
case 4:
|
case 4:
|
||||||
for (uint i=0; i < npages; i++)
|
for (i=0; i < npages; i++)
|
||||||
{
|
{
|
||||||
if (pages[i].ptr == 0)
|
if (pages[i].ptr == 0)
|
||||||
break;
|
break;
|
||||||
@ -3015,7 +3016,8 @@ int TC_LOG_BINLOG::recover(IO_CACHE *log, Format_description_log_event *fdle)
|
|||||||
if (ev->get_type_code() == XID_EVENT)
|
if (ev->get_type_code() == XID_EVENT)
|
||||||
{
|
{
|
||||||
Xid_log_event *xev=(Xid_log_event *)ev;
|
Xid_log_event *xev=(Xid_log_event *)ev;
|
||||||
byte *x=memdup_root(&mem_root, (char *)& xev->xid, sizeof(xev->xid));
|
byte *x=(byte *)memdup_root(&mem_root, (char *)& xev->xid,
|
||||||
|
sizeof(xev->xid));
|
||||||
if (! x)
|
if (! x)
|
||||||
goto err2;
|
goto err2;
|
||||||
my_hash_insert(&xids, x);
|
my_hash_insert(&xids, x);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user