Commit 1005f0d9 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Fix inconsistently defined THR_LOCK_myisam_mmap

It was pthread_mutex_t in mi_static.c and 
mysql_mutex_t in my_thr_init.c
  
Solaris linker complains about different size of the 
symbol.
parent 890ef94c
...@@ -260,7 +260,7 @@ extern ulong myisam_bulk_insert_tree_size, myisam_data_pointer_size; ...@@ -260,7 +260,7 @@ extern ulong myisam_bulk_insert_tree_size, myisam_data_pointer_size;
/* which is normally forbidden */ /* which is normally forbidden */
extern int (*myisam_test_invalid_symlink)(const char *filename); extern int (*myisam_test_invalid_symlink)(const char *filename);
extern ulonglong myisam_mmap_size, myisam_mmap_used; extern ulonglong myisam_mmap_size, myisam_mmap_used;
extern pthread_mutex_t THR_LOCK_myisam_mmap; extern mysql_mutex_t THR_LOCK_myisam_mmap;
/* Prototypes for myisam-functions */ /* Prototypes for myisam-functions */
......
...@@ -1502,11 +1502,11 @@ my_bool _mi_memmap_file(MI_INFO *info) ...@@ -1502,11 +1502,11 @@ my_bool _mi_memmap_file(MI_INFO *info)
if (myisam_mmap_size != SIZE_T_MAX) if (myisam_mmap_size != SIZE_T_MAX)
{ {
pthread_mutex_lock(&THR_LOCK_myisam_mmap); mysql_mutex_lock(&THR_LOCK_myisam_mmap);
eom= data_file_length > myisam_mmap_size - myisam_mmap_used - MEMMAP_EXTRA_MARGIN; eom= data_file_length > myisam_mmap_size - myisam_mmap_used - MEMMAP_EXTRA_MARGIN;
if (!eom) if (!eom)
myisam_mmap_used+= data_file_length + MEMMAP_EXTRA_MARGIN; myisam_mmap_used+= data_file_length + MEMMAP_EXTRA_MARGIN;
pthread_mutex_unlock(&THR_LOCK_myisam_mmap); mysql_mutex_unlock(&THR_LOCK_myisam_mmap);
} }
else else
eom= data_file_length > myisam_mmap_size - MEMMAP_EXTRA_MARGIN; eom= data_file_length > myisam_mmap_size - MEMMAP_EXTRA_MARGIN;
...@@ -1522,9 +1522,9 @@ my_bool _mi_memmap_file(MI_INFO *info) ...@@ -1522,9 +1522,9 @@ my_bool _mi_memmap_file(MI_INFO *info)
DBUG_PRINT("warning",("File isn't extended for memmap")); DBUG_PRINT("warning",("File isn't extended for memmap"));
if (myisam_mmap_size != SIZE_T_MAX) if (myisam_mmap_size != SIZE_T_MAX)
{ {
pthread_mutex_lock(&THR_LOCK_myisam_mmap); mysql_mutex_lock(&THR_LOCK_myisam_mmap);
myisam_mmap_used-= data_file_length + MEMMAP_EXTRA_MARGIN; myisam_mmap_used-= data_file_length + MEMMAP_EXTRA_MARGIN;
pthread_mutex_unlock(&THR_LOCK_myisam_mmap); mysql_mutex_unlock(&THR_LOCK_myisam_mmap);
} }
DBUG_RETURN(0); DBUG_RETURN(0);
} }
...@@ -1534,9 +1534,9 @@ my_bool _mi_memmap_file(MI_INFO *info) ...@@ -1534,9 +1534,9 @@ my_bool _mi_memmap_file(MI_INFO *info)
{ {
if (myisam_mmap_size != SIZE_T_MAX) if (myisam_mmap_size != SIZE_T_MAX)
{ {
pthread_mutex_lock(&THR_LOCK_myisam_mmap); mysql_mutex_lock(&THR_LOCK_myisam_mmap);
myisam_mmap_used-= data_file_length + MEMMAP_EXTRA_MARGIN; myisam_mmap_used-= data_file_length + MEMMAP_EXTRA_MARGIN;
pthread_mutex_unlock(&THR_LOCK_myisam_mmap); mysql_mutex_unlock(&THR_LOCK_myisam_mmap);
} }
DBUG_RETURN(0); DBUG_RETURN(0);
} }
...@@ -1555,9 +1555,9 @@ void _mi_unmap_file(MI_INFO *info) ...@@ -1555,9 +1555,9 @@ void _mi_unmap_file(MI_INFO *info)
if (myisam_mmap_size != SIZE_T_MAX) if (myisam_mmap_size != SIZE_T_MAX)
{ {
pthread_mutex_lock(&THR_LOCK_myisam_mmap); mysql_mutex_lock(&THR_LOCK_myisam_mmap);
myisam_mmap_used-= info->s->mmaped_length + MEMMAP_EXTRA_MARGIN; myisam_mmap_used-= info->s->mmaped_length + MEMMAP_EXTRA_MARGIN;
pthread_mutex_unlock(&THR_LOCK_myisam_mmap); mysql_mutex_unlock(&THR_LOCK_myisam_mmap);
} }
} }
......
...@@ -41,7 +41,7 @@ my_off_t myisam_max_temp_length= MAX_FILE_SIZE; ...@@ -41,7 +41,7 @@ my_off_t myisam_max_temp_length= MAX_FILE_SIZE;
ulong myisam_bulk_insert_tree_size=8192*1024; ulong myisam_bulk_insert_tree_size=8192*1024;
ulong myisam_data_pointer_size=4; ulong myisam_data_pointer_size=4;
ulonglong myisam_mmap_size= SIZE_T_MAX, myisam_mmap_used= 0; ulonglong myisam_mmap_size= SIZE_T_MAX, myisam_mmap_used= 0;
pthread_mutex_t THR_LOCK_myisam_mmap; mysql_mutex_t THR_LOCK_myisam_mmap;
static int always_valid(const char *filename __attribute__((unused))) static int always_valid(const char *filename __attribute__((unused)))
{ {
......
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