summaryrefslogtreecommitdiff
path: root/storage/maria
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-11-24 18:48:58 +0200
committerMichael Widenius <monty@askmonty.org>2011-11-24 18:48:58 +0200
commit69204571425ed3221e94c7eb1e030c00089bca26 (patch)
tree3d9cfbc44a057883c7db6bce267c8ebfd5fa9313 /storage/maria
parente3e60a4102d6918e4231e402bef89b1a6b2a20cb (diff)
parentd26aefb0775048128495eaab151ee4118f8f7afd (diff)
downloadmariadb-git-69204571425ed3221e94c7eb1e030c00089bca26.tar.gz
Merge with MariaDB 5.1
Diffstat (limited to 'storage/maria')
-rw-r--r--storage/maria/ma_bitmap.c4
-rw-r--r--storage/maria/ma_blockrec.c11
-rw-r--r--storage/maria/ma_check.c14
-rw-r--r--storage/maria/ma_ft_boolean_search.c2
-rw-r--r--storage/maria/ma_ft_nlq_search.c2
-rw-r--r--storage/maria/ma_ft_update.c2
-rw-r--r--storage/maria/ma_key_recover.c3
-rw-r--r--storage/maria/ma_loghandler.c8
-rw-r--r--storage/maria/ma_open.c3
-rw-r--r--storage/maria/ma_rt_split.c2
-rw-r--r--storage/maria/ma_write.c10
-rw-r--r--storage/maria/maria_pack.c2
12 files changed, 28 insertions, 35 deletions
diff --git a/storage/maria/ma_bitmap.c b/storage/maria/ma_bitmap.c
index 39c3cd27d33..18ea1fc3997 100644
--- a/storage/maria/ma_bitmap.c
+++ b/storage/maria/ma_bitmap.c
@@ -1413,7 +1413,7 @@ static ulong allocate_full_pages(MARIA_FILE_BITMAP *bitmap,
uchar *page_end= data + bitmap->total_size;
uchar *best_data= 0;
uint min_size;
- uint best_area_size, best_prefix_area_size, best_suffix_area_size;
+ uint best_area_size, best_prefix_area_size;
uint page, size;
ulonglong best_prefix_bits;
DBUG_ENTER("allocate_full_pages");
@@ -1422,7 +1422,6 @@ static ulong allocate_full_pages(MARIA_FILE_BITMAP *bitmap,
/* Following variables are only used if best_data is set */
LINT_INIT(best_prefix_bits);
LINT_INIT(best_prefix_area_size);
- LINT_INIT(best_suffix_area_size);
min_size= pages_needed;
if (!full_page && min_size > BLOB_SEGMENT_MIN_SIZE)
@@ -1494,7 +1493,6 @@ static ulong allocate_full_pages(MARIA_FILE_BITMAP *bitmap,
best_area_size= area_size;
best_prefix_bits= prefix_bits;
best_prefix_area_size= prefix_area_size;
- best_suffix_area_size= suffix_area_size;
/* Prefer to put data in biggest possible area */
if (area_size <= pages_needed)
diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c
index ad5ec3fe2b9..6165e211566 100644
--- a/storage/maria/ma_blockrec.c
+++ b/storage/maria/ma_blockrec.c
@@ -5014,7 +5014,8 @@ static my_bool read_row_extent_info(MARIA_HA *info, uchar *buff,
MARIA_EXTENT_CURSOR extent;
MARIA_RECORD_POS *tail_pos;
uchar *data, *end_of_data;
- uint flag, row_extents, row_extents_size, field_lengths;
+ uint flag, row_extents, row_extents_size;
+ uint field_lengths __attribute__ ((unused));
uchar *extents, *end;
DBUG_ENTER("read_row_extent_info");
@@ -5049,6 +5050,10 @@ static my_bool read_row_extent_info(MARIA_HA *info, uchar *buff,
}
info->cur_row.extents_count= row_extents;
+ /*
+ field_lengths looks unused but get_key_length will
+ increment data, which is required as data it's used later.
+ */
if (share->base.max_field_lengths)
get_key_length(field_lengths, data);
@@ -6749,11 +6754,11 @@ uint _ma_apply_redo_insert_row_blobs(MARIA_HA *info,
uint i;
uint res;
uint page_range;
- pgcache_page_no_t page, start_page;
+ pgcache_page_no_t page;
uchar *buff;
uint data_on_page= data_size;
- start_page= page= page_korr(header);
+ page= page_korr(header);
header+= PAGE_STORE_SIZE;
page_range= pagerange_korr(header);
header+= PAGERANGE_STORE_SIZE;
diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c
index f4470f846f5..ef6484adbe9 100644
--- a/storage/maria/ma_check.c
+++ b/storage/maria/ma_check.c
@@ -5525,7 +5525,7 @@ static int sort_maria_ft_key_write(MARIA_SORT_PARAM *sort_param,
SORT_KEY_BLOCKS *key_block= sort_info->key_block;
MARIA_SHARE *share= sort_info->info->s;
- val_len=HA_FT_WLEN+share->base.rec_reflength;
+ val_len=HA_FT_WLEN+share->rec_reflength;
get_key_full_length_rdonly(a_len, a);
if (!ft_buf)
@@ -5535,7 +5535,7 @@ static int sort_maria_ft_key_write(MARIA_SORT_PARAM *sort_param,
and row format is NOT static - for _ma_dpointer not to garble offsets
*/
if ((share->base.key_reflength <=
- share->base.rec_reflength) &&
+ share->rec_reflength) &&
(share->options &
(HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)))
ft_buf= (SORT_FT_BUF *)my_malloc(sort_param->keyinfo->block_length +
@@ -5627,7 +5627,7 @@ static int sort_insert_key(MARIA_SORT_PARAM *sort_param,
my_off_t prev_block)
{
uint a_length,t_length,nod_flag;
- my_off_t filepos,key_file_length;
+ my_off_t filepos;
uchar *anc_buff,*lastkey;
MARIA_KEY_PARAM s_temp;
MARIA_KEYDEF *keyinfo=sort_param->keyinfo;
@@ -5673,8 +5673,8 @@ static int sort_insert_key(MARIA_SORT_PARAM *sort_param,
tmp_key.keyinfo= keyinfo;
tmp_key.data= (uchar*) key;
- tmp_key.data_length= _ma_keylength(keyinfo, key) - share->base.rec_reflength;
- tmp_key.ref_length= share->base.rec_reflength;
+ tmp_key.data_length= _ma_keylength(keyinfo, key) - share->rec_reflength;
+ tmp_key.ref_length= share->rec_reflength;
t_length= (*keyinfo->pack_key)(&tmp_key, nod_flag,
(uchar*) 0, lastkey, lastkey, &s_temp);
@@ -5695,7 +5695,6 @@ static int sort_insert_key(MARIA_SORT_PARAM *sort_param,
_ma_store_page_used(share, anc_buff, key_block->last_length);
bzero(anc_buff+key_block->last_length,
keyinfo->block_length- key_block->last_length);
- key_file_length=share->state.state.key_file_length;
if ((filepos= _ma_new(info, DFLT_INIT_HITS, &page_link)) == HA_OFFSET_ERROR)
DBUG_RETURN(1);
_ma_fast_unlock_key_del(info);
@@ -5806,7 +5805,7 @@ static int sort_delete_record(MARIA_SORT_PARAM *sort_param)
int _ma_flush_pending_blocks(MARIA_SORT_PARAM *sort_param)
{
uint nod_flag,length;
- my_off_t filepos,key_file_length;
+ my_off_t filepos;
SORT_KEY_BLOCKS *key_block;
MARIA_SORT_INFO *sort_info= sort_param->sort_info;
myf myf_rw=sort_info->param->myf_rw;
@@ -5823,7 +5822,6 @@ int _ma_flush_pending_blocks(MARIA_SORT_PARAM *sort_param)
length= _ma_get_page_used(info->s, key_block->buff);
if (nod_flag)
_ma_kpointer(info,key_block->end_pos,filepos);
- key_file_length= info->s->state.state.key_file_length;
bzero(key_block->buff+length, keyinfo->block_length-length);
if ((filepos= _ma_new(info, DFLT_INIT_HITS, &page_link)) ==
HA_OFFSET_ERROR)
diff --git a/storage/maria/ma_ft_boolean_search.c b/storage/maria/ma_ft_boolean_search.c
index 35a34d32713..208b39f3b32 100644
--- a/storage/maria/ma_ft_boolean_search.c
+++ b/storage/maria/ma_ft_boolean_search.c
@@ -344,7 +344,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
int subkeys=1;
my_bool can_go_down;
MARIA_HA *info=ftb->info;
- uint off, extra=HA_FT_WLEN+info->s->base.rec_reflength;
+ uint off, extra=HA_FT_WLEN+info->s->rec_reflength;
uchar *lastkey_buf= ftbw->word+ftbw->off;
MARIA_KEY key;
LINT_INIT(off);
diff --git a/storage/maria/ma_ft_nlq_search.c b/storage/maria/ma_ft_nlq_search.c
index 927f34f8b72..e0e1e2ce0d3 100644
--- a/storage/maria/ma_ft_nlq_search.c
+++ b/storage/maria/ma_ft_nlq_search.c
@@ -74,7 +74,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
uchar *keybuff= aio->keybuff;
MARIA_KEYDEF *keyinfo= info->s->keyinfo+aio->keynr;
my_off_t key_root=info->s->state.key_root[aio->keynr];
- uint extra=HA_FT_WLEN+info->s->base.rec_reflength;
+ uint extra=HA_FT_WLEN+info->s->rec_reflength;
MARIA_KEY key;
#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT
float tmp_weight;
diff --git a/storage/maria/ma_ft_update.c b/storage/maria/ma_ft_update.c
index f38990efab9..e99366033b4 100644
--- a/storage/maria/ma_ft_update.c
+++ b/storage/maria/ma_ft_update.c
@@ -364,7 +364,7 @@ my_bool _ma_ft_convert_to_ft2(MARIA_HA *info, MARIA_KEY *key)
for (key_ptr+=length; key_ptr < end; key_ptr+=keyinfo->keylength)
{
tmp_key.data= key_ptr;
- if (_ma_ck_real_write_btree(info, key, &root, SEARCH_SAME))
+ if (_ma_ck_real_write_btree(info, &tmp_key, &root, SEARCH_SAME))
DBUG_RETURN(1);
}
diff --git a/storage/maria/ma_key_recover.c b/storage/maria/ma_key_recover.c
index 71af3a011e3..48bb9cb13d0 100644
--- a/storage/maria/ma_key_recover.c
+++ b/storage/maria/ma_key_recover.c
@@ -944,7 +944,7 @@ uint _ma_apply_redo_index(MARIA_HA *info,
uchar *buff;
const uchar *header_end= header + head_length;
uint page_offset= 0, org_page_length;
- uint nod_flag, page_length, keypage_header, keynr;
+ uint page_length, keypage_header, keynr;
uint max_page_size= share->max_index_block_size;
int result;
MARIA_PAGE page;
@@ -972,7 +972,6 @@ uint _ma_apply_redo_index(MARIA_HA *info,
keynr= _ma_get_keynr(share, buff);
_ma_page_setup(&page, info, share->keyinfo + keynr, page_pos, buff);
- nod_flag= page.node;
org_page_length= page_length= page.size;
keypage_header= share->keypage_header;
diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c
index a01e0949b68..6f70fdf34cf 100644
--- a/storage/maria/ma_loghandler.c
+++ b/storage/maria/ma_loghandler.c
@@ -2608,14 +2608,14 @@ static my_bool translog_buffer_flush(struct st_translog_buffer *buffer)
i < buffer->size;
i+= TRANSLOG_PAGE_SIZE, pg++)
{
+#ifndef DBUG_OFF
TRANSLOG_ADDRESS addr= (buffer->offset + i);
- TRANSLOG_VALIDATOR_DATA data;
+#endif
DBUG_PRINT("info", ("send log form %lu till %lu address: (%lu,0x%lx) "
"page #: %lu buffer size: %lu buffer: 0x%lx",
(ulong) i, (ulong) (i + TRANSLOG_PAGE_SIZE),
LSN_IN_PARTS(addr), (ulong) pg, (ulong) buffer->size,
(ulong) buffer));
- data.addr= &addr;
DBUG_ASSERT(log_descriptor.pagecache->block_size == TRANSLOG_PAGE_SIZE);
DBUG_ASSERT(i + TRANSLOG_PAGE_SIZE <= buffer->size);
if (translog_status != TRANSLOG_OK && translog_status != TRANSLOG_SHUTDOWN)
@@ -6557,16 +6557,12 @@ my_bool translog_scanner_init(LSN lsn,
TRANSLOG_SCANNER_DATA *scanner,
my_bool use_direct)
{
- TRANSLOG_VALIDATOR_DATA data;
DBUG_ENTER("translog_scanner_init");
DBUG_PRINT("enter", ("Scanner: 0x%lx LSN: (%lu,0x%lx)",
(ulong) scanner, LSN_IN_PARTS(lsn)));
DBUG_ASSERT(translog_status == TRANSLOG_OK ||
translog_status == TRANSLOG_READONLY);
- data.addr= &scanner->page_addr;
- data.was_recovered= 0;
-
scanner->page_offset= LSN_OFFSET(lsn) % TRANSLOG_PAGE_SIZE;
scanner->fixed_horizon= fixed_horizon;
diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c
index 498904f89a7..3f15749ced5 100644
--- a/storage/maria/ma_open.c
+++ b/storage/maria/ma_open.c
@@ -1834,8 +1834,7 @@ int _ma_open_datafile(MARIA_HA *info, MARIA_SHARE *share, const char *org_name,
}
info->dfile.file= share->bitmap.file.file=
- my_open(share->data_file_name.str, share->mode | O_SHARE,
- MYF(MY_WME));
+ my_open(data_name, share->mode | O_SHARE, MYF(MY_WME));
return info->dfile.file >= 0 ? 0 : 1;
}
diff --git a/storage/maria/ma_rt_split.c b/storage/maria/ma_rt_split.c
index 6f32a60c073..ea90b60ce12 100644
--- a/storage/maria/ma_rt_split.c
+++ b/storage/maria/ma_rt_split.c
@@ -380,7 +380,6 @@ int maria_rtree_split_page(const MARIA_KEY *key, MARIA_PAGE *page,
SplitStruct *stop;
double *coord_buf;
double *next_coord;
- double *old_coord;
int n_dim;
uchar *source_cur, *cur1, *cur2;
uchar *new_page_buff, *log_internal_copy, *log_internal_copy_ptr,
@@ -426,7 +425,6 @@ int maria_rtree_split_page(const MARIA_KEY *key, MARIA_PAGE *page,
maria_rtree_d_mbr(keyinfo->seg, key->data, key_data_length, cur->coords);
cur->key= key->data;
- old_coord= next_coord;
if (split_maria_rtree_node(task, max_keys + 1,
page->size + full_length + 2,
diff --git a/storage/maria/ma_write.c b/storage/maria/ma_write.c
index 629e07b872d..322bc4fcf20 100644
--- a/storage/maria/ma_write.c
+++ b/storage/maria/ma_write.c
@@ -364,9 +364,11 @@ err:
else
{
MARIA_KEY key;
- if (_ma_ck_delete(info,
- (*keyinfo->make_key)(info, &key, i, buff, record,
- filepos, info->trn->trid)))
+ if (keyinfo->ck_delete(info,
+ (*keyinfo->make_key)(info, &key, i, buff,
+ record,
+ filepos,
+ info->trn->trid)))
{
if (local_lock_tree)
rw_unlock(&keyinfo->root_lock);
@@ -834,7 +836,7 @@ int _ma_insert(register MARIA_HA *info, MARIA_KEY *key,
{
if (share->max_index_block_size - a_length < 32 &&
(keyinfo->flag & HA_FULLTEXT) && key_pos == endpos &&
- share->base.key_reflength <= share->base.rec_reflength &&
+ share->base.key_reflength <= share->rec_reflength &&
share->options & (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD))
{
/*
diff --git a/storage/maria/maria_pack.c b/storage/maria/maria_pack.c
index 983a38e69e7..c87ecfa7776 100644
--- a/storage/maria/maria_pack.c
+++ b/storage/maria/maria_pack.c
@@ -3070,7 +3070,6 @@ static int mrg_rrnd(PACK_MRG_INFO *info,uchar *buf)
{
int error;
MARIA_HA *isam_info;
- my_off_t filepos;
if (!info->current)
{
@@ -3095,7 +3094,6 @@ static int mrg_rrnd(PACK_MRG_INFO *info,uchar *buf)
return(HA_ERR_END_OF_FILE);
info->current++;
isam_info= *info->current;
- filepos=isam_info->s->pack.header_length;
maria_reset(isam_info);
maria_extra(isam_info,HA_EXTRA_CACHE, 0);
if ((error= maria_scan_init(isam_info)))