mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
make myisam usable without threads (and even w/o pthread_t)
This commit is contained in:
@ -366,14 +366,18 @@ typedef struct st_sort_info
|
||||
SORT_KEY_BLOCKS *key_block,*key_block_end;
|
||||
/* sync things*/
|
||||
uint got_error, threads_running;
|
||||
#ifdef THREAD
|
||||
pthread_mutex_t mutex;
|
||||
pthread_cond_t cond;
|
||||
#endif
|
||||
} SORT_INFO;
|
||||
|
||||
|
||||
typedef struct st_mi_sort_param
|
||||
{
|
||||
#ifdef THREAD
|
||||
pthread_t thr;
|
||||
#endif
|
||||
IO_CACHE read_cache, tempfile, tempfile_for_exceptions;
|
||||
DYNAMIC_ARRAY buffpek;
|
||||
ulonglong unique[MI_MAX_KEY_SEG+1];
|
||||
|
@ -2109,7 +2109,7 @@ err:
|
||||
Threaded repair of table using sorting
|
||||
|
||||
SYNOPSIS
|
||||
mi_repair_by_sort_r()
|
||||
mi_repair_parallel()
|
||||
param Repair parameters
|
||||
info MyISAM handler to repair
|
||||
name Name of table (for warnings)
|
||||
@ -2128,6 +2128,9 @@ err:
|
||||
int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
|
||||
const char * name, int rep_quick)
|
||||
{
|
||||
#ifndef THREAD
|
||||
return mi_repair_by_sort(param, info, name, rep_quick);
|
||||
#else
|
||||
int got_error;
|
||||
uint i,key, total_key_length, istep;
|
||||
ulong rec_length;
|
||||
@ -2489,6 +2492,7 @@ err:
|
||||
share->pack.header_length=0;
|
||||
}
|
||||
DBUG_RETURN(got_error);
|
||||
#endif /* THREAD */
|
||||
}
|
||||
|
||||
/* Read next record and return next key */
|
||||
|
@ -275,6 +275,7 @@ static ha_rows NEAR_F find_all_keys(MI_SORT_PARAM *info, uint keys,
|
||||
} /* find_all_keys */
|
||||
|
||||
|
||||
#ifdef THREAD
|
||||
/* Search after all keys and place them in a temp. file */
|
||||
|
||||
pthread_handler_decl(thr_find_all_keys,arg)
|
||||
@ -542,6 +543,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
|
||||
my_free((gptr) mergebuf,MYF(MY_ALLOW_ZERO_PTR));
|
||||
return got_error;
|
||||
}
|
||||
#endif /* THREAD */
|
||||
|
||||
/* Write all keys in memory to file for later merge */
|
||||
|
||||
|
Reference in New Issue
Block a user