summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-06-28 17:26:11 +0300
committerunknown <monty@hundin.mysql.fi>2002-06-28 17:26:11 +0300
commit7311cbe7dee5980d921ec43177fd268783eb18e2 (patch)
tree27f0f967ee5f642c6cb7ecfab977612a3d7e57d3 /myisam
parenta6ca5cbb9172ba7fb56834d78d6527525a59d1c3 (diff)
downloadmariadb-git-7311cbe7dee5980d921ec43177fd268783eb18e2.tar.gz
Updated windows files (VC++ files and winmysqladmin).
Portability fixes. Removed compiler warnings. VC++Files/client/mysql.dsp: Updated to 4.0.2 VC++Files/client/mysqladmin.dsp: Updated to 4.0.2 VC++Files/client/mysqlclient.dsp: Updated to 4.0.2 VC++Files/client/mysqldump.dsp: Updated to 4.0.2 VC++Files/client/mysqlimport.dsp: Updated to 4.0.2 VC++Files/client/mysqlshow.dsp: Updated to 4.0.2 VC++Files/innobase/innobase.dsp: Updated to 4.0.2 VC++Files/libmysql/libmySQL.dsp: Updated to 4.0.2 VC++Files/libmysqltest/myTest.dsp: Updated to 4.0.2 VC++Files/merge/merge.dsp: Updated to 4.0.2 VC++Files/myisam/myisam.dsp: Updated to 4.0.2 VC++Files/mysql.dsw: Updated to 4.0.2 VC++Files/mysqlbinlog/mysqlbinlog.dsp: Updated to 4.0.2 VC++Files/mysqlcheck/mysqlcheck.dsp: Updated to 4.0.2 VC++Files/mysqlmanager/MySqlManager.dsp: Updated to 4.0.2 VC++Files/mysys/mysys.dsp: Updated to 4.0.2 VC++Files/pack_isam/pack_isam.dsp: Updated to 4.0.2 VC++Files/perror/perror.dsp: Updated to 4.0.2 VC++Files/replace/replace.dsp: Updated to 4.0.2 VC++Files/sql/mysqld.dsp: Updated to 4.0.2 VC++Files/test1/test1.dsp: Updated to 4.0.2 VC++Files/thr_insert_test/thr_insert_test.dsp: Updated to 4.0.2 VC++Files/thr_test/thr_test.dsp: Updated to 4.0.2 VC++Files/vio/vio.dsp: Updated to 4.0.2 VC++Files/zlib/zlib.dsp: Updated to 4.0.2 include/config-win.h: Added isnan() and finite() include/myisam.h: Move thr_xxx functions to myisam_priv.h myisam/mi_check.c: Portability fix. myisam/mi_locking.c: Comment cleanup myisam/myisamchk.c: Removed compiler warning myisam/myisamdef.h: Added thr_xxx functions myisam/sort.c: Portability fix sql/field.cc: Portability fix sql/sql_insert.cc: R
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_check.c12
-rw-r--r--myisam/mi_locking.c2
-rw-r--r--myisam/myisamchk.c2
-rw-r--r--myisam/myisamdef.h4
-rw-r--r--myisam/sort.c7
5 files changed, 19 insertions, 8 deletions
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index 9426a55e4d2..3c1d090f53d 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -2130,6 +2130,7 @@ int mi_repair_by_sort_r(MI_CHECK *param, register MI_INFO *info,
IO_CACHE_SHARE io_share;
SORT_INFO sort_info;
ulonglong key_map=share->state.key_map;
+ pthread_attr_t thr_attr;
DBUG_ENTER("mi_repair_by_sort_r");
start_records=info->state->records;
@@ -2307,6 +2308,9 @@ int mi_repair_by_sort_r(MI_CHECK *param, register MI_INFO *info,
pthread_mutex_lock(&sort_info.mutex);
init_io_cache_share(&param->read_cache, &io_share, i);
+ (void) pthread_attr_init(&thr_attr);
+ (void) pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED);
+
for (i=0 ; i < sort_info.total_keys ; i++)
{
sort_param[i].read_cache=param->read_cache;
@@ -2322,8 +2326,9 @@ int mi_repair_by_sort_r(MI_CHECK *param, register MI_INFO *info,
#else
param->sort_buffer_length*sort_param[i].key_length/total_key_length;
#endif
- if (pthread_create(& sort_param[i].thr, 0,
- (void *(*)(void*))_thr_find_all_keys, sort_param+i))
+ if (pthread_create(&sort_param[i].thr, &thr_attr,
+ thr_find_all_keys,
+ (void *) (sort_param+i)))
{
mi_check_print_error(param,"Cannot start a repair thread");
remove_io_thread(&param->read_cache);
@@ -2332,13 +2337,14 @@ int mi_repair_by_sort_r(MI_CHECK *param, register MI_INFO *info,
else
sort_info.threads_running++;
}
+ (void) pthread_attr_destroy(&thr_attr);
/* waiting for all threads to finish */
while (sort_info.threads_running)
pthread_cond_wait(&sort_info.cond, &sort_info.mutex);
pthread_mutex_unlock(&sort_info.mutex);
- if ((got_error= _thr_write_keys(sort_param)))
+ if ((got_error= thr_write_keys(sort_param)))
{
param->retry_repair=1;
goto err;
diff --git a/myisam/mi_locking.c b/myisam/mi_locking.c
index ea4966b05c5..cbde05d31f5 100644
--- a/myisam/mi_locking.c
+++ b/myisam/mi_locking.c
@@ -219,7 +219,7 @@ int mi_lock_database(MI_INFO *info, int lock_type)
/****************************************************************************
-** The following functions are called by thr_lock() in threaded applications
+ The following functions are called by thr_lock() in threaded applications
****************************************************************************/
void mi_get_status(void* param)
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c
index 6f12ce1536b..3432bdafd0e 100644
--- a/myisam/myisamchk.c
+++ b/myisam/myisamchk.c
@@ -99,7 +99,7 @@ int main(int argc, char **argv)
while (--argc >= 0)
{
int new_error=myisamchk(&check_param, *(argv++));
- if (check_param.testflag & T_REP_ANY != T_REP)
+ if ((check_param.testflag & T_REP_ANY) != T_REP)
check_param.testflag&= ~T_REP;
VOID(fflush(stdout));
VOID(fflush(stderr));
diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h
index b5da3d4b4c3..cef864e6efb 100644
--- a/myisam/myisamdef.h
+++ b/myisam/myisamdef.h
@@ -659,6 +659,10 @@ void mi_check_print_error _VARARGS((MI_CHECK *param, const char *fmt,...));
void mi_check_print_warning _VARARGS((MI_CHECK *param, const char *fmt,...));
void mi_check_print_info _VARARGS((MI_CHECK *param, const char *fmt,...));
int flush_pending_blocks(MI_SORT_PARAM *param);
+int thr_write_keys(MI_SORT_PARAM *sort_param);
+#ifdef THREAD
+pthread_handler_decl(thr_find_all_keys,arg);
+#endif
#ifdef __cplusplus
}
diff --git a/myisam/sort.c b/myisam/sort.c
index 65b606f7a68..e0851b062e1 100644
--- a/myisam/sort.c
+++ b/myisam/sort.c
@@ -277,8 +277,9 @@ static ha_rows NEAR_F find_all_keys(MI_SORT_PARAM *info, uint keys,
/* Search after all keys and place them in a temp. file */
-void *_thr_find_all_keys(MI_SORT_PARAM *info)
+pthread_handler_decl(thr_find_all_keys,arg)
{
+ MI_SORT_PARAM *info= (MI_SORT_PARAM*) arg;
int error;
uint memavl,old_memavl,keys,sort_length;
uint idx, maxbuffer;
@@ -401,10 +402,10 @@ ok:
pthread_cond_signal(&info->sort_info->cond);
pthread_mutex_unlock(&info->sort_info->mutex);
return NULL;
-} /* _thr_find_all_keys */
+}
-int _thr_write_keys(MI_SORT_PARAM *sort_param)
+int thr_write_keys(MI_SORT_PARAM *sort_param)
{
SORT_INFO *sort_info=sort_param->sort_info;
MI_CHECK *param=sort_info->param;