summaryrefslogtreecommitdiff
path: root/storage/myisam
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-03-15 20:00:28 +0100
committerSergei Golubchik <serg@mariadb.org>2019-03-15 21:00:41 +0100
commit0508d327aef520d3131ff8a85ed610337149fffc (patch)
tree7e04769f49b4aded9053adcad442fe00eb487d98 /storage/myisam
parentbb8c82c66abddf796e8d44f817518e5ab38ae6e4 (diff)
parent34db9958e28c325b0f708f78b7ff029de810d5ea (diff)
downloadmariadb-git-0508d327aef520d3131ff8a85ed610337149fffc.tar.gz
Merge branch '10.1' into 10.2
Diffstat (limited to 'storage/myisam')
-rw-r--r--storage/myisam/mi_write.c19
-rw-r--r--storage/myisam/myisamlog.c8
2 files changed, 14 insertions, 13 deletions
diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c
index 3ba25d84e62..edcb7623217 100644
--- a/storage/myisam/mi_write.c
+++ b/storage/myisam/mi_write.c
@@ -929,13 +929,14 @@ static int keys_compare(bulk_insert_param *param, uchar *key1, uchar *key2)
}
-static int keys_free(uchar *key, TREE_FREE mode, bulk_insert_param *param)
+static void keys_free(void* key_arg, TREE_FREE mode, void *param_arg)
{
/*
Probably I can use info->lastkey here, but I'm not sure,
and to be safe I'd better use local lastkey.
*/
- uchar lastkey[HA_MAX_KEY_BUFF];
+ bulk_insert_param *param= (bulk_insert_param*)param_arg;
+ uchar lastkey[HA_MAX_KEY_BUFF], *key= (uchar*)key_arg;
uint keylen;
MI_KEYDEF *keyinfo;
@@ -946,19 +947,20 @@ static int keys_free(uchar *key, TREE_FREE mode, bulk_insert_param *param)
mysql_rwlock_wrlock(&param->info->s->key_root_lock[param->keynr]);
param->info->s->keyinfo[param->keynr].version++;
}
- return 0;
+ return;
case free_free:
keyinfo=param->info->s->keyinfo+param->keynr;
keylen=_mi_keylength(keyinfo, key);
memcpy(lastkey, key, keylen);
- return _mi_ck_write_btree(param->info,param->keynr,lastkey,
- keylen - param->info->s->rec_reflength);
+ _mi_ck_write_btree(param->info, param->keynr, lastkey,
+ keylen - param->info->s->rec_reflength);
+ return;
case free_end:
if (param->info->s->concurrent_insert)
mysql_rwlock_unlock(&param->info->s->key_root_lock[param->keynr]);
- return 0;
+ return;
}
- return -1;
+ return;
}
@@ -1014,8 +1016,7 @@ int mi_init_bulk_insert(MI_INFO *info, size_t cache_size, ha_rows rows)
init_tree(&info->bulk_insert[i],
cache_size * key[i].maxlength,
cache_size * key[i].maxlength, 0,
- (qsort_cmp2)keys_compare,
- (tree_element_free) keys_free, (void *)params++, MYF(0));
+ (qsort_cmp2)keys_compare, keys_free, (void *)params++, MYF(0));
}
else
info->bulk_insert[i].root=0;
diff --git a/storage/myisam/myisamlog.c b/storage/myisam/myisamlog.c
index 7ce03ca9485..f059d6f4c70 100644
--- a/storage/myisam/myisamlog.c
+++ b/storage/myisam/myisamlog.c
@@ -63,7 +63,7 @@ static int test_if_open(struct file_info *key,element_count count,
static void fix_blob_pointers(MI_INFO *isam,uchar *record);
static int test_when_accessed(struct file_info *key,element_count count,
struct st_access_param *access_param);
-static void file_info_free(struct file_info *info);
+static void file_info_free(void*, TREE_FREE, void *);
static int close_some_file(TREE *tree);
static int reopen_closed_file(TREE *tree,struct file_info *file_info);
static int find_record_with_key(struct file_info *file_info,uchar *record);
@@ -330,8 +330,7 @@ static int examine_log(char * file_name, char **table_names)
init_io_cache(&cache,file,0,READ_CACHE,start_offset,0,MYF(0));
bzero((uchar*) com_count,sizeof(com_count));
init_tree(&tree,0,0,sizeof(file_info),(qsort_cmp2) file_info_compare,
- (tree_element_free) file_info_free, NULL,
- MYF(MY_TREE_WITH_DELETE));
+ file_info_free, NULL, MYF(MY_TREE_WITH_DELETE));
(void) init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,KEY_CACHE_SIZE,
0, 0, 0, 0);
@@ -751,8 +750,9 @@ static int test_when_accessed (struct file_info *key,
}
-static void file_info_free(struct file_info *fileinfo)
+static void file_info_free(void* arg, TREE_FREE mode, void *unused)
{
+ struct file_info *fileinfo= arg;
DBUG_ENTER("file_info_free");
if (update)
{