Commit 50e27881 authored by unknown's avatar unknown

Merge bk-internal.mysql.com:/home/bk/mysql-maria

into  mysql.com:/home/my/mysql-maria


mysys/my_getsystime.c:
  Auto merged
parents bb7d835b 89ff50d4
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
typedef struct st_used_mem typedef struct st_used_mem
{ /* struct for once_alloc (block) */ { /* struct for once_alloc (block) */
struct st_used_mem *next; /* Next block in use */ struct st_used_mem *next; /* Next block in use */
unsigned int left; /* memory left in block */ size_t left; /* memory left in block */
unsigned int size; /* size of block */ size_t size; /* size of block */
} USED_MEM; } USED_MEM;
...@@ -39,12 +39,12 @@ typedef struct st_mem_root ...@@ -39,12 +39,12 @@ typedef struct st_mem_root
/* if block have less memory it will be put in 'used' list */ /* if block have less memory it will be put in 'used' list */
size_t min_malloc; size_t min_malloc;
size_t block_size; /* initial block size */ size_t block_size; /* initial block size */
unsigned int block_num; /* allocated blocks counter */ unsigned long block_num; /* allocated blocks counter */
/* /*
first free block in queue test counter (if it exceed first free block in queue test counter (if it exceed
MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list) MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list)
*/ */
unsigned int first_block_usage; unsigned long first_block_usage;
void (*error_handler)(void); void (*error_handler)(void);
} MEM_ROOT; } MEM_ROOT;
......
...@@ -527,7 +527,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count) ...@@ -527,7 +527,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
{ {
if (Count) if (Count)
{ {
info->error= left_length; /* We only got this many char */ info->error= (int) left_length; /* We only got this many char */
DBUG_RETURN(1); DBUG_RETURN(1);
} }
length=0; /* Didn't read any chars */ length=0; /* Didn't read any chars */
...@@ -1255,7 +1255,7 @@ int _my_b_seq_read(register IO_CACHE *info, uchar *Buffer, size_t Count) ...@@ -1255,7 +1255,7 @@ int _my_b_seq_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
info->append_read_pos += copy_len; info->append_read_pos += copy_len;
Count -= copy_len; Count -= copy_len;
if (Count) if (Count)
info->error = save_count - Count; info->error= (int) (save_count - Count);
/* Fill read buffer with data from write buffer */ /* Fill read buffer with data from write buffer */
memcpy(info->buffer, info->append_read_pos, memcpy(info->buffer, info->append_read_pos,
...@@ -1644,8 +1644,8 @@ int my_block_write(register IO_CACHE *info, const uchar *Buffer, size_t Count, ...@@ -1644,8 +1644,8 @@ int my_block_write(register IO_CACHE *info, const uchar *Buffer, size_t Count,
{ {
/* Of no overlap, write everything without buffering */ /* Of no overlap, write everything without buffering */
if (pos + Count <= info->pos_in_file) if (pos + Count <= info->pos_in_file)
return my_pwrite(info->file, Buffer, Count, pos, return (int) my_pwrite(info->file, Buffer, Count, pos,
info->myflags | MY_NABP); info->myflags | MY_NABP);
/* Write the part of the block that is before buffer */ /* Write the part of the block that is before buffer */
length= (uint) (info->pos_in_file - pos); length= (uint) (info->pos_in_file - pos);
if (my_pwrite(info->file, Buffer, length, pos, info->myflags | MY_NABP)) if (my_pwrite(info->file, Buffer, length, pos, info->myflags | MY_NABP))
......
...@@ -67,7 +67,7 @@ uchar *my_compress_alloc(const uchar *packet, size_t *len, size_t *complen) ...@@ -67,7 +67,7 @@ uchar *my_compress_alloc(const uchar *packet, size_t *len, size_t *complen)
if (!(compbuf= (uchar *) my_malloc(*complen, MYF(MY_WME)))) if (!(compbuf= (uchar *) my_malloc(*complen, MYF(MY_WME))))
return 0; /* Not enough memory */ return 0; /* Not enough memory */
tmp_complen= *complen; tmp_complen= (uLongf) *complen;
res= compress((Bytef*) compbuf, &tmp_complen, (Bytef*) packet, (uLong) *len); res= compress((Bytef*) compbuf, &tmp_complen, (Bytef*) packet, (uLong) *len);
*complen= tmp_complen; *complen= tmp_complen;
...@@ -118,7 +118,7 @@ my_bool my_uncompress(uchar *packet, size_t len, size_t *complen) ...@@ -118,7 +118,7 @@ my_bool my_uncompress(uchar *packet, size_t len, size_t *complen)
if (!compbuf) if (!compbuf)
DBUG_RETURN(1); /* Not enough memory */ DBUG_RETURN(1); /* Not enough memory */
tmp_complen= *complen; tmp_complen= (uLongf) *complen;
error= uncompress((Bytef*) compbuf, &tmp_complen, (Bytef*) packet, error= uncompress((Bytef*) compbuf, &tmp_complen, (Bytef*) packet,
(uLong) len); (uLong) len);
*complen= tmp_complen; *complen= tmp_complen;
......
...@@ -231,4 +231,3 @@ time_t my_time_possible_from_micro(ulonglong microtime __attribute__((unused))) ...@@ -231,4 +231,3 @@ time_t my_time_possible_from_micro(ulonglong microtime __attribute__((unused)))
return (time_t) (microtime / 1000000); return (time_t) (microtime / 1000000);
#endif /* defined(__WIN__) */ #endif /* defined(__WIN__) */
} }
...@@ -44,8 +44,8 @@ struct st_irem ...@@ -44,8 +44,8 @@ struct st_irem
struct st_irem *next; /* Linked list of structures */ struct st_irem *next; /* Linked list of structures */
struct st_irem *prev; /* Other link */ struct st_irem *prev; /* Other link */
char *filename; /* File in which memory was new'ed */ char *filename; /* File in which memory was new'ed */
size_t datasize; /* Size requested */
uint32 linenum; /* Line number in above file */ uint32 linenum; /* Line number in above file */
uint32 datasize; /* Size requested */
uint32 SpecialValue; /* Underrun marker value */ uint32 SpecialValue; /* Underrun marker value */
}; };
......
...@@ -404,14 +404,16 @@ void TERMINATE(FILE *file, uint flag) ...@@ -404,14 +404,16 @@ void TERMINATE(FILE *file, uint flag)
if (file) if (file)
{ {
fprintf(file, fprintf(file,
"\t%6u bytes at 0x%09lx, allocated at line %4u in '%s'", "\t%6lu bytes at 0x%09lx, allocated at line %4u in '%s'",
irem->datasize, (long) data, irem->linenum, irem->filename); (ulong) irem->datasize, (long) data,
irem->linenum, irem->filename);
fprintf(file, "\n"); fprintf(file, "\n");
(void) fflush(file); (void) fflush(file);
} }
DBUG_PRINT("safe", DBUG_PRINT("safe",
("%6u bytes at 0x%09lx, allocated at line %4d in '%s'", ("%6lu bytes at 0x%09lx, allocated at line %4d in '%s'",
irem->datasize, (long) data, irem->linenum, irem->filename)); (ulong) irem->datasize, (long) data,
irem->linenum, irem->filename));
irem= irem->next; irem= irem->next;
} }
} }
...@@ -445,8 +447,9 @@ void sf_malloc_report_allocated(void *memory) ...@@ -445,8 +447,9 @@ void sf_malloc_report_allocated(void *memory)
sf_malloc_prehunc); sf_malloc_prehunc);
if (data <= (char*) memory && (char*) memory <= data + irem->datasize) if (data <= (char*) memory && (char*) memory <= data + irem->datasize)
{ {
printf("%u bytes at 0x%lx, allocated at line %u in '%s'\n", printf("%lu bytes at 0x%lx, allocated at line %u in '%s'\n",
irem->datasize, (long) data, irem->linenum, irem->filename); (ulong) irem->datasize, (long) data,
irem->linenum, irem->filename);
break; break;
} }
} }
......
...@@ -914,7 +914,7 @@ static void fill_block(MARIA_FILE_BITMAP *bitmap, ...@@ -914,7 +914,7 @@ static void fill_block(MARIA_FILE_BITMAP *bitmap,
uchar *data; uchar *data;
/* For each 6 bytes we have 6*8/3= 16 patterns */ /* For each 6 bytes we have 6*8/3= 16 patterns */
page= (best_data - bitmap->map) / 6 * 16 + best_pos; page= ((uint) (best_data - bitmap->map)) / 6 * 16 + best_pos;
DBUG_ASSERT(page + 1 < bitmap->pages_covered); DBUG_ASSERT(page + 1 < bitmap->pages_covered);
block->page= bitmap->page + 1 + page; block->page= bitmap->page + 1 + page;
block->page_count= TAIL_PAGE_COUNT_MARKER; block->page_count= TAIL_PAGE_COUNT_MARKER;
...@@ -1171,7 +1171,7 @@ static ulong allocate_full_pages(MARIA_FILE_BITMAP *bitmap, ...@@ -1171,7 +1171,7 @@ static ulong allocate_full_pages(MARIA_FILE_BITMAP *bitmap,
if ((bits= uint6korr(data))) if ((bits= uint6korr(data)))
break; break;
} }
area_size= (data - data_start) / 6 * 16; area_size= (uint) (data - data_start) / 6 * 16;
if (area_size >= best_area_size) if (area_size >= best_area_size)
continue; continue;
prefix_area_size= suffix_area_size= 0; prefix_area_size= suffix_area_size= 0;
...@@ -1182,7 +1182,7 @@ static ulong allocate_full_pages(MARIA_FILE_BITMAP *bitmap, ...@@ -1182,7 +1182,7 @@ static ulong allocate_full_pages(MARIA_FILE_BITMAP *bitmap,
This is needed because bitmap->used_size only covers the set bits This is needed because bitmap->used_size only covers the set bits
in the bitmap. in the bitmap.
*/ */
area_size+= (page_end - data) / 6 * 16; area_size+= (uint) (page_end - data) / 6 * 16;
if (area_size >= best_area_size) if (area_size >= best_area_size)
break; break;
data= page_end; data= page_end;
...@@ -1239,7 +1239,7 @@ static ulong allocate_full_pages(MARIA_FILE_BITMAP *bitmap, ...@@ -1239,7 +1239,7 @@ static ulong allocate_full_pages(MARIA_FILE_BITMAP *bitmap,
best_area_size= pages_needed; best_area_size= pages_needed;
/* For each 6 bytes we have 6*8/3= 16 patterns */ /* For each 6 bytes we have 6*8/3= 16 patterns */
page= ((best_data - bitmap->map) * 8) / 3 + best_prefix_area_size; page= ((uint) (best_data - bitmap->map) * 8) / 3 + best_prefix_area_size;
block->page= bitmap->page + 1 + page; block->page= bitmap->page + 1 + page;
block->page_count= best_area_size; block->page_count= best_area_size;
block->empty_space= 0; block->empty_space= 0;
......
...@@ -1205,7 +1205,7 @@ static void calc_record_size(MARIA_HA *info, const uchar *record, ...@@ -1205,7 +1205,7 @@ static void calc_record_size(MARIA_HA *info, const uchar *record,
} }
else else
{ {
uint length= (end - pos); uint length= (uint) (end - pos);
if (column->length <= 255) if (column->length <= 255)
*field_length_data++= (uchar) length; *field_length_data++= (uchar) length;
else else
...@@ -2232,7 +2232,7 @@ static my_bool free_full_pages(MARIA_HA *info, MARIA_ROW *row) ...@@ -2232,7 +2232,7 @@ static my_bool free_full_pages(MARIA_HA *info, MARIA_ROW *row)
my_afree(compact_extent_info); my_afree(compact_extent_info);
DBUG_RETURN(0); DBUG_RETURN(0);
} }
extents_count= extents_length / ROW_EXTENT_SIZE; extents_count= (uint) (extents_length / ROW_EXTENT_SIZE);
pagerange_store(log_data + FILEID_STORE_SIZE, extents_count); pagerange_store(log_data + FILEID_STORE_SIZE, extents_count);
log_array[TRANSLOG_INTERNAL_PARTS + 0].str= (char*) log_data; log_array[TRANSLOG_INTERNAL_PARTS + 0].str= (char*) log_data;
log_array[TRANSLOG_INTERNAL_PARTS + 0].length= sizeof(log_data); log_array[TRANSLOG_INTERNAL_PARTS + 0].length= sizeof(log_data);
...@@ -2651,7 +2651,7 @@ static my_bool write_block_record(MARIA_HA *info, ...@@ -2651,7 +2651,7 @@ static my_bool write_block_record(MARIA_HA *info,
MARIA_BITMAP_BLOCK *cur_block, *end_block, *last_head_block; MARIA_BITMAP_BLOCK *cur_block, *end_block, *last_head_block;
MARIA_BITMAP_BLOCK *head_tail_block= 0; MARIA_BITMAP_BLOCK *head_tail_block= 0;
ulong length; ulong length;
ulong data_length= (tmp_data - info->rec_buff); ulong data_length= (ulong) (tmp_data - info->rec_buff);
#ifdef SANITY_CHECKS #ifdef SANITY_CHECKS
DBUG_ASSERT(head_block->sub_blocks != 1); DBUG_ASSERT(head_block->sub_blocks != 1);
...@@ -2779,7 +2779,7 @@ static my_bool write_block_record(MARIA_HA *info, ...@@ -2779,7 +2779,7 @@ static my_bool write_block_record(MARIA_HA *info,
head_block+1, bitmap_blocks->count - 1); head_block+1, bitmap_blocks->count - 1);
if (head_tail_block) if (head_tail_block)
{ {
ulong block_length= (tmp_data - info->rec_buff); ulong block_length= (ulong) (tmp_data - info->rec_buff);
uchar *extent_data; uchar *extent_data;
length= (uint) (block_length % FULL_PAGE_SIZE(block_size)); length= (uint) (block_length % FULL_PAGE_SIZE(block_size));
...@@ -5349,7 +5349,7 @@ static size_t fill_insert_undo_parts(MARIA_HA *info, const uchar *record, ...@@ -5349,7 +5349,7 @@ static size_t fill_insert_undo_parts(MARIA_HA *info, const uchar *record,
log_parts++; log_parts++;
} }
} }
*log_parts_count= (log_parts - start_log_parts); *log_parts_count= (uint) (log_parts - start_log_parts);
DBUG_RETURN(row_length); DBUG_RETURN(row_length);
} }
...@@ -5544,8 +5544,8 @@ static size_t fill_update_undo_parts(MARIA_HA *info, const uchar *oldrec, ...@@ -5544,8 +5544,8 @@ static size_t fill_update_undo_parts(MARIA_HA *info, const uchar *oldrec,
memcmp(old_column_pos, new_column_pos, new_column_length)) memcmp(old_column_pos, new_column_pos, new_column_length))
{ {
field_data= ma_store_length(field_data, field_data= ma_store_length(field_data,
(uint) (column - share->columndef)); (ulong) (column - share->columndef));
field_data= ma_store_length(field_data, old_column_length); field_data= ma_store_length(field_data, (ulong) old_column_length);
log_parts->str= (char*) old_column_pos; log_parts->str= (char*) old_column_pos;
log_parts->length= old_column_length; log_parts->length= old_column_length;
...@@ -5554,10 +5554,10 @@ static size_t fill_update_undo_parts(MARIA_HA *info, const uchar *oldrec, ...@@ -5554,10 +5554,10 @@ static size_t fill_update_undo_parts(MARIA_HA *info, const uchar *oldrec,
} }
} }
*log_parts_count= (log_parts - start_log_parts); *log_parts_count= (uint) (log_parts - start_log_parts);
/* Store length of field length data before the field/field_lengths */ /* Store length of field length data before the field/field_lengths */
field_lengths= (field_data - start_field_data); field_lengths= (uint) (field_data - start_field_data);
start_log_parts->str= ((char*) start_log_parts->str= ((char*)
(start_field_data - (start_field_data -
ma_calc_length_for_store_length(field_lengths))); ma_calc_length_for_store_length(field_lengths)));
...@@ -5886,7 +5886,7 @@ uint _ma_apply_redo_insert_row_head_or_tail(MARIA_HA *info, LSN lsn, ...@@ -5886,7 +5886,7 @@ uint _ma_apply_redo_insert_row_head_or_tail(MARIA_HA *info, LSN lsn,
goto crashed_file; goto crashed_file;
} }
if (extend_area_on_page(buff, dir, rownr, block_size, if (extend_area_on_page(buff, dir, rownr, block_size,
data_length, &empty_space, (uint) data_length, &empty_space,
&rec_offset, &length)) &rec_offset, &length))
goto crashed_file; goto crashed_file;
} }
...@@ -5894,7 +5894,7 @@ uint _ma_apply_redo_insert_row_head_or_tail(MARIA_HA *info, LSN lsn, ...@@ -5894,7 +5894,7 @@ uint _ma_apply_redo_insert_row_head_or_tail(MARIA_HA *info, LSN lsn,
/* Copy data */ /* Copy data */
int2store(dir+2, data_length); int2store(dir+2, data_length);
memcpy(buff + rec_offset, data, data_length); memcpy(buff + rec_offset, data, data_length);
empty_space-= data_length; empty_space-= (uint) data_length;
int2store(buff + EMPTY_SPACE_OFFSET, empty_space); int2store(buff + EMPTY_SPACE_OFFSET, empty_space);
/* /*
......
...@@ -35,10 +35,10 @@ ...@@ -35,10 +35,10 @@
#include "maria_def.h" #include "maria_def.h"
int _ma_read_cache(IO_CACHE *info, uchar *buff, my_off_t pos, uint length, my_bool _ma_read_cache(IO_CACHE *info, uchar *buff, my_off_t pos,
int flag) size_t length, uint flag)
{ {
uint read_length,in_buff_length; size_t read_length,in_buff_length;
my_off_t offset; my_off_t offset;
uchar *in_buff_pos; uchar *in_buff_pos;
DBUG_ENTER("_ma_read_cache"); DBUG_ENTER("_ma_read_cache");
......
...@@ -120,14 +120,14 @@ int maria_status(MARIA_HA *info, register MARIA_INFO *x, uint flag) ...@@ -120,14 +120,14 @@ int maria_status(MARIA_HA *info, register MARIA_INFO *x, uint flag)
void _ma_report_error(int errcode, const char *file_name) void _ma_report_error(int errcode, const char *file_name)
{ {
uint length; size_t length;
DBUG_ENTER("_ma_report_error"); DBUG_ENTER("_ma_report_error");
DBUG_PRINT("enter",("errcode %d, table '%s'", errcode, file_name)); DBUG_PRINT("enter",("errcode %d, table '%s'", errcode, file_name));
if ((length= strlen(file_name)) > 64) if ((length= strlen(file_name)) > 64)
{ {
/* we first remove the directory */ /* we first remove the directory */
uint dir_length= dirname_length(file_name); size_t dir_length= dirname_length(file_name);
file_name+= dir_length; file_name+= dir_length;
if ((length-= dir_length) > 64) if ((length-= dir_length) > 64)
{ {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#define FIX_LENGTH(cs, pos, length, char_length) \ #define FIX_LENGTH(cs, pos, length, char_length) \
do { \ do { \
if (length > char_length) \ if (length > char_length) \
char_length= my_charpos(cs, pos, pos+length, char_length); \ char_length= (uint) my_charpos(cs, pos, pos+length, char_length); \
set_if_smaller(char_length,length); \ set_if_smaller(char_length,length); \
} while(0) } while(0)
...@@ -108,7 +108,7 @@ uint _ma_make_key(register MARIA_HA *info, uint keynr, uchar *key, ...@@ -108,7 +108,7 @@ uint _ma_make_key(register MARIA_HA *info, uint keynr, uchar *key,
{ {
if (type != HA_KEYTYPE_NUM) if (type != HA_KEYTYPE_NUM)
{ {
length= cs->cset->lengthsp(cs, (char*) pos, length); length= (uint) cs->cset->lengthsp(cs, (char*) pos, length);
} }
else else
{ {
......
...@@ -593,10 +593,10 @@ int _ma_decrement_open_count(MARIA_HA *info) ...@@ -593,10 +593,10 @@ int _ma_decrement_open_count(MARIA_HA *info)
if (!(share->temporary | share->base.born_transactional)) if (!(share->temporary | share->base.born_transactional))
{ {
mi_int2store(buff,share->state.open_count); mi_int2store(buff,share->state.open_count);
write_error= my_pwrite(share->kfile.file, buff, sizeof(buff), write_error= (int) my_pwrite(share->kfile.file, buff, sizeof(buff),
sizeof(share->state.header) + sizeof(share->state.header) +
MARIA_FILE_OPEN_COUNT_OFFSET, MARIA_FILE_OPEN_COUNT_OFFSET,
MYF(MY_NABP)); MYF(MY_NABP));
} }
} }
if (!lock_error) if (!lock_error)
......
...@@ -283,7 +283,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags) ...@@ -283,7 +283,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
share_buff.state.nulls_per_key_part= nulls_per_key_part; share_buff.state.nulls_per_key_part= nulls_per_key_part;
share_buff.state.key_root=key_root; share_buff.state.key_root=key_root;
share_buff.pagecache= multi_pagecache_search((uchar*) name_buff, share_buff.pagecache= multi_pagecache_search((uchar*) name_buff,
strlen(name_buff), (uint) strlen(name_buff),
maria_pagecache); maria_pagecache);
DBUG_EXECUTE_IF("maria_pretend_crashed_table_on_open", DBUG_EXECUTE_IF("maria_pretend_crashed_table_on_open",
...@@ -497,7 +497,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags) ...@@ -497,7 +497,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
memcpy((char*) share->state.key_root, memcpy((char*) share->state.key_root,
(char*) key_root, sizeof(my_off_t)*keys); (char*) key_root, sizeof(my_off_t)*keys);
strmov(share->unique_file_name, name_buff); strmov(share->unique_file_name, name_buff);
share->unique_name_length= strlen(name_buff); share->unique_name_length= (uint) strlen(name_buff);
strmov(share->index_file_name, index_name); strmov(share->index_file_name, index_name);
strmov(share->data_file_name, data_name); strmov(share->data_file_name, data_name);
strmov(share->open_file_name, name); strmov(share->open_file_name, name);
......
...@@ -295,7 +295,7 @@ static my_bool _ma_read_pack_info(MARIA_SHARE *share, File file, ...@@ -295,7 +295,7 @@ static my_bool _ma_read_pack_info(MARIA_SHARE *share, File file,
MYF(MY_HOLD_ON_ERROR)); MYF(MY_HOLD_ON_ERROR));
/* Fix the table addresses in the tree heads. */ /* Fix the table addresses in the tree heads. */
{ {
long diff=PTR_BYTE_DIFF(decode_table,share->decode_tables); my_ptrdiff_t diff= PTR_BYTE_DIFF(decode_table,share->decode_tables);
share->decode_tables=decode_table; share->decode_tables=decode_table;
for (i=0 ; i < trees ; i++) for (i=0 ; i < trees ; i++)
share->decode_trees[i].table=ADD_TO_PTR(share->decode_trees[i].table, share->decode_trees[i].table=ADD_TO_PTR(share->decode_trees[i].table,
......
...@@ -182,8 +182,8 @@ int _ma_read_static_record(register MARIA_HA *info, register uchar *record, ...@@ -182,8 +182,8 @@ int _ma_read_static_record(register MARIA_HA *info, register uchar *record,
return(my_errno); return(my_errno);
info->rec_cache.seek_not_done=1; /* We have done a seek */ info->rec_cache.seek_not_done=1; /* We have done a seek */
error=info->s->file_read(info, record,info->s->base.reclength, error= (int) info->s->file_read(info, record,info->s->base.reclength,
pos, MYF(MY_NABP)); pos, MYF(MY_NABP));
if (! error) if (! error)
{ {
fast_ma_writeinfo(info); fast_ma_writeinfo(info);
......
...@@ -2058,14 +2058,15 @@ static my_bool _ma_log_key_middle(MARIA_HA *info, my_off_t page, uchar *buff, ...@@ -2058,14 +2058,15 @@ static my_bool _ma_log_key_middle(MARIA_HA *info, my_off_t page, uchar *buff,
log_array[TRANSLOG_INTERNAL_PARTS + 3].str= (char*) key_pos; log_array[TRANSLOG_INTERNAL_PARTS + 3].str= (char*) key_pos;
log_array[TRANSLOG_INTERNAL_PARTS + 3].length= key_length; log_array[TRANSLOG_INTERNAL_PARTS + 3].length= key_length;
translog_parts+=2; translog_parts+=2;
extra_length+= log_array[TRANSLOG_INTERNAL_PARTS + 2].length + key_length; extra_length+= (uint) (log_array[TRANSLOG_INTERNAL_PARTS + 2].length +
key_length);
} }
DBUG_RETURN(translog_write_record(&lsn, LOGREC_REDO_INDEX, DBUG_RETURN(translog_write_record(&lsn, LOGREC_REDO_INDEX,
info->trn, info, info->trn, info,
(translog_size_t) (translog_size_t)
log_array[TRANSLOG_INTERNAL_PARTS + (log_array[TRANSLOG_INTERNAL_PARTS +
0].length + extra_length, 0].length + extra_length),
TRANSLOG_INTERNAL_PARTS + translog_parts, TRANSLOG_INTERNAL_PARTS + translog_parts,
log_array, log_data, NULL)); log_array, log_data, NULL));
} }
......
...@@ -884,8 +884,9 @@ extern uint _ma_pack_key(MARIA_HA *info, uint keynr, uchar *key, ...@@ -884,8 +884,9 @@ extern uint _ma_pack_key(MARIA_HA *info, uint keynr, uchar *key,
const uchar *old, key_part_map keypart_map, const uchar *old, key_part_map keypart_map,
HA_KEYSEG ** last_used_keyseg); HA_KEYSEG ** last_used_keyseg);
extern int _ma_read_key_record(MARIA_HA *info, uchar *buf, MARIA_RECORD_POS); extern int _ma_read_key_record(MARIA_HA *info, uchar *buf, MARIA_RECORD_POS);
extern int _ma_read_cache(IO_CACHE *info, uchar *buff, MARIA_RECORD_POS pos, extern my_bool _ma_read_cache(IO_CACHE *info, uchar *buff,
uint length, int re_read_if_possibly); MARIA_RECORD_POS pos, size_t length,
uint re_read_if_possibly);
extern ulonglong ma_retrieve_auto_increment(const uchar *key, uint8 key_type); extern ulonglong ma_retrieve_auto_increment(const uchar *key, uint8 key_type);
extern my_bool _ma_alloc_buffer(uchar **old_addr, size_t *old_size, extern my_bool _ma_alloc_buffer(uchar **old_addr, size_t *old_size,
size_t new_size); size_t new_size);
......
...@@ -409,7 +409,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, ...@@ -409,7 +409,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
} }
from+=keyseg->length; from+=keyseg->length;
page=from+nod_flag; page=from+nod_flag;
length=from-vseg; length= (uint) (from-vseg);
} }
if (page > end) if (page > end)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment