summaryrefslogtreecommitdiff
path: root/storage/myisam
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-03-17 13:06:41 +0100
committerSergei Golubchik <serg@mariadb.org>2019-03-17 13:06:41 +0100
commitb64fde8f38515dc39e019de26db7624cc0ea7046 (patch)
tree0478ea4c3ddeee290f6d381a47efa4f9aded9c0b /storage/myisam
parenta89ee3cd154a67df2231f034fd8339f9225dbe64 (diff)
parent1f020299f816263e347c852eb2a494b5ef1cbf0d (diff)
downloadmariadb-git-b64fde8f38515dc39e019de26db7624cc0ea7046.tar.gz
Merge branch '10.2' into 10.3
Diffstat (limited to 'storage/myisam')
-rw-r--r--storage/myisam/mi_write.c15
-rw-r--r--storage/myisam/myisamlog.c10
2 files changed, 13 insertions, 12 deletions
diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c
index 81af85acfc2..9658f8458c4 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 int 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;
@@ -951,14 +952,15 @@ static int keys_free(uchar *key, TREE_FREE mode, bulk_insert_param *param)
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 0;
case free_end:
if (param->info->s->concurrent_insert)
mysql_rwlock_unlock(&param->info->s->key_root_lock[param->keynr]);
return 0;
}
- return -1;
+ return 0;
}
@@ -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 eb06c75f0e0..51884c3ecca 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 int 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 int file_info_free(void* arg, TREE_FREE mode, void *unused)
{
+ struct file_info *fileinfo= arg;
DBUG_ENTER("file_info_free");
if (update)
{
@@ -763,7 +763,7 @@ static void file_info_free(struct file_info *fileinfo)
}
my_free(fileinfo->name);
my_free(fileinfo->show_name);
- DBUG_VOID_RETURN;
+ DBUG_RETURN(0);
}