Commit 631ecaab authored by unknown's avatar unknown

Merged with mysql-5.1 main tree.


BUILD/compile-pentium-debug-max:
  Added definition after macro was removed from main tree. This will
  be fixed back in main tree later.
parent cfdd7336
......@@ -4,7 +4,7 @@ path=`dirname $0`
set -- "$@" --with-debug=full
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags"
extra_flags="$pentium_cflags $debug_cflags -DSTACK_DIRECTION=-1"
extra_configs="$pentium_configs $debug_configs $max_configs $error_inject --with-experimental-collations"
. "$path/FINISH.sh"
......@@ -206,7 +206,7 @@ uint lf_alloc_pool_count(LF_ALLOCATOR *allocator);
#define lf_alloc_get_pins(A, ST) lf_pinbox_get_pins(&(A)->pinbox, (ST))
#define _lf_alloc_put_pins(PINS) _lf_pinbox_put_pins(PINS)
#define lf_alloc_put_pins(PINS) lf_pinbox_put_pins(PINS)
#define lf_alloc_direct_free(ALLOC, ADDR) my_free((gptr)(ADDR), MYF(0))
#define lf_alloc_direct_free(ALLOC, ADDR) my_free((uchar*)(ADDR), MYF(0))
lock_wrap(lf_alloc_new, void *,
(LF_PINS *pins),
......
......@@ -179,18 +179,18 @@ typedef struct st_maria_keydef /* Key definition with open & info */
HA_KEYSEG *seg, *end;
struct st_mysql_ftparser *parser; /* Fulltext [pre]parser */
int (*bin_search)(struct st_maria_info *info,
struct st_maria_keydef *keyinfo, byte *page, byte *key,
uint key_len, uint comp_flag, byte **ret_pos,
byte *buff, my_bool *was_last_key);
struct st_maria_keydef *keyinfo, uchar *page, uchar *key,
uint key_len, uint comp_flag, uchar **ret_pos,
uchar *buff, my_bool *was_last_key);
uint(*get_key)(struct st_maria_keydef *keyinfo, uint nod_flag,
byte **page, byte *key);
uchar **page, uchar *key);
int (*pack_key)(struct st_maria_keydef *keyinfo, uint nod_flag,
byte *next_key, byte *org_key, byte *prev_key,
const byte *key, struct st_maria_s_param *s_temp);
void (*store_key)(struct st_maria_keydef *keyinfo, byte *key_pos,
uchar *next_key, uchar *org_key, uchar *prev_key,
const uchar *key, struct st_maria_s_param *s_temp);
void (*store_key)(struct st_maria_keydef *keyinfo, uchar *key_pos,
struct st_maria_s_param *s_temp);
int (*ck_insert)(struct st_maria_info *inf, uint k_nr, byte *k, uint klen);
int (*ck_delete)(struct st_maria_info *inf, uint k_nr, byte *k, uint klen);
int (*ck_insert)(struct st_maria_info *inf, uint k_nr, uchar *k, uint klen);
int (*ck_delete)(struct st_maria_info *inf, uint k_nr, uchar *k, uint klen);
} MARIA_KEYDEF;
......@@ -208,7 +208,7 @@ typedef struct st_maria_decode_tree /* Decode huff-table */
{
uint16 *table;
uint quick_table_bits;
byte *intervalls;
uchar *intervalls;
} MARIA_DECODE_TREE;
......@@ -236,7 +236,7 @@ typedef struct st_maria_columndef /* column information */
#ifndef NOT_PACKED_DATABASES
void(*unpack)(struct st_maria_columndef *rec,
struct st_maria_bit_buff *buff,
byte *start, byte *end);
uchar *start, uchar *end);
enum en_fieldtype base_type;
uint space_length_bits, pack_type;
MARIA_DECODE_TREE *huff_tree;
......@@ -258,30 +258,30 @@ extern PAGECACHE maria_pagecache_var, *maria_pagecache;
extern int maria_init(void);
extern void maria_end(void);
extern int maria_close(struct st_maria_info *file);
extern int maria_delete(struct st_maria_info *file, const byte *buff);
extern int maria_delete(struct st_maria_info *file, const uchar *buff);
extern struct st_maria_info *maria_open(const char *name, int mode,
uint wait_if_locked);
extern struct st_maria_info *maria_clone(struct st_maria_share *share, int mode);
extern int maria_panic(enum ha_panic_function function);
extern int maria_rfirst(struct st_maria_info *file, byte *buf, int inx);
extern int maria_rkey(struct st_maria_info *file, byte *buf, int inx,
const byte *key,
extern int maria_rfirst(struct st_maria_info *file, uchar *buf, int inx);
extern int maria_rkey(struct st_maria_info *file, uchar *buf, int inx,
const uchar *key,
uint key_len, enum ha_rkey_function search_flag);
extern int maria_rlast(struct st_maria_info *file, byte *buf, int inx);
extern int maria_rnext(struct st_maria_info *file, byte *buf, int inx);
extern int maria_rnext_same(struct st_maria_info *info, byte *buf);
extern int maria_rprev(struct st_maria_info *file, byte *buf, int inx);
extern int maria_rrnd(struct st_maria_info *file, byte *buf,
extern int maria_rlast(struct st_maria_info *file, uchar *buf, int inx);
extern int maria_rnext(struct st_maria_info *file, uchar *buf, int inx);
extern int maria_rnext_same(struct st_maria_info *info, uchar *buf);
extern int maria_rprev(struct st_maria_info *file, uchar *buf, int inx);
extern int maria_rrnd(struct st_maria_info *file, uchar *buf,
MARIA_RECORD_POS pos);
extern int maria_scan_init(struct st_maria_info *file);
extern int maria_scan(struct st_maria_info *file, byte *buf);
extern int maria_scan(struct st_maria_info *file, uchar *buf);
extern void maria_scan_end(struct st_maria_info *file);
extern int maria_rsame(struct st_maria_info *file, byte *record, int inx);
extern int maria_rsame_with_pos(struct st_maria_info *file, byte *record,
extern int maria_rsame(struct st_maria_info *file, uchar *record, int inx);
extern int maria_rsame_with_pos(struct st_maria_info *file, uchar *record,
int inx, MARIA_RECORD_POS pos);
extern int maria_update(struct st_maria_info *file, const byte *old,
byte *new_record);
extern int maria_write(struct st_maria_info *file, byte *buff);
extern int maria_update(struct st_maria_info *file, const uchar *old,
uchar *new_record);
extern int maria_write(struct st_maria_info *file, uchar *buff);
extern MARIA_RECORD_POS maria_position(struct st_maria_info *file);
extern int maria_status(struct st_maria_info *info, MARIA_INFO *x, uint flag);
extern int maria_lock_database(struct st_maria_info *file, int lock_type);
......@@ -348,8 +348,8 @@ typedef struct st_maria_sort_param
MARIA_KEYDEF *keyinfo;
MARIA_SORT_INFO *sort_info;
HA_KEYSEG *seg;
byte **sort_keys;
byte *rec_buff;
uchar **sort_keys;
uchar *rec_buff;
void *wordlist, *wordptr;
MEM_ROOT wordroot;
char *record;
......@@ -367,13 +367,13 @@ typedef struct st_maria_sort_param
uint maxbuffers, keys, find_length, sort_keys_length;
my_bool fix_datafile, master;
my_bool calc_checksum; /* calculate table checksum */
my_size_t rec_buff_size;
size_t rec_buff_size;
int (*key_cmp)(struct st_maria_sort_param *, const void *, const void *);
int (*key_read)(struct st_maria_sort_param *, byte *);
int (*key_write)(struct st_maria_sort_param *, const byte *);
int (*key_read)(struct st_maria_sort_param *, uchar *);
int (*key_write)(struct st_maria_sort_param *, const uchar *);
void (*lock_in_memory)(HA_CHECK *);
NEAR int (*write_keys)(struct st_maria_sort_param *, register byte **,
NEAR int (*write_keys)(struct st_maria_sort_param *, register uchar **,
uint , struct st_buffpek *, IO_CACHE *);
NEAR uint (*read_to_buffer)(IO_CACHE *,struct st_buffpek *, uint);
NEAR int (*write_key)(struct st_maria_sort_param *, IO_CACHE *,char *,
......@@ -389,9 +389,9 @@ int maria_chk_size(HA_CHECK *param, MARIA_HA *info);
int maria_chk_key(HA_CHECK *param, MARIA_HA *info);
int maria_chk_data_link(HA_CHECK *param, MARIA_HA *info, int extend);
int maria_repair(HA_CHECK *param, register MARIA_HA *info,
my_string name, int rep_quick);
char * name, int rep_quick);
int maria_sort_index(HA_CHECK *param, register MARIA_HA *info,
my_string name);
char * name);
int maria_repair_by_sort(HA_CHECK *param, register MARIA_HA *info,
const char *name, int rep_quick);
int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info,
......@@ -405,7 +405,7 @@ void maria_update_key_parts(MARIA_KEYDEF *keyinfo, ulong *rec_per_key_part,
ulonglong records);
int maria_filecopy(HA_CHECK *param, File to, File from, my_off_t start,
my_off_t length, const char *type);
int maria_movepoint(MARIA_HA *info, byte *record, my_off_t oldpos,
int maria_movepoint(MARIA_HA *info, uchar *record, my_off_t oldpos,
my_off_t newpos, uint prot_key);
int maria_write_data_suffix(MARIA_SORT_INFO *sort_info, my_bool fix_datafile);
int maria_test_if_almost_full(MARIA_HA *info);
......@@ -427,8 +427,8 @@ void maria_change_pagecache(PAGECACHE *old_key_cache,
int maria_preload(MARIA_HA *info, ulonglong key_map, my_bool ignore_leaves);
/* fulltext functions */
FT_INFO *maria_ft_init_search(uint,void *, uint, byte *, uint,
CHARSET_INFO *, byte *);
FT_INFO *maria_ft_init_search(uint,void *, uint, uchar *, uint,
CHARSET_INFO *, uchar *);
/* 'Almost-internal' Maria functions */
......
......@@ -717,12 +717,12 @@ extern void handle_recived_signals(void);
extern sig_handler my_set_alarm_variable(int signo);
extern void my_string_ptr_sort(uchar *base,uint items,size_t size);
extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements,
size_s size_of_element,uchar *buffer[]);
size_t size_of_element,uchar *buffer[]);
extern qsort_t qsort2(void *base_ptr, size_t total_elems, size_t size,
qsort2_cmp cmp, void *cmp_argument);
extern qsort2_cmp get_ptr_compare(size_t);
void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos);
my_off_t my_get_ptr(cuhar *ptr, size_t pack_length);
my_off_t my_get_ptr(uchar *ptr, size_t pack_length);
extern int init_io_cache(IO_CACHE *info,File file,size_t cachesize,
enum cache_type type,my_off_t seek_offset,
pbool use_async_io, myf cache_myflags);
......@@ -840,11 +840,11 @@ extern void free_defaults(char **argv);
extern void my_print_default_files(const char *conf_file);
extern void print_defaults(const char *conf_file, const char **groups);
extern my_bool my_compress(uchar *, size_t *, size_t *);
extern my_bool my_uncompress(uchar *, size_t *, size_t *);
extern my_bool my_uncompress(uchar *, size_t , size_t *);
extern uchar *my_compress_alloc(const uchar *packet, size_t *len,
size_t *complen);
extern int packfrm(const uchar *, size_t, uchar **, size_t *);
extern int unpackfrm(const uchar **, size_t *, const uchar *);
extern int unpackfrm(uchar **, size_t *, const uchar *);
extern ha_checksum my_checksum(ha_checksum crc, const uchar *mem,
size_t count);
......
......@@ -338,7 +338,7 @@ typedef struct st_mi_sort_param
MI_SORT_INFO *sort_info;
HA_KEYSEG *seg;
uchar **sort_keys;
byte *rec_buff;
uchar *rec_buff;
void *wordlist, *wordptr;
MEM_ROOT wordroot;
char *record;
......
......@@ -76,8 +76,8 @@
typedef struct st_sort_key_blocks /* Used when sorting */
{
byte *buff, *end_pos;
byte lastkey[HA_MAX_POSSIBLE_KEY_BUFF];
uchar *buff, *end_pos;
uchar lastkey[HA_MAX_POSSIBLE_KEY_BUFF];
uint last_length;
int inited;
} SORT_KEY_BLOCKS;
......@@ -147,15 +147,15 @@ typedef struct st_handler_check_param
typedef struct st_sort_ftbuf
{
byte *buf, *end;
uchar *buf, *end;
int count;
byte lastkey[HA_MAX_KEY_BUFF];
uchar lastkey[HA_MAX_KEY_BUFF];
} SORT_FT_BUF;
typedef struct st_buffpek {
my_off_t file_pos; /* Where we are in the sort file */
byte *base, *key; /* Key pointers */
uchar *base, *key; /* Key pointers */
ha_rows count; /* Number of rows in table */
ulong mem_count; /* numbers of keys in memory */
ulong max_keys; /* Max keys in buffert */
......
......@@ -34,7 +34,7 @@ LF_REQUIRE_PINS(3);
typedef struct {
intptr volatile link; /* a pointer to the next element in a listand a flag */
uint32 hashnr; /* reversed hash number, for sorting */
const byte *key;
const uchar *key;
uint keylen;
/*
data is stored here, directly after the keylen.
......@@ -72,10 +72,10 @@ typedef struct {
pins[0..2] are used, they are NOT removed on return
*/
static int lfind(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
const byte *key, uint keylen, CURSOR *cursor, LF_PINS *pins)
const uchar *key, uint keylen, CURSOR *cursor, LF_PINS *pins)
{
uint32 cur_hashnr;
const byte *cur_key;
const uchar *cur_key;
uint cur_keylen;
intptr link;
......@@ -201,7 +201,7 @@ static LF_SLIST *linsert(LF_SLIST * volatile *head, CHARSET_INFO *cs,
it uses pins[0..2], on return all pins are removed.
*/
static int ldelete(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
const byte *key, uint keylen, LF_PINS *pins)
const uchar *key, uint keylen, LF_PINS *pins)
{
CURSOR cursor;
int res;
......@@ -259,7 +259,7 @@ static int ldelete(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
all other pins are removed.
*/
static LF_SLIST *lsearch(LF_SLIST * volatile *head, CHARSET_INFO *cs,
uint32 hashnr, const byte *key, uint keylen,
uint32 hashnr, const uchar *key, uint keylen,
LF_PINS *pins)
{
CURSOR cursor;
......@@ -271,8 +271,8 @@ static LF_SLIST *lsearch(LF_SLIST * volatile *head, CHARSET_INFO *cs,
return res ? cursor.curr : 0;
}
static inline const byte* hash_key(const LF_HASH *hash,
const byte *record, uint *length)
static inline const uchar* hash_key(const LF_HASH *hash,
const uchar *record, uint *length)
{
if (hash->get_key)
return (*hash->get_key)(record, length, 0);
......@@ -285,7 +285,7 @@ static inline const byte* hash_key(const LF_HASH *hash,
note, that the hash value is limited to 2^31, because we need one
bit to distinguish between normal and dummy nodes.
*/
static inline uint calc_hash(LF_HASH *hash, const byte *key, uint keylen)
static inline uint calc_hash(LF_HASH *hash, const uchar *key, uint keylen)
{
ulong nr1= 1, nr2= 4;
hash->charset->coll->hash_sort(hash->charset, (uchar*) key, keylen,
......@@ -362,7 +362,7 @@ int lf_hash_insert(LF_HASH *hash, LF_PINS *pins, const void *data)
if (unlikely(!node))
return -1;
memcpy(node+1, data, hash->element_size);
node->key= hash_key(hash, (byte *)(node+1), &node->keylen);
node->key= hash_key(hash, (uchar *)(node+1), &node->keylen);
hashnr= calc_hash(hash, node->key, node->keylen);
bucket= hashnr % hash->size;
el= _lf_dynarray_lvalue(&hash->array, bucket);
......@@ -399,7 +399,7 @@ int lf_hash_insert(LF_HASH *hash, LF_PINS *pins, const void *data)
int lf_hash_delete(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen)
{
LF_SLIST * volatile *el;
uint bucket, hashnr= calc_hash(hash, (byte *)key, keylen);
uint bucket, hashnr= calc_hash(hash, (uchar *)key, keylen);
bucket= hashnr % hash->size;
lf_rwlock_by_pins(pins);
......@@ -415,7 +415,7 @@ int lf_hash_delete(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen)
if (*el == NULL && unlikely(initialize_bucket(hash, el, bucket, pins)))
return -1;
if (ldelete(el, hash->charset, my_reverse_bits(hashnr) | 1,
(byte *)key, keylen, pins))
(uchar *)key, keylen, pins))
{
lf_rwunlock_by_pins(pins);
return 1;
......@@ -438,7 +438,7 @@ int lf_hash_delete(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen)
void *lf_hash_search(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen)
{
LF_SLIST * volatile *el, *found;
uint bucket, hashnr= calc_hash(hash, (byte *)key, keylen);
uint bucket, hashnr= calc_hash(hash, (uchar *)key, keylen);
bucket= hashnr % hash->size;
lf_rwlock_by_pins(pins);
......@@ -448,12 +448,12 @@ void *lf_hash_search(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen)
if (*el == NULL && unlikely(initialize_bucket(hash, el, bucket, pins)))
return MY_ERRPTR;
found= lsearch(el, hash->charset, my_reverse_bits(hashnr) | 1,
(byte *)key, keylen, pins);
(uchar *)key, keylen, pins);
lf_rwunlock_by_pins(pins);
return found ? found+1 : 0;
}
static const byte *dummy_key= "";
static const uchar *dummy_key= "";
/*
RETURN
......
......@@ -178,7 +178,8 @@ int packfrm(const uchar *data, size_t len,
if (my_compress((uchar*)data, &org_len, &comp_len))
goto err;
DBUG_PRINT("info", ("org_len: %lu comp_len: %lu", org_len, comp_len));
DBUG_PRINT("info", ("org_len: %lu comp_len: %lu", (ulong) org_len,
(ulong) comp_len));
DBUG_DUMP("compressed", (char*)data, org_len);
error= 2;
......
......@@ -66,8 +66,9 @@ int my_rename(const char *from, const char *to, myf MyFlags)
#ifdef NEED_EXPLICIT_SYNC_DIR
/* do only the needed amount of syncs: */
char dir_from[FN_REFLEN], dir_to[FN_REFLEN];
dirname_part(dir_from, from);
dirname_part(dir_to, to);
size_t dir_from_length, dir_to_length;
dirname_part(dir_from, from, &dir_from_length);
dirname_part(dir_to, to, &dir_to_length);
if (my_sync_dir(dir_from, MyFlags) ||
(strcmp(dir_from, dir_to) &&
my_sync_dir(dir_to, MyFlags)))
......
......@@ -53,7 +53,7 @@
static void safe_hash_entry_free(SAFE_HASH_ENTRY *entry)
{
DBUG_ENTER("safe_hash_entry_free");
my_free((gptr) entry, MYF(0));
my_free((uchar*) entry, MYF(0));
DBUG_VOID_RETURN;
}
......@@ -70,11 +70,11 @@ static void safe_hash_entry_free(SAFE_HASH_ENTRY *entry)
# reference on the key
*/
static byte *safe_hash_entry_get(SAFE_HASH_ENTRY *entry, uint *length,
my_bool not_used __attribute__((unused)))
static uchar *safe_hash_entry_get(SAFE_HASH_ENTRY *entry, uint *length,
my_bool not_used __attribute__((unused)))
{
*length= entry->length;
return (byte*) entry->key;
return (uchar*) entry->key;
}
......@@ -97,7 +97,7 @@ static byte *safe_hash_entry_get(SAFE_HASH_ENTRY *entry, uint *length,
*/
my_bool safe_hash_init(SAFE_HASH *hash, uint elements,
byte *default_value)
uchar *default_value)
{
DBUG_ENTER("safe_hash_init");
if (hash_init(&hash->hash, &my_charset_bin, elements,
......@@ -154,10 +154,10 @@ void safe_hash_free(SAFE_HASH *hash)
# data associated with the key of default value if data was not found
*/
byte *safe_hash_search(SAFE_HASH *hash, const byte *key, uint length,
byte *def)
uchar *safe_hash_search(SAFE_HASH *hash, const uchar *key, uint length,
uchar *def)
{
byte *result;
uchar *result;
DBUG_ENTER("safe_hash_search");
rw_rdlock(&hash->mutex);
result= hash_search(&hash->hash, key, length);
......@@ -191,8 +191,8 @@ byte *safe_hash_search(SAFE_HASH *hash, const byte *key, uint length,
1 error (Can only be EOM). In this case my_message() is called.
*/
my_bool safe_hash_set(SAFE_HASH *hash, const byte *key, uint length,
byte *data)
my_bool safe_hash_set(SAFE_HASH *hash, const uchar *key, uint length,
uchar *data)
{
SAFE_HASH_ENTRY *entry;
my_bool error= 0;
......@@ -214,7 +214,7 @@ my_bool safe_hash_set(SAFE_HASH *hash, const byte *key, uint length,
/* unlink entry from list */
if ((*entry->prev= entry->next))
entry->next->prev= entry->prev;
hash_delete(&hash->hash, (byte*) entry);
hash_delete(&hash->hash, (uchar*) entry);
goto end;
}
if (entry)
......@@ -230,7 +230,7 @@ my_bool safe_hash_set(SAFE_HASH *hash, const byte *key, uint length,
error= 1;
goto end;
}
entry->key= (byte*) (entry +1);
entry->key= (uchar*) (entry +1);
memcpy((char*) entry->key, (char*) key, length);
entry->length= length;
entry->data= data;
......@@ -239,7 +239,7 @@ my_bool safe_hash_set(SAFE_HASH *hash, const byte *key, uint length,
entry->next->prev= &entry->next;
entry->prev= &hash->root;
hash->root= entry;
if (my_hash_insert(&hash->hash, (byte*) entry))
if (my_hash_insert(&hash->hash, (uchar*) entry))
{
/* This can only happen if hash got out of memory */
my_free((char*) entry, MYF(0));
......@@ -269,7 +269,7 @@ my_bool safe_hash_set(SAFE_HASH *hash, const byte *key, uint length,
default value.
*/
void safe_hash_change(SAFE_HASH *hash, byte *old_data, byte *new_data)
void safe_hash_change(SAFE_HASH *hash, uchar *old_data, uchar *new_data)
{
SAFE_HASH_ENTRY *entry, *next;
DBUG_ENTER("safe_hash_change");
......@@ -285,7 +285,7 @@ void safe_hash_change(SAFE_HASH *hash, byte *old_data, byte *new_data)
{
if ((*entry->prev= entry->next))
entry->next->prev= entry->prev;
hash_delete(&hash->hash, (byte*) entry);
hash_delete(&hash->hash, (uchar*) entry);
}
else
entry->data= new_data;
......
......@@ -30,9 +30,9 @@
typedef struct st_safe_hash_entry
{
byte *key;
uchar *key;
uint length;
byte *data;
uchar *data;
struct st_safe_hash_entry *next, **prev;
} SAFE_HASH_ENTRY;
......@@ -43,16 +43,16 @@ typedef struct st_safe_hash_with_default
rw_lock_t mutex;
#endif
HASH hash;
byte *default_value;
uchar *default_value;
SAFE_HASH_ENTRY *root;
} SAFE_HASH;
my_bool safe_hash_init(SAFE_HASH *hash, uint elements,
byte *default_value);
uchar *default_value);
void safe_hash_free(SAFE_HASH *hash);
byte *safe_hash_search(SAFE_HASH *hash, const byte *key, uint length,
byte *def);
my_bool safe_hash_set(SAFE_HASH *hash, const byte *key, uint length,
byte *data);
void safe_hash_change(SAFE_HASH *hash, byte *old_data, byte *new_data);
uchar *safe_hash_search(SAFE_HASH *hash, const uchar *key, uint length,
uchar *def);
my_bool safe_hash_set(SAFE_HASH *hash, const uchar *key, uint length,
uchar *data);
void safe_hash_change(SAFE_HASH *hash, uchar *old_data, uchar *new_data);
......@@ -145,7 +145,8 @@ int my_sync_dir_by_file(const char *file_name, myf my_flags)
{
#ifdef NEED_EXPLICIT_SYNC_DIR
char dir_name[FN_REFLEN];
dirname_part(dir_name, file_name);
size_t dir_name_length;
dirname_part(dir_name, file_name, &dir_name_length);
return my_sync_dir(dir_name, my_flags);
#else
return 0;
......
......@@ -1076,7 +1076,7 @@ uint read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek,
void reuse_freed_buff(QUEUE *queue, BUFFPEK *reuse, uint key_length)
{
byte *reuse_end= reuse->base + reuse->max_keys * key_length;
uchar *reuse_end= reuse->base + reuse->max_keys * key_length;
for (uint i= 0; i < queue->elements; ++i)
{
BUFFPEK *bp= (BUFFPEK *) queue_element(queue, i);
......@@ -1158,7 +1158,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
DBUG_RETURN(1); /* purecov: inspected */
for (buffpek= Fb ; buffpek <= Tb ; buffpek++)
{
buffpek->base= (byte*) strpos;
buffpek->base= (uchar*) strpos;
buffpek->max_keys= maxcount;
strpos+= (uint) (error= (int) read_to_buffer(from_file, buffpek,
rec_length));
......@@ -1250,7 +1250,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
}
}
buffpek= (BUFFPEK*) queue_top(&queue);
buffpek->base= (byte*) sort_buffer;
buffpek->base= (uchar*) sort_buffer;
buffpek->max_keys= param->keys;
/*
......
......@@ -2767,7 +2767,7 @@ String *Item_xml_str_func::parse_xml(String *raw_xml, String *parsed_xml_buf)
if ((rc= my_xml_parse(&p, raw_xml->ptr(), raw_xml->length())) != MY_XML_OK)
{
char buf[128];
my_snprintf(buf, sizeof(buf)-1, "parse error at line %d pos %lu: %s",
my_snprintf(buf, sizeof(buf)-1, "parse error at line %d pos %u: %s",
my_xml_error_lineno(&p) + 1,
my_xml_error_pos(&p) + 1,
my_xml_error_string(&p));
......
......@@ -548,7 +548,7 @@ MY_LOCALE *my_default_lc_time_names;
SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen, have_query_cache;
SHOW_COMP_OPTION have_geometry, have_rtree_keys;
SHOW_COMP_OPTION have_crypt, have_compress;
SHOW_COMP_OPTION have_crypt, have_compress, have_maria_db;
/* Thread specific variables */
......@@ -1210,7 +1210,7 @@ void clean_up(bool print_message)
xid_cache_free();
delete_elements(&key_caches, (void (*)(const char*, uchar*)) free_key_cache);
#ifdef WITH_MARIA_STORAGE_ENGINE
delete_elements(&pagecaches, (void (*)(const char*, gptr)) free_pagecache);
delete_elements(&pagecaches, (void (*)(const char*, uchar*)) free_pagecache);
#endif /* WITH_MARIA_STORAGE_ENGINE */
multi_keycache_free();
#ifdef WITH_MARIA_STORAGE_ENGINE
......@@ -6227,16 +6227,13 @@ The minimum value for this variable is 4096.",
{"pagecache_age_threshold", OPT_KEY_CACHE_AGE_THRESHOLD,
"This characterizes the number of hits a hot block has to be untouched until it is considered aged enough to be downgraded to a warm block. This specifies the percentage ratio of that number of hits to the total number of blocks in key cache",
(uchar**) &maria_pagecache_var.param_age_threshold,
(uchar**) 0,
0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG,
(uchar**) 0, 0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG,
300, 100, ~0L, 0, 100, 0},
{"pagecache_buffer_size", OPT_KEY_BUFFER_SIZE,
"The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford; 64M on a 256M machine that mainly runs MySQL is quite common.",
(uchar**) &maria_pagecache_var.param_buff_size,
(uchar**) 0,
0, (GET_ULL | GET_ASK_ADDR),
REQUIRED_ARG, KEY_CACHE_SIZE, MALLOC_OVERHEAD, ~(ulong) 0, MALLOC_OVERHEAD,
IO_SIZE, KEY_CACHE_SIZE},
(uchar**) 0, 0, (GET_ULL | GET_ASK_ADDR), REQUIRED_ARG,
KEY_CACHE_SIZE, MALLOC_OVERHEAD, ~(ulong) 0, MALLOC_OVERHEAD, IO_SIZE, 0},
{"pagecache_division_limit", OPT_KEY_CACHE_DIVISION_LIMIT,
"The minimum percentage of warm blocks in key cache",
(uchar**) &maria_pagecache_var.param_division_limit,
......@@ -6252,11 +6249,12 @@ The minimum value for this variable is 4096.",
"Optional colon separated list of plugins to load, where each plugin is "
"identified by name and path to library seperated by an equals.",
(uchar**) &opt_plugin_load, (uchar**) &opt_plugin_load, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"preload_buffer_size", OPT_PRELOAD_BUFFER_SIZE,
"The size of the buffer that is allocated when preloading indexes",
(uchar**) &global_system_variables.preload_buff_size,
(uchar**) &max_system_variables.preload_buff_size, 0, GET_ULONG,
REQUIRED_ARG, 32*1024L, 1024, 1024*1024*1024L, 0, 1, 0},
"The size of the buffer that is allocated when preloading indexes",
(uchar**) &global_system_variables.preload_buff_size,
(uchar**) &max_system_variables.preload_buff_size, 0, GET_ULONG,
REQUIRED_ARG, 32*1024L, 1024, 1024*1024*1024L, 0, 1, 0},
{"query_alloc_block_size", OPT_QUERY_ALLOC_BLOCK_SIZE,
"Allocation block size for query parsing and execution",
(uchar**) &global_system_variables.query_alloc_block_size,
......
......@@ -345,10 +345,10 @@ static sys_var_thd_enum sys_myisam_stats_method(&vars, "myisam_stats_met
&myisam_stats_method_typelib,
NULL);
sys_var_thd_ulonglong sys_maria_max_sort_file_size("maria_max_sort_file_size", &SV::maria_max_sort_file_size, fix_maria_max_sort_file_size, 1);
sys_var_thd_ulong sys_maria_repair_threads("maria_repair_threads", &SV::maria_repair_threads);
sys_var_thd_ulong sys_maria_sort_buffer_size("maria_sort_buffer_size", &SV::maria_sort_buff_size);
sys_var_thd_enum sys_maria_stats_method("maria_stats_method",
static sys_var_thd_ulonglong sys_maria_max_sort_file_size(&vars, "maria_max_sort_file_size", &SV::maria_max_sort_file_size, fix_maria_max_sort_file_size, 1);
static sys_var_thd_ulong sys_maria_repair_threads(&vars, "maria_repair_threads", &SV::maria_repair_threads);
static sys_var_thd_ulong sys_maria_sort_buffer_size(&vars, "maria_sort_buffer_size", &SV::maria_sort_buff_size);
static sys_var_thd_enum sys_maria_stats_method(&vars, "maria_stats_method",
&SV::maria_stats_method,
&myisam_stats_method_typelib,
NULL);
......@@ -1963,13 +1963,13 @@ uchar *sys_var_key_cache_param::value_ptr(THD *thd, enum_var_type type,
#ifdef WITH_MARIA_STORAGE_ENGINE
byte *sys_var_pagecache_param::value_ptr(THD *thd, enum_var_type type,
uchar *sys_var_pagecache_param::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
PAGECACHE *pagecache= get_pagecache(base);
if (!pagecache)
pagecache= &zero_pagecache;
return (byte*) pagecache + offset ;
return (uchar*) pagecache + offset ;
}
#endif /* WITH_MARIA_STORAGE_ENGINE */
......@@ -3664,7 +3664,7 @@ static PAGECACHE *create_pagecache(const char *name, uint length)
if ((pagecache= (PAGECACHE*) my_malloc(sizeof(PAGECACHE),
MYF(MY_ZEROFILL | MY_WME))))
{
if (!new NAMED_LIST(&pagecaches, name, length, (gptr) pagecache))
if (!new NAMED_LIST(&pagecaches, name, length, (uchar*) pagecache))
{
my_free((char*) pagecache, MYF(0));
pagecache= 0;
......
......@@ -742,7 +742,7 @@ class sys_var_pagecache_param :public sys_var
sys_var_pagecache_param(const char *name_arg, size_t offset_arg)
:sys_var(name_arg), offset(offset_arg)
{}
byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
bool check_default(enum_var_type type) { return 1; }
bool is_struct() { return 1; }
};
......
......@@ -448,7 +448,7 @@ static bool merge_walk(uchar *merge_buffer, ulong merge_buffer_size,
*/
for (top= begin; top != end; ++top)
{
top->base= (byte*) (merge_buffer + (top - begin) * piece_size);
top->base= (uchar*) (merge_buffer + (top - begin) * piece_size);
top->max_keys= max_key_count_per_piece;
bytes_read= read_to_buffer(file, top, key_length);
if (bytes_read == (uint) (-1))
......
......@@ -22,8 +22,8 @@
#include "ma_ftdefs.h"
FT_INFO *maria_ft_init_search(uint flags, void *info, uint keynr,
byte *query, uint query_len, CHARSET_INFO *cs,
byte *record)
uchar *query, uint query_len, CHARSET_INFO *cs,
uchar *record)
{
FT_INFO *res;
if (flags & FT_BOOL)
......
......@@ -142,7 +142,7 @@ int table2maria(TABLE *table_arg, MARIA_KEYDEF **keydef_out,
{
uint i, j, recpos, minpos, fieldpos, temp_length, length;
enum ha_base_keytype type= HA_KEYTYPE_BINARY;
byte *record;
uchar *record;
KEY *pos;
MARIA_KEYDEF *keydef;
MARIA_COLUMNDEF *recinfo, *recinfo_pos;
......@@ -559,7 +559,7 @@ int ha_maria::net_read_dump(NET * net)
error= -1;
goto err;
}
if (my_write(data_fd, (byte *) net->read_pos, (uint) packet_len,
if (my_write(data_fd, (uchar *) net->read_pos, (uint) packet_len,
MYF(MY_WME | MY_FNABP)))
{
error= errno;
......@@ -578,7 +578,7 @@ int ha_maria::dump(THD * thd, int fd)
uint block_size= share->block_size;
my_off_t bytes_to_read= share->state.state.data_file_length;
int data_fd= file->dfile.file;
byte *buf= (byte *) my_malloc(block_size, MYF(MY_WME));
uchar *buf= (uchar *) my_malloc(block_size, MYF(MY_WME));
if (!buf)
return ENOMEM;
......@@ -603,7 +603,7 @@ int ha_maria::dump(THD * thd, int fd)
}
else
{
if (my_net_write(net, (char*) buf, bytes))
if (my_net_write(net, buf, bytes))
{
error= errno ? errno : EPIPE;
goto err;
......@@ -614,13 +614,13 @@ int ha_maria::dump(THD * thd, int fd)
if (fd < 0)
{
if (my_net_write(net, "", 0))
if (my_net_write(net, (uchar*) "", 0))
error= errno ? errno : EPIPE;
net_flush(net);
}
err:
my_free((gptr) buf, MYF(0));
my_free((uchar*) buf, MYF(0));
return error;
}
#endif /* HAVE_REPLICATION */
......@@ -699,10 +699,10 @@ int ha_maria::open(const char *name, int mode, uint test_if_locked)
for (i= 0; i < table->s->keys; i++)
{
struct st_plugin_int *parser= table->key_info[i].parser;
plugin_ref parser= table->key_info[i].parser;
if (table->key_info[i].flags & HA_USES_PARSER)
file->s->keyinfo[i].parser=
(struct st_mysql_ftparser *) parser->plugin->info;
(struct st_mysql_ftparser *)plugin_decl(parser)->info;
table->key_info[i].block_size= file->s->keyinfo[i].block_length;
}
return (0);
......@@ -717,7 +717,7 @@ int ha_maria::close(void)
}
int ha_maria::write_row(byte * buf)
int ha_maria::write_row(uchar * buf)
{
statistic_increment(table->in_use->status_var.ha_write_count, &LOCK_status);
......@@ -1210,19 +1210,14 @@ int ha_maria::assign_to_keycache(THD * thd, HA_CHECK_OPT *check_opt)
TABLE_LIST *table_list= table->pos_in_table_list;
DBUG_ENTER("ha_maria::assign_to_keycache");
/* Check validity of the index references */
if (table_list->use_index)
{
/* We only come here when the user did specify an index map */
key_map kmap;
if (get_key_map_from_key_list(&kmap, table, table_list->use_index))
{
errmsg= thd->net.last_error;
error= HA_ADMIN_FAILED;
goto err;
}
map= kmap.to_ulonglong();
}
table->keys_in_use_for_query.clear_all();
if (table_list->process_index_hints(table))
DBUG_RETURN(HA_ADMIN_FAILED);
map= ~(ulonglong) 0;
if (!table->keys_in_use_for_query.is_clear_all())
/* use all keys if there's no list specified by the user through hints */
map= table->keys_in_use_for_query.to_ulonglong();
if ((error= maria_assign_to_pagecache(file, map, new_pagecache)))
{
......@@ -1233,7 +1228,6 @@ int ha_maria::assign_to_keycache(THD * thd, HA_CHECK_OPT *check_opt)
error= HA_ADMIN_CORRUPT;
}
err:
if (error != HA_ADMIN_OK)
{
/* Send error to user */
......@@ -1264,20 +1258,16 @@ int ha_maria::preload_keys(THD * thd, HA_CHECK_OPT *check_opt)
DBUG_ENTER("ha_maria::preload_keys");
table->keys_in_use_for_query.clear_all();
if (table_list->process_index_hints(table))
DBUG_RETURN(HA_ADMIN_FAILED);
map= ~(ulonglong) 0;
/* Check validity of the index references */
if (table_list->use_index)
{
key_map kmap;
get_key_map_from_key_list(&kmap, table, table_list->use_index);
if (kmap.is_set_all())
{
errmsg= thd->net.last_error;
error= HA_ADMIN_FAILED;
goto err;
}
if (!kmap.is_clear_all())
map= kmap.to_ulonglong();
}
if (!table->keys_in_use_for_query.is_clear_all())
/* use all keys if there's no list specified by the user through hints */
map= table->keys_in_use_for_query.to_ulonglong();
maria_extra(file, HA_EXTRA_PRELOAD_BUFFER_SIZE,
(void*) &thd->variables.preload_buff_size);
......@@ -1599,7 +1589,7 @@ bool ha_maria::is_crashed() const
}
int ha_maria::update_row(const byte * old_data, byte * new_data)
int ha_maria::update_row(const uchar * old_data, uchar * new_data)
{
statistic_increment(table->in_use->status_var.ha_update_count, &LOCK_status);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
......@@ -1608,14 +1598,14 @@ int ha_maria::update_row(const byte * old_data, byte * new_data)
}
int ha_maria::delete_row(const byte * buf)
int ha_maria::delete_row(const uchar * buf)
{
statistic_increment(table->in_use->status_var.ha_delete_count, &LOCK_status);
return maria_delete(file, buf);
}
int ha_maria::index_read(byte * buf, const byte * key,
int ha_maria::index_read(uchar * buf, const uchar * key,
uint key_len, enum ha_rkey_function find_flag)
{
DBUG_ASSERT(inited == INDEX);
......@@ -1627,7 +1617,7 @@ int ha_maria::index_read(byte * buf, const byte * key,
}
int ha_maria::index_read_idx(byte * buf, uint index, const byte * key,
int ha_maria::index_read_idx(uchar * buf, uint index, const uchar * key,
uint key_len, enum ha_rkey_function find_flag)
{
statistic_increment(table->in_use->status_var.ha_read_key_count,
......@@ -1638,7 +1628,7 @@ int ha_maria::index_read_idx(byte * buf, uint index, const byte * key,
}
int ha_maria::index_read_last(byte * buf, const byte * key, uint key_len)
int ha_maria::index_read_last(uchar * buf, const uchar * key, uint key_len)
{
DBUG_ENTER("ha_maria::index_read_last");
DBUG_ASSERT(inited == INDEX);
......@@ -1651,7 +1641,7 @@ int ha_maria::index_read_last(byte * buf, const byte * key, uint key_len)
}
int ha_maria::index_next(byte * buf)
int ha_maria::index_next(uchar * buf)
{
DBUG_ASSERT(inited == INDEX);
statistic_increment(table->in_use->status_var.ha_read_next_count,
......@@ -1662,7 +1652,7 @@ int ha_maria::index_next(byte * buf)
}
int ha_maria::index_prev(byte * buf)
int ha_maria::index_prev(uchar * buf)
{
DBUG_ASSERT(inited == INDEX);
statistic_increment(table->in_use->status_var.ha_read_prev_count,
......@@ -1673,7 +1663,7 @@ int ha_maria::index_prev(byte * buf)
}
int ha_maria::index_first(byte * buf)
int ha_maria::index_first(uchar * buf)
{
DBUG_ASSERT(inited == INDEX);
statistic_increment(table->in_use->status_var.ha_read_first_count,
......@@ -1684,7 +1674,7 @@ int ha_maria::index_first(byte * buf)
}
int ha_maria::index_last(byte * buf)
int ha_maria::index_last(uchar * buf)
{
DBUG_ASSERT(inited == INDEX);
statistic_increment(table->in_use->status_var.ha_read_last_count,
......@@ -1695,8 +1685,8 @@ int ha_maria::index_last(byte * buf)
}
int ha_maria::index_next_same(byte * buf,
const byte *key __attribute__ ((unused)),
int ha_maria::index_next_same(uchar * buf,
const uchar *key __attribute__ ((unused)),
uint length __attribute__ ((unused)))
{
DBUG_ASSERT(inited == INDEX);
......@@ -1724,7 +1714,7 @@ int ha_maria::rnd_end()
}
int ha_maria::rnd_next(byte *buf)
int ha_maria::rnd_next(uchar *buf)
{
statistic_increment(table->in_use->status_var.ha_read_rnd_next_count,
&LOCK_status);
......@@ -1734,13 +1724,13 @@ int ha_maria::rnd_next(byte *buf)
}
int ha_maria::restart_rnd_next(byte *buf, byte *pos)
int ha_maria::restart_rnd_next(uchar *buf, uchar *pos)
{
return rnd_pos(buf, pos);
}
int ha_maria::rnd_pos(byte * buf, byte *pos)
int ha_maria::rnd_pos(uchar * buf, uchar *pos)
{
statistic_increment(table->in_use->status_var.ha_read_rnd_count,
&LOCK_status);
......@@ -1750,7 +1740,7 @@ int ha_maria::rnd_pos(byte * buf, byte *pos)
}
void ha_maria::position(const byte * record)
void ha_maria::position(const uchar * record)
{
my_off_t row_position= maria_position(file);
my_store_ptr(ref, ref_length, row_position);
......@@ -2052,7 +2042,7 @@ int ha_maria::create(const char *name, register TABLE *table_arg,
0, (MARIA_UNIQUEDEF *) 0,
&create_info, create_flags);
my_free((gptr) recinfo, MYF(0));
my_free((uchar*) recinfo, MYF(0));
DBUG_RETURN(error);
}
......@@ -2070,7 +2060,7 @@ void ha_maria::get_auto_increment(ulonglong offset, ulonglong increment,
{
ulonglong nr;
int error;
byte key[HA_MAX_KEY_LENGTH];
uchar key[HA_MAX_KEY_LENGTH];
if (!table->s->next_number_key_offset)
{ // Autoincrement at key-start
......@@ -2142,7 +2132,7 @@ ha_rows ha_maria::records_in_range(uint inx, key_range *min_key,
}
int ha_maria::ft_read(byte * buf)
int ha_maria::ft_read(uchar * buf)
{
int error;
......
......@@ -77,19 +77,19 @@ class ha_maria :public handler
bool called_by_logger_thread);
int open(const char *name, int mode, uint test_if_locked);
int close(void);
int write_row(byte * buf);
int update_row(const byte * old_data, byte * new_data);
int delete_row(const byte * buf);
int index_read(byte * buf, const byte * key,
int write_row(uchar * buf);
int update_row(const uchar * old_data, uchar * new_data);
int delete_row(const uchar * buf);
int index_read(uchar * buf, const uchar * key,
uint key_len, enum ha_rkey_function find_flag);
int index_read_idx(byte * buf, uint idx, const byte * key,
int index_read_idx(uchar * buf, uint idx, const uchar * key,
uint key_len, enum ha_rkey_function find_flag);
int index_read_last(byte * buf, const byte * key, uint key_len);
int index_next(byte * buf);
int index_prev(byte * buf);
int index_first(byte * buf);
int index_last(byte * buf);
int index_next_same(byte * buf, const byte * key, uint keylen);
int index_read_last(uchar * buf, const uchar * key, uint key_len);
int index_next(uchar * buf);
int index_prev(uchar * buf);
int index_first(uchar * buf);
int index_last(uchar * buf);
int index_next_same(uchar * buf, const uchar * key, uint keylen);
int ft_init()
{
if (!ft_handler)
......@@ -100,16 +100,16 @@ class ha_maria :public handler
FT_INFO *ft_init_ext(uint flags, uint inx, String * key)
{
return maria_ft_init_search(flags, file, inx,
(byte *) key->ptr(), key->length(),
(uchar *) key->ptr(), key->length(),
key->charset(), table->record[0]);
}
int ft_read(byte * buf);
int ft_read(uchar * buf);
int rnd_init(bool scan);
int rnd_end(void);
int rnd_next(byte * buf);
int rnd_pos(byte * buf, byte * pos);
int restart_rnd_next(byte * buf, byte * pos);
void position(const byte * record);
int rnd_next(uchar * buf);
int rnd_pos(uchar * buf, uchar * pos);
int restart_rnd_next(uchar * buf, uchar * pos);
void position(const uchar * record);
int info(uint);
int extra(enum ha_extra_function operation);
int extra_opt(enum ha_extra_function operation, ulong cache_size);
......
......@@ -132,7 +132,7 @@ static inline my_bool write_changed_bitmap(MARIA_SHARE *share,
DBUG_ASSERT(share->pagecache->block_size == bitmap->block_size);
return (pagecache_write(share->pagecache,
&bitmap->file, bitmap->page, 0,
(byte*) bitmap->map, PAGECACHE_PLAIN_PAGE,
(uchar*) bitmap->map, PAGECACHE_PLAIN_PAGE,
PAGECACHE_LOCK_LEFT_UNLOCKED,
PAGECACHE_PIN_LEFT_UNPINNED,
PAGECACHE_WRITE_DELAY, 0));
......@@ -224,7 +224,7 @@ my_bool _ma_bitmap_end(MARIA_SHARE *share)
{
my_bool res= _ma_flush_bitmap(share);
pthread_mutex_destroy(&share->bitmap.bitmap_lock);
my_free((byte*) share->bitmap.map, MYF(MY_ALLOW_ZERO_PTR));
my_free((uchar*) share->bitmap.map, MYF(MY_ALLOW_ZERO_PTR));
share->bitmap.map= 0;
return res;
}
......@@ -514,7 +514,7 @@ static my_bool _ma_read_bitmap_page(MARIA_SHARE *share,
DBUG_ASSERT(share->pagecache->block_size == bitmap->block_size);
res= pagecache_read(share->pagecache,
(PAGECACHE_FILE*)&bitmap->file, page, 0,
(byte*) bitmap->map,
(uchar*) bitmap->map,
PAGECACHE_PLAIN_PAGE,
PAGECACHE_LOCK_LEFT_UNLOCKED, 0) == 0;
#ifndef DBUG_OFF
......@@ -607,7 +607,7 @@ static my_bool move_to_next_bitmap(MARIA_HA *info, MARIA_FILE_BITMAP *bitmap)
fill_block()
bitmap Bitmap handle
block Store data about what we found
best_data Pointer to best 6 byte aligned area in bitmap->map
best_data Pointer to best 6 uchar aligned area in bitmap->map
best_pos Which bit in *best_data the area starts
0 = first bit pattern, 1 second bit pattern etc
best_bits The original value of the bits at best_pos
......@@ -997,7 +997,7 @@ static ulong allocate_full_pages(MARIA_FILE_BITMAP *bitmap,
best_data+= size;
if ((best_area_size-= size * 8))
{
/* fill last byte */
/* fill last uchar */
*best_data|= (uchar) ((1 << best_area_size) -1);
best_data++;
}
......@@ -1857,7 +1857,7 @@ my_bool _ma_bitmap_release_unused(MARIA_HA *info, MARIA_BITMAP_BLOCKS *blocks)
1 error (Couldn't write or read bitmap page)
*/
my_bool _ma_bitmap_free_full_pages(MARIA_HA *info, const byte *extents,
my_bool _ma_bitmap_free_full_pages(MARIA_HA *info, const uchar *extents,
uint count)
{
DBUG_ENTER("_ma_bitmap_free_full_pages");
......
This diff is collapsed.
......@@ -60,7 +60,7 @@ enum en_page_type { UNALLOCATED_PAGE, HEAD_PAGE, TAIL_PAGE, BLOB_PAGE, MAX_PAGE_
#define PAGE_CAN_BE_COMPACTED 128 /* Bit in PAGE_TYPE */
/* Bits used for flag byte (one byte, first in record) */
/* Bits used for flag uchar (one byte, first in record) */
#define ROW_FLAG_TRANSID 1
#define ROW_FLAG_VER_PTR 2
#define ROW_FLAG_DELETE_TRANSID 4
......@@ -82,7 +82,7 @@ enum en_page_type { UNALLOCATED_PAGE, HEAD_PAGE, TAIL_PAGE, BLOB_PAGE, MAX_PAGE_
TRANSID_SIZE + VERPTR_SIZE + \
TRANSID_SIZE)
/* We use 1 byte in record header to store number of directory entries */
/* We use 1 uchar in record header to store number of directory entries */
#define MAX_ROWS_PER_PAGE 255
/* Bits for MARIA_BITMAP_BLOCKS->used */
......@@ -133,25 +133,25 @@ my_bool _ma_init_block_record(MARIA_HA *info);
void _ma_end_block_record(MARIA_HA *info);
my_bool _ma_update_block_record(MARIA_HA *info, MARIA_RECORD_POS pos,
const byte *oldrec, const byte *newrec);
my_bool _ma_delete_block_record(MARIA_HA *info, const byte *record);
int _ma_read_block_record(MARIA_HA *info, byte *record,
const uchar *oldrec, const uchar *newrec);
my_bool _ma_delete_block_record(MARIA_HA *info, const uchar *record);
int _ma_read_block_record(MARIA_HA *info, uchar *record,
MARIA_RECORD_POS record_pos);
int _ma_read_block_record2(MARIA_HA *info, byte *record,
byte *data, byte *end_of_data);
int _ma_scan_block_record(MARIA_HA *info, byte *record,
int _ma_read_block_record2(MARIA_HA *info, uchar *record,
uchar *data, uchar *end_of_data);
int _ma_scan_block_record(MARIA_HA *info, uchar *record,
MARIA_RECORD_POS, my_bool);
my_bool _ma_cmp_block_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def,
const byte *record, MARIA_RECORD_POS pos);
const uchar *record, MARIA_RECORD_POS pos);
my_bool _ma_scan_init_block_record(MARIA_HA *info);
void _ma_scan_end_block_record(MARIA_HA *info);
MARIA_RECORD_POS _ma_write_init_block_record(MARIA_HA *info,
const byte *record);
my_bool _ma_write_block_record(MARIA_HA *info, const byte *record);
const uchar *record);
my_bool _ma_write_block_record(MARIA_HA *info, const uchar *record);
my_bool _ma_write_abort_block_record(MARIA_HA *info);
my_bool _ma_compare_block_record(register MARIA_HA *info,
register const byte *record);
register const uchar *record);
/* ma_bitmap.c */
my_bool _ma_bitmap_init(MARIA_SHARE *share, File file);
......@@ -160,7 +160,7 @@ my_bool _ma_flush_bitmap(MARIA_SHARE *share);
my_bool _ma_bitmap_find_place(MARIA_HA *info, MARIA_ROW *row,
MARIA_BITMAP_BLOCKS *result_blocks);
my_bool _ma_bitmap_release_unused(MARIA_HA *info, MARIA_BITMAP_BLOCKS *blocks);
my_bool _ma_bitmap_free_full_pages(MARIA_HA *info, const byte *extents,
my_bool _ma_bitmap_free_full_pages(MARIA_HA *info, const uchar *extents,
uint count);
my_bool _ma_bitmap_set(MARIA_HA *info, ulonglong pos, my_bool head,
uint empty_space);
......
......@@ -35,7 +35,7 @@
#include "maria_def.h"
int _ma_read_cache(IO_CACHE *info, byte *buff, my_off_t pos, uint length,
int _ma_read_cache(IO_CACHE *info, uchar *buff, my_off_t pos, uint length,
int flag)
{
uint read_length,in_buff_length;
......@@ -61,7 +61,7 @@ int _ma_read_cache(IO_CACHE *info, byte *buff, my_off_t pos, uint length,
(my_off_t) (info->read_end - info->request_pos))
{
in_buff_pos=info->request_pos+(uint) offset;
in_buff_length= min(length,(uint) (info->read_end-in_buff_pos));
in_buff_length= min(length,(uint) ((char*)(info->read_end)-in_buff_pos));
memcpy(buff,info->request_pos+(uint) offset,(size_t) in_buff_length);
if (!(length-=in_buff_length))
DBUG_RETURN(0);
......
This diff is collapsed.
......@@ -182,7 +182,7 @@ my_bool execute_checkpoint_indirect()
LSN candidate_max_rec_lsn_at_last_checkpoint;
DBUG_ENTER("execute_checkpoint_indirect");
DBUG_ASSERT(sizeof(byte *) <= 8);
DBUG_ASSERT(sizeof(uchar *) <= 8);
DBUG_ASSERT(sizeof(LSN) <= 8);
safemutex_assert_owner(log_mutex);
......
......@@ -17,7 +17,7 @@
#include "maria_def.h"
ha_checksum _ma_checksum(MARIA_HA *info, const byte *record)
ha_checksum _ma_checksum(MARIA_HA *info, const uchar *record)
{
ha_checksum crc=0;
MARIA_COLUMNDEF *column= info->s->columndef;
......@@ -28,7 +28,7 @@ ha_checksum _ma_checksum(MARIA_HA *info, const byte *record)
for ( ; column != column_end ; column++)
{
const byte *pos= record + column->offset;
const uchar *pos= record + column->offset;
ulong length;
switch (column->type) {
......@@ -63,7 +63,7 @@ ha_checksum _ma_checksum(MARIA_HA *info, const byte *record)
}
ha_checksum _ma_static_checksum(MARIA_HA *info, const byte *pos)
ha_checksum _ma_static_checksum(MARIA_HA *info, const uchar *pos)
{
return my_checksum(0, pos, info->s->base.reclength);
}
......@@ -107,18 +107,18 @@ int maria_close(register MARIA_HA *info)
}
}
#endif
my_free((gptr) info->s,MYF(0));
my_free((uchar*) info->s,MYF(0));
}
pthread_mutex_unlock(&THR_LOCK_maria);
if (info->ftparser_param)
{
my_free((gptr)info->ftparser_param, MYF(0));
my_free((uchar*)info->ftparser_param, MYF(0));
info->ftparser_param= 0;
}
if (info->dfile.file >= 0 && my_close(info->dfile.file, MYF(0)))
error = my_errno;
my_free((gptr) info,MYF(0));
my_free((uchar*) info,MYF(0));
if (error)
{
......
......@@ -90,7 +90,7 @@ int maria_create(const char *name, enum data_file_type datafile_type,
}
errpos=0;
options=0;
bzero((byte*) &share,sizeof(share));
bzero((uchar*) &share,sizeof(share));
if (flags & HA_DONT_TOUCH_DATA)
{
......@@ -232,7 +232,7 @@ int maria_create(const char *name, enum data_file_type datafile_type,
if ((packed & 7) == 1)
{
/*
Not optimal packing, try to remove a 1 byte length zero-field as
Not optimal packing, try to remove a 1 uchar length zero-field as
this will get same record length, but smaller pack overhead
*/
while (column != columndef)
......@@ -401,7 +401,7 @@ int maria_create(const char *name, enum data_file_type datafile_type,
}
keydef->keysegs+=sp_segs;
key_length+=SPLEN*sp_segs;
length++; /* At least one length byte */
length++; /* At least one length uchar */
min_key_length_skip+=SPLEN*2*SPDIMS;
#else
my_errno= HA_ERR_UNSUPPORTED;
......@@ -437,7 +437,7 @@ int maria_create(const char *name, enum data_file_type datafile_type,
fulltext_keys++;
key_length+= HA_FT_MAXBYTELEN+HA_FT_WLEN;
length++; /* At least one length byte */
length++; /* At least one length uchar */
min_key_length_skip+=HA_FT_MAXBYTELEN;
real_length_diff=HA_FT_MAXBYTELEN-FT_MAX_WORD_LEN_FOR_SORT;
}
......@@ -510,7 +510,7 @@ int maria_create(const char *name, enum data_file_type datafile_type,
DBUG_ASSERT(!(keyseg->flag & HA_VAR_LENGTH_PART));
keydef->flag |= HA_SPACE_PACK_USED | HA_VAR_LENGTH_KEY;
options|=HA_OPTION_PACK_KEYS; /* Using packed keys */
length++; /* At least one length byte */
length++; /* At least one length uchar */
min_key_length_skip+=keyseg->length;
if (keyseg->length >= 255)
{ /* prefix may be 3 bytes */
......@@ -523,7 +523,7 @@ int maria_create(const char *name, enum data_file_type datafile_type,
DBUG_ASSERT(!test_all_bits(keyseg->flag,
(HA_VAR_LENGTH_PART | HA_BLOB_PART)));
keydef->flag|=HA_VAR_LENGTH_KEY;
length++; /* At least one length byte */
length++; /* At least one length uchar */
options|=HA_OPTION_PACK_KEYS; /* Using packed keys */
min_key_length_skip+=keyseg->length;
if (keyseg->length >= 255)
......@@ -612,7 +612,7 @@ int maria_create(const char *name, enum data_file_type datafile_type,
goto err_no_lock;
}
bmove(share.state.header.file_version,(byte*) maria_file_magic,4);
bmove(share.state.header.file_version,(uchar*) maria_file_magic,4);
ci->old_options=options| (ci->old_options & HA_OPTION_TEMP_COMPRESS_RECORD ?
HA_OPTION_COMPRESS_RECORD |
HA_OPTION_TEMP_COMPRESS_RECORD: 0);
......@@ -920,11 +920,11 @@ int maria_create(const char *name, enum data_file_type datafile_type,
{
if (_ma_columndef_write(file, col_order[i]))
{
my_free((gptr) col_order, MYF(0));
my_free((uchar*) col_order, MYF(0));
goto err;
}
}
my_free((gptr) col_order, MYF(0));
my_free((uchar*) col_order, MYF(0));
}
else
{
......
......@@ -20,15 +20,15 @@
/* Print a key in user understandable format */
void _ma_print_key(FILE *stream, register HA_KEYSEG *keyseg,
const byte *key, uint length)
const uchar *key, uint length)
{
int flag;
short int s_1;
long int l_1;
float f_1;
double d_1;
const byte *end;
const byte *key_end= key + length;
const uchar *end;
const uchar *key_end= key + length;
VOID(fputs("Key: \"",stream));
flag=0;
......
This diff is collapsed.
This diff is collapsed.
......@@ -188,8 +188,8 @@ int maria_extra(MARIA_HA *info, enum ha_extra_function function,
case HA_EXTRA_KEYREAD: /* Read only keys to record */
case HA_EXTRA_REMEMBER_POS:
info->opt_flag |= REMEMBER_OLD_POS;
bmove((byte*) info->lastkey+share->base.max_key_length*2,
(byte*) info->lastkey,info->lastkey_length);
bmove((uchar*) info->lastkey+share->base.max_key_length*2,
(uchar*) info->lastkey,info->lastkey_length);
info->save_update= info->update;
info->save_lastinx= info->lastinx;
info->save_lastpos= info->cur_row.lastpos;
......@@ -205,8 +205,8 @@ int maria_extra(MARIA_HA *info, enum ha_extra_function function,
case HA_EXTRA_RESTORE_POS:
if (info->opt_flag & REMEMBER_OLD_POS)
{
bmove((byte*) info->lastkey,
(byte*) info->lastkey+share->base.max_key_length*2,
bmove((uchar*) info->lastkey,
(uchar*) info->lastkey+share->base.max_key_length*2,
info->save_lastkey_length);
info->update= info->save_update | HA_STATE_WRITTEN;
info->lastinx= info->save_lastinx;
......
......@@ -111,7 +111,7 @@ typedef struct st_ftb_word
uint ndepth;
uint len;
uchar off;
byte word[1];
uchar word[1];
} FTB_WORD;
typedef struct st_ft_info
......@@ -161,7 +161,7 @@ typedef struct st_my_ftb_param
{
FTB *ftb;
FTB_EXPR *ftbe;
byte *up_quot;
uchar *up_quot;
uint depth;
} MY_FTB_PARAM;
......@@ -274,7 +274,7 @@ static int ftb_parse_query_internal(MYSQL_FTPARSER_PARAM *param,
MY_FTB_PARAM *ftb_param= param->mysql_ftparam;
MYSQL_FTPARSER_BOOLEAN_INFO info;
CHARSET_INFO *cs= ftb_param->ftb->charset;
char **start= &query;
uchar **start= (uchar**) &query;
char *end= query + len;
FT_WORD w;
......@@ -286,7 +286,7 @@ static int ftb_parse_query_internal(MYSQL_FTPARSER_PARAM *param,
}
static void _ftb_parse_query(FTB *ftb, byte *query, uint len,
static void _ftb_parse_query(FTB *ftb, uchar *query, uint len,
struct st_mysql_ftparser *parser)
{
MYSQL_FTPARSER_PARAM *param;
......@@ -331,7 +331,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
my_bool can_go_down;
MARIA_HA *info=ftb->info;
uint off= 0, extra=HA_FT_WLEN+info->s->base.rec_reflength;
byte *lastkey_buf= ftbw->word+ftbw->off;
uchar *lastkey_buf= ftbw->word+ftbw->off;
if (ftbw->flags & FTB_FLAG_TRUNC)
lastkey_buf+=ftbw->len;
......@@ -504,7 +504,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
}
FT_INFO * maria_ft_init_boolean_search(MARIA_HA *info, uint keynr, byte *query,
FT_INFO * maria_ft_init_boolean_search(MARIA_HA *info, uint keynr, uchar *query,
uint query_len, CHARSET_INFO *cs)
{
FTB *ftb;
......@@ -544,14 +544,14 @@ FT_INFO * maria_ft_init_boolean_search(MARIA_HA *info, uint keynr, byte *query,
Hack: instead of init_queue, we'll use reinit queue to be able
to alloc queue with alloc_root()
*/
if (! (ftb->queue.root= (byte **)alloc_root(&ftb->mem_root,
if (! (ftb->queue.root= (uchar **)alloc_root(&ftb->mem_root,
(ftb->queue.max_elements + 1) *
sizeof(void *))))
goto err;
reinit_queue(&ftb->queue, ftb->queue.max_elements, 0, 0,
(int (*)(void*, byte*, byte*))FTB_WORD_cmp, 0);
(int (*)(void*, uchar*, uchar*))FTB_WORD_cmp, 0);
for (ftbw= ftb->last_word; ftbw; ftbw= ftbw->prev)
queue_insert(&ftb->queue, (byte *)ftbw);
queue_insert(&ftb->queue, (uchar *)ftbw);
ftb->list=(FTB_WORD **)alloc_root(&ftb->mem_root,
sizeof(FTB_WORD *)*ftb->queue.elements);
memcpy(ftb->list, ftb->queue.root+1, sizeof(FTB_WORD *)*ftb->queue.elements);
......@@ -562,7 +562,7 @@ FT_INFO * maria_ft_init_boolean_search(MARIA_HA *info, uint keynr, byte *query,
return ftb;
err:
free_root(& ftb->mem_root, MYF(0));
my_free((gptr)ftb,MYF(0));
my_free((uchar*)ftb,MYF(0));
return 0;
}
......@@ -616,7 +616,8 @@ static int ftb_check_phrase_internal(MYSQL_FTPARSER_PARAM *param,
FT_WORD word;
MY_FTB_PHRASE_PARAM *phrase_param= param->mysql_ftparam;
const char *docend= document + len;
while (maria_ft_simple_get_word(phrase_param->cs, &document, docend, &word, FALSE))
while (maria_ft_simple_get_word(phrase_param->cs, (uchar**) &document,
docend, &word, FALSE))
{
param->mysql_add_word(param, word.pos, word.len, 0);
if (phrase_param->match)
......@@ -640,7 +641,7 @@ static int ftb_check_phrase_internal(MYSQL_FTPARSER_PARAM *param,
1 is returned if phrase found, 0 else.
*/
static int _ftb_check_phrase(FTB *ftb, const byte *document, uint len,
static int _ftb_check_phrase(FTB *ftb, const uchar *document, uint len,
FTB_EXPR *ftbe, struct st_mysql_ftparser *parser)
{
MY_FTB_PHRASE_PARAM ftb_param;
......@@ -661,7 +662,7 @@ static int _ftb_check_phrase(FTB *ftb, const byte *document, uint len,
param->mysql_add_word= ftb_phrase_add_word;
param->mysql_ftparam= (void *)&ftb_param;
param->cs= ftb->charset;
param->doc= (byte *)document;
param->doc= (uchar *)document;
param->length= len;
param->flags= 0;
param->mode= MYSQL_FTPARSER_WITH_STOPWORDS;
......@@ -865,13 +866,13 @@ static int ftb_find_relevance_parse(MYSQL_FTPARSER_PARAM *param,
FT_INFO *ftb= ftb_param->ftb;
char *end= doc + len;
FT_WORD w;
while (maria_ft_simple_get_word(ftb->charset, &doc, end, &w, TRUE))
while (maria_ft_simple_get_word(ftb->charset, (uchar**) &doc, end, &w, TRUE))
param->mysql_add_word(param, w.pos, w.len, 0);
return(0);
}
float maria_ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
float maria_ft_boolean_find_relevance(FT_INFO *ftb, uchar *record, uint length)
{
FTB_EXPR *ftbe;
FT_SEG_ITERATOR ftsi, ftsi2;
......@@ -923,7 +924,7 @@ float maria_ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
{
if (!ftsi.pos)
continue;
param->doc= (byte *)ftsi.pos;
param->doc= (uchar *)ftsi.pos;
param->length= ftsi.len;
parser->parse(param);
}
......@@ -947,7 +948,7 @@ void maria_ft_boolean_close_search(FT_INFO *ftb)
delete_tree(& ftb->no_dupes);
}
free_root(& ftb->mem_root, MYF(0));
my_free((gptr)ftb,MYF(0));
my_free((uchar*)ftb,MYF(0));
}
......
......@@ -69,7 +69,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
TREE_ELEMENT *selem;
double gweight=1;
MARIA_HA *info= aio->info;
byte *keybuff= (byte*) aio->keybuff;
uchar *keybuff= (uchar*) 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;
......@@ -190,7 +190,7 @@ static int walk_and_push(FT_SUPERDOC *from,
DBUG_ENTER("walk_and_copy");
from->doc.weight+=from->tmp_weight*from->word_ptr->weight;
set_if_smaller(best->elements, ft_query_expansion_limit-1);
queue_insert(best, (byte *)& from->doc);
queue_insert(best, (uchar *)& from->doc);
DBUG_RETURN(0);
}
......@@ -202,8 +202,8 @@ static int FT_DOC_cmp(void *unused __attribute__((unused)),
}
FT_INFO *maria_ft_init_nlq_search(MARIA_HA *info, uint keynr, byte *query,
uint query_len, uint flags, byte *record)
FT_INFO *maria_ft_init_nlq_search(MARIA_HA *info, uint keynr, uchar *query,
uint query_len, uint flags, uchar *record)
{
TREE wtree;
ALL_IN_ONE aio;
......@@ -324,7 +324,7 @@ int maria_ft_nlq_read_next(FT_INFO *handler, char *record)
float maria_ft_nlq_find_relevance(FT_INFO *handler,
byte *record __attribute__((unused)),
uchar *record __attribute__((unused)),
uint length __attribute__((unused)))
{
int a,b,c;
......@@ -353,7 +353,7 @@ float maria_ft_nlq_find_relevance(FT_INFO *handler,
void maria_ft_nlq_close_search(FT_INFO *handler)
{
my_free((gptr)handler,MYF(0));
my_free((uchar*)handler,MYF(0));
}
......
......@@ -80,7 +80,7 @@ FT_WORD * maria_ft_linearize(TREE *wtree, MEM_ROOT *mem_root)
DBUG_RETURN(wlist);
}
my_bool maria_ft_boolean_check_syntax_string(const byte *str)
my_bool maria_ft_boolean_check_syntax_string(const uchar *str)
{
uint i, j;
......@@ -109,10 +109,10 @@ my_bool maria_ft_boolean_check_syntax_string(const byte *str)
3 - right bracket
4 - stopword found
*/
byte maria_ft_get_word(CHARSET_INFO *cs, byte **start, byte *end,
FT_WORD *word, MYSQL_FTPARSER_BOOLEAN_INFO *param)
uchar maria_ft_get_word(CHARSET_INFO *cs, uchar **start, uchar *end,
FT_WORD *word, MYSQL_FTPARSER_BOOLEAN_INFO *param)
{
byte *doc=*start;
uchar *doc=*start;
int ctype;
uint mwc, length, mbl;
......@@ -199,10 +199,11 @@ byte maria_ft_get_word(CHARSET_INFO *cs, byte **start, byte *end,
return param->type;
}
byte maria_ft_simple_get_word(CHARSET_INFO *cs, byte **start, const byte *end,
FT_WORD *word, my_bool skip_stopwords)
uchar maria_ft_simple_get_word(CHARSET_INFO *cs, uchar **start,
const uchar *end, FT_WORD *word,
my_bool skip_stopwords)
{
byte *doc= *start;
uchar *doc= *start;
uint mwc, length, mbl;
int ctype;
DBUG_ENTER("maria_ft_simple_get_word");
......@@ -263,9 +264,9 @@ static int maria_ft_add_word(MYSQL_FTPARSER_PARAM *param,
wtree= ft_param->wtree;
if (param->flags & MYSQL_FTFLAGS_NEED_COPY)
{
byte *ptr;
uchar *ptr;
DBUG_ASSERT(wtree->with_delete == 0);
ptr= (byte *)alloc_root(ft_param->mem_root, word_len);
ptr= (uchar *)alloc_root(ft_param->mem_root, word_len);
memcpy(ptr, word, word_len);
w.pos= ptr;
}
......@@ -282,9 +283,10 @@ static int maria_ft_add_word(MYSQL_FTPARSER_PARAM *param,
static int maria_ft_parse_internal(MYSQL_FTPARSER_PARAM *param,
char *doc, int doc_len)
char *doc_arg, int doc_len)
{
byte *end=doc+doc_len;
uchar *doc= (uchar*) doc_arg;
uchar *end= doc + doc_len;
MY_FT_PARSER_PARAM *ft_param=param->mysql_ftparam;
TREE *wtree= ft_param->wtree;
FT_WORD w;
......@@ -297,7 +299,7 @@ static int maria_ft_parse_internal(MYSQL_FTPARSER_PARAM *param,
}
int maria_ft_parse(TREE *wtree, byte *doc, int doclen,
int maria_ft_parse(TREE *wtree, uchar *doc, int doclen,
struct st_mysql_ftparser *parser,
MYSQL_FTPARSER_PARAM *param, MEM_ROOT *mem_root)
{
......
......@@ -20,7 +20,7 @@
#include "ma_ftdefs.h"
#include <math.h>
void _ma_ft_segiterator_init(MARIA_HA *info, uint keynr, const byte *record,
void _ma_ft_segiterator_init(MARIA_HA *info, uint keynr, const uchar *record,
FT_SEG_ITERATOR *ftsi)
{
DBUG_ENTER("_ma_ft_segiterator_init");
......@@ -31,7 +31,7 @@ void _ma_ft_segiterator_init(MARIA_HA *info, uint keynr, const byte *record,
DBUG_VOID_RETURN;
}
void _ma_ft_segiterator_dummy_init(const byte *record, uint len,
void _ma_ft_segiterator_dummy_init(const uchar *record, uint len,
FT_SEG_ITERATOR *ftsi)
{
DBUG_ENTER("_ma_ft_segiterator_dummy_init");
......@@ -94,7 +94,7 @@ uint _ma_ft_segiterator(register FT_SEG_ITERATOR *ftsi)
/* parses a document i.e. calls maria_ft_parse for every keyseg */
uint _ma_ft_parse(TREE *parsed, MARIA_HA *info, uint keynr, const byte *record,
uint _ma_ft_parse(TREE *parsed, MARIA_HA *info, uint keynr, const uchar *record,
MYSQL_FTPARSER_PARAM *param, MEM_ROOT *mem_root)
{
FT_SEG_ITERATOR ftsi;
......@@ -108,14 +108,14 @@ uint _ma_ft_parse(TREE *parsed, MARIA_HA *info, uint keynr, const byte *record,
while (_ma_ft_segiterator(&ftsi))
{
if (ftsi.pos)
if (maria_ft_parse(parsed, (byte *)ftsi.pos, ftsi.len, parser, param,
if (maria_ft_parse(parsed, (uchar *)ftsi.pos, ftsi.len, parser, param,
mem_root))
DBUG_RETURN(1);
}
DBUG_RETURN(0);
}
FT_WORD * _ma_ft_parserecord(MARIA_HA *info, uint keynr, const byte *record,
FT_WORD * _ma_ft_parserecord(MARIA_HA *info, uint keynr, const uchar *record,
MEM_ROOT *mem_root)
{
TREE ptree;
......@@ -131,7 +131,7 @@ FT_WORD * _ma_ft_parserecord(MARIA_HA *info, uint keynr, const byte *record,
DBUG_RETURN(maria_ft_linearize(&ptree, mem_root));
}
static int _ma_ft_store(MARIA_HA *info, uint keynr, byte *keybuf,
static int _ma_ft_store(MARIA_HA *info, uint keynr, uchar *keybuf,
FT_WORD *wlist, my_off_t filepos)
{
uint key_length;
......@@ -146,7 +146,7 @@ static int _ma_ft_store(MARIA_HA *info, uint keynr, byte *keybuf,
DBUG_RETURN(0);
}
static int _ma_ft_erase(MARIA_HA *info, uint keynr, byte *keybuf,
static int _ma_ft_erase(MARIA_HA *info, uint keynr, uchar *keybuf,
FT_WORD *wlist, my_off_t filepos)
{
uint key_length, err=0;
......@@ -169,7 +169,7 @@ static int _ma_ft_erase(MARIA_HA *info, uint keynr, byte *keybuf,
#define THOSE_TWO_DAMN_KEYS_ARE_REALLY_DIFFERENT 1
#define GEE_THEY_ARE_ABSOLUTELY_IDENTICAL 0
int _ma_ft_cmp(MARIA_HA *info, uint keynr, const byte *rec1, const byte *rec2)
int _ma_ft_cmp(MARIA_HA *info, uint keynr, const uchar *rec1, const uchar *rec2)
{
FT_SEG_ITERATOR ftsi1, ftsi2;
CHARSET_INFO *cs=info->s->keyinfo[keynr].seg->charset;
......@@ -192,8 +192,8 @@ int _ma_ft_cmp(MARIA_HA *info, uint keynr, const byte *rec1, const byte *rec2)
/* update a document entry */
int _ma_ft_update(MARIA_HA *info, uint keynr, byte *keybuf,
const byte *oldrec, const byte *newrec, my_off_t pos)
int _ma_ft_update(MARIA_HA *info, uint keynr, uchar *keybuf,
const uchar *oldrec, const uchar *newrec, my_off_t pos)
{
int error= -1;
FT_WORD *oldlist,*newlist, *old_word, *new_word;
......@@ -243,7 +243,7 @@ int _ma_ft_update(MARIA_HA *info, uint keynr, byte *keybuf,
/* adds a document to the collection */
int _ma_ft_add(MARIA_HA *info, uint keynr, byte *keybuf, const byte *record,
int _ma_ft_add(MARIA_HA *info, uint keynr, uchar *keybuf, const uchar *record,
my_off_t pos)
{
int error= -1;
......@@ -261,7 +261,7 @@ int _ma_ft_add(MARIA_HA *info, uint keynr, byte *keybuf, const byte *record,
/* removes a document from the collection */
int _ma_ft_del(MARIA_HA *info, uint keynr, byte *keybuf, const byte *record,
int _ma_ft_del(MARIA_HA *info, uint keynr, uchar *keybuf, const uchar *record,
my_off_t pos)
{
int error= -1;
......@@ -277,10 +277,10 @@ int _ma_ft_del(MARIA_HA *info, uint keynr, byte *keybuf, const byte *record,
}
uint _ma_ft_make_key(MARIA_HA *info, uint keynr, byte *keybuf, FT_WORD *wptr,
uint _ma_ft_make_key(MARIA_HA *info, uint keynr, uchar *keybuf, FT_WORD *wptr,
my_off_t filepos)
{
byte buf[HA_FT_MAXBYTELEN+16];
uchar buf[HA_FT_MAXBYTELEN+16];
DBUG_ENTER("_ma_ft_make_key");
#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT
......@@ -302,12 +302,12 @@ uint _ma_ft_make_key(MARIA_HA *info, uint keynr, byte *keybuf, FT_WORD *wptr,
convert key value to ft2
*/
uint _ma_ft_convert_to_ft2(MARIA_HA *info, uint keynr, byte *key)
uint _ma_ft_convert_to_ft2(MARIA_HA *info, uint keynr, uchar *key)
{
my_off_t root;
DYNAMIC_ARRAY *da=info->ft1_to_ft2;
MARIA_KEYDEF *keyinfo=&info->s->ft2_keyinfo;
byte *key_ptr= (byte*) dynamic_array_ptr(da, 0), *end;
uchar *key_ptr= (uchar*) dynamic_array_ptr(da, 0), *end;
uint length, key_length;
DBUG_ENTER("_ma_ft_convert_to_ft2");
......@@ -335,7 +335,7 @@ uint _ma_ft_convert_to_ft2(MARIA_HA *info, uint keynr, byte *key)
DBUG_RETURN(-1);
/* inserting the rest of key values */
end= (byte*) dynamic_array_ptr(da, da->elements);
end= (uchar*) dynamic_array_ptr(da, da->elements);
for (key_ptr+=length; key_ptr < end; key_ptr+=keyinfo->keylength)
if(_ma_ck_real_write_btree(info, keyinfo, key_ptr, 0, &root, SEARCH_SAME))
DBUG_RETURN(-1);
......
......@@ -96,44 +96,44 @@
#define FTB_RQUOT (ft_boolean_syntax[11])
typedef struct st_maria_ft_word {
byte * pos;
uchar * pos;
uint len;
double weight;
} FT_WORD;
int is_stopword(char *word, uint len);
uint _ma_ft_make_key(MARIA_HA *, uint , byte *, FT_WORD *, my_off_t);
uint _ma_ft_make_key(MARIA_HA *, uint , uchar *, FT_WORD *, my_off_t);
byte maria_ft_get_word(CHARSET_INFO *, byte **, byte *, FT_WORD *,
uchar maria_ft_get_word(CHARSET_INFO *, uchar **, uchar *, FT_WORD *,
MYSQL_FTPARSER_BOOLEAN_INFO *);
byte maria_ft_simple_get_word(CHARSET_INFO *, byte **, const byte *,
uchar maria_ft_simple_get_word(CHARSET_INFO *, uchar **, const uchar *,
FT_WORD *, my_bool);
typedef struct _st_maria_ft_seg_iterator {
uint num, len;
HA_KEYSEG *seg;
const byte *rec, *pos;
const uchar *rec, *pos;
} FT_SEG_ITERATOR;
void _ma_ft_segiterator_init(MARIA_HA *, uint, const byte *, FT_SEG_ITERATOR *);
void _ma_ft_segiterator_dummy_init(const byte *, uint, FT_SEG_ITERATOR *);
void _ma_ft_segiterator_init(MARIA_HA *, uint, const uchar *, FT_SEG_ITERATOR *);
void _ma_ft_segiterator_dummy_init(const uchar *, uint, FT_SEG_ITERATOR *);
uint _ma_ft_segiterator(FT_SEG_ITERATOR *);
void maria_ft_parse_init(TREE *, CHARSET_INFO *);
int maria_ft_parse(TREE *, byte *, int, struct st_mysql_ftparser *parser,
int maria_ft_parse(TREE *, uchar *, int, struct st_mysql_ftparser *parser,
MYSQL_FTPARSER_PARAM *, MEM_ROOT *);
FT_WORD * maria_ft_linearize(TREE *, MEM_ROOT *);
FT_WORD * _ma_ft_parserecord(MARIA_HA *, uint, const byte *, MEM_ROOT *);
uint _ma_ft_parse(TREE *, MARIA_HA *, uint, const byte *,
FT_WORD * _ma_ft_parserecord(MARIA_HA *, uint, const uchar *, MEM_ROOT *);
uint _ma_ft_parse(TREE *, MARIA_HA *, uint, const uchar *,
MYSQL_FTPARSER_PARAM *, MEM_ROOT *);
FT_INFO *maria_ft_init_nlq_search(MARIA_HA *, uint, byte *, uint, uint, byte *);
FT_INFO *maria_ft_init_boolean_search(MARIA_HA *, uint, byte *, uint, CHARSET_INFO *);
FT_INFO *maria_ft_init_nlq_search(MARIA_HA *, uint, uchar *, uint, uint, uchar *);
FT_INFO *maria_ft_init_boolean_search(MARIA_HA *, uint, uchar *, uint, CHARSET_INFO *);
extern const struct _ft_vft _ma_ft_vft_nlq;
int maria_ft_nlq_read_next(FT_INFO *, char *);
float maria_ft_nlq_find_relevance(FT_INFO *, byte *, uint);
float maria_ft_nlq_find_relevance(FT_INFO *, uchar *, uint);
void maria_ft_nlq_close_search(FT_INFO *);
float maria_ft_nlq_get_relevance(FT_INFO *);
my_off_t maria_ft_nlq_get_docid(FT_INFO *);
......@@ -141,7 +141,7 @@ void maria_ft_nlq_reinit_search(FT_INFO *);
extern const struct _ft_vft _ma_ft_vft_boolean;
int maria_ft_boolean_read_next(FT_INFO *, char *);
float maria_ft_boolean_find_relevance(FT_INFO *, byte *, uint);
float maria_ft_boolean_find_relevance(FT_INFO *, uchar *, uint);
void maria_ft_boolean_close_search(FT_INFO *);
float maria_ft_boolean_get_relevance(FT_INFO *);
my_off_t maria_ft_boolean_get_docid(FT_INFO *);
......
......@@ -20,8 +20,8 @@
#include "maria_def.h"
#include "ft_global.h"
int _ma_ft_cmp(MARIA_HA *, uint, const byte *, const byte *);
int _ma_ft_add(MARIA_HA *, uint, byte *, const byte *, my_off_t);
int _ma_ft_del(MARIA_HA *, uint, byte *, const byte *, my_off_t);
int _ma_ft_cmp(MARIA_HA *, uint, const uchar *, const uchar *);
int _ma_ft_add(MARIA_HA *, uint, uchar *, const uchar *, my_off_t);
int _ma_ft_del(MARIA_HA *, uint, uchar *, const uchar *, my_off_t);
uint _ma_ft_convert_to_ft2(MARIA_HA *, uint, byte *);
uint _ma_ft_convert_to_ft2(MARIA_HA *, uint, uchar *);
......@@ -31,7 +31,7 @@
set_if_smaller(char_length,length); \
} while(0)
static int _ma_put_key_in_record(MARIA_HA *info,uint keynr,byte *record);
static int _ma_put_key_in_record(MARIA_HA *info,uint keynr,uchar *record);
/*
Make a intern key from a record
......@@ -48,11 +48,11 @@ static int _ma_put_key_in_record(MARIA_HA *info,uint keynr,byte *record);
Length of key
*/
uint _ma_make_key(register MARIA_HA *info, uint keynr, byte *key,
const byte *record, MARIA_RECORD_POS filepos)
uint _ma_make_key(register MARIA_HA *info, uint keynr, uchar *key,
const uchar *record, MARIA_RECORD_POS filepos)
{
const byte *pos;
byte *start;
const uchar *pos;
uchar *start;
reg1 HA_KEYSEG *keyseg;
my_bool is_ft= info->s->keyinfo[keynr].flag & HA_FULLTEXT;
DBUG_ENTER("_ma_make_key");
......@@ -112,7 +112,7 @@ uint _ma_make_key(register MARIA_HA *info, uint keynr, byte *key,
}
else
{
const byte *end= pos + length;
const uchar *end= pos + length;
while (pos < end && pos[0] == ' ')
pos++;
length= (uint) (end-pos);
......@@ -215,10 +215,10 @@ uint _ma_make_key(register MARIA_HA *info, uint keynr, byte *key,
last_use_keyseg Store pointer to the keyseg after the last used one
*/
uint _ma_pack_key(register MARIA_HA *info, uint keynr, byte *key,
const byte *old, uint k_length, HA_KEYSEG **last_used_keyseg)
uint _ma_pack_key(register MARIA_HA *info, uint keynr, uchar *key,
const uchar *old, uint k_length, HA_KEYSEG **last_used_keyseg)
{
byte *start_key=key;
uchar *start_key=key;
HA_KEYSEG *keyseg;
my_bool is_ft= info->s->keyinfo[keynr].flag & HA_FULLTEXT;
DBUG_ENTER("_ma_pack_key");
......@@ -230,7 +230,7 @@ uint _ma_pack_key(register MARIA_HA *info, uint keynr, byte *key,
enum ha_base_keytype type=(enum ha_base_keytype) keyseg->type;
uint length=min((uint) keyseg->length,(uint) k_length);
uint char_length;
const byte *pos;
const uchar *pos;
CHARSET_INFO *cs=keyseg->charset;
if (keyseg->null_bit)
......@@ -252,7 +252,7 @@ uint _ma_pack_key(register MARIA_HA *info, uint keynr, byte *key,
pos= old;
if (keyseg->flag & HA_SPACE_PACK)
{
const byte *end= pos + length;
const uchar *end= pos + length;
if (type != HA_KEYTYPE_NUM)
{
while (end > pos && end[-1] == ' ')
......@@ -350,12 +350,12 @@ uint _ma_pack_key(register MARIA_HA *info, uint keynr, byte *key,
*/
static int _ma_put_key_in_record(register MARIA_HA *info, uint keynr,
byte *record)
uchar *record)
{
reg2 byte *key;
byte *pos,*key_end;
reg2 uchar *key;
uchar *pos,*key_end;
reg1 HA_KEYSEG *keyseg;
byte *blob_ptr;
uchar *blob_ptr;
DBUG_ENTER("_ma_put_key_in_record");
blob_ptr= info->lastkey2; /* Place to put blob parts */
......@@ -378,7 +378,7 @@ static int _ma_put_key_in_record(register MARIA_HA *info, uint keynr,
if (keyseg->bit_length)
{
byte bits= *key++;
uchar bits= *key++;
set_rec_bits(bits, record + keyseg->bit_pos, keyseg->bit_start,
keyseg->bit_length);
length--;
......@@ -456,8 +456,8 @@ static int _ma_put_key_in_record(register MARIA_HA *info, uint keynr,
}
else if (keyseg->flag & HA_SWAP_KEY)
{
byte *to= record+keyseg->start+keyseg->length;
byte *end= key+keyseg->length;
uchar *to= record+keyseg->start+keyseg->length;
uchar *end= key+keyseg->length;
#ifdef CHECK_KEYS
if (end > key_end)
goto err;
......@@ -487,7 +487,7 @@ static int _ma_put_key_in_record(register MARIA_HA *info, uint keynr,
/* Here when key reads are used */
int _ma_read_key_record(MARIA_HA *info, byte *buf, MARIA_RECORD_POS filepos)
int _ma_read_key_record(MARIA_HA *info, uchar *buf, MARIA_RECORD_POS filepos)
{
fast_ma_writeinfo(info);
if (filepos != HA_OFFSET_ERROR)
......@@ -522,12 +522,12 @@ int _ma_read_key_record(MARIA_HA *info, byte *buf, MARIA_RECORD_POS filepos)
less than zero.
*/
ulonglong ma_retrieve_auto_increment(MARIA_HA *info,const byte *record)
ulonglong ma_retrieve_auto_increment(MARIA_HA *info,const uchar *record)
{
ulonglong value= 0; /* Store unsigned values here */
longlong s_value= 0; /* Store signed values here */
HA_KEYSEG *keyseg= info->s->keyinfo[info->s->base.auto_key-1].seg;
const byte *key= record + keyseg->start;
const uchar *key= record + keyseg->start;
switch (keyseg->type) {
case HA_KEYTYPE_INT8:
......
This diff is collapsed.
......@@ -127,7 +127,7 @@ typedef struct st_translog_header_buffer
Buffer for write decoded header of the record (depend on the record
type)
*/
byte header[TRANSLOG_RECORD_HEADER_MAX_SIZE];
uchar header[TRANSLOG_RECORD_HEADER_MAX_SIZE];
/* number of groups listed in */
uint groups_no;
/* in multi-group number of chunk0 pages (valid only if groups_no > 0) */
......@@ -151,12 +151,12 @@ typedef struct st_translog_header_buffer
typedef struct st_translog_scanner_data
{
byte buffer[TRANSLOG_PAGE_SIZE]; /* buffer for page content */
uchar buffer[TRANSLOG_PAGE_SIZE]; /* buffer for page content */
TRANSLOG_ADDRESS page_addr; /* current page address */
/* end of the log which we saw last time */
TRANSLOG_ADDRESS horizon;
TRANSLOG_ADDRESS last_file_page; /* Last page on in this file */
byte *page; /* page content pointer */
uchar *page; /* page content pointer */
/* offset of the chunk in the page */
translog_size_t page_offset;
/* set horizon only once at init */
......@@ -214,7 +214,7 @@ extern void translog_free_record_header(TRANSLOG_HEADER_BUFFER *buff);
extern translog_size_t translog_read_record(LSN lsn,
translog_size_t offset,
translog_size_t length,
byte *buffer,
uchar *buffer,
struct st_translog_reader_data
*data);
......
......@@ -54,7 +54,7 @@ typedef TRANSLOG_ADDRESS LSN;
#define LSN_REPLACE_OFFSET(L, S) (LSN_FINE_NO_PART(L) | (S))
/*
an 8-byte type whose most significant byte is used for "flags"; 7
an 8-byte type whose most significant uchar is used for "flags"; 7
other bytes are a LSN.
*/
typedef LSN LSN_WITH_FLAGS;
......
......@@ -38,7 +38,7 @@ static my_bool maria_scan_init_dummy(MARIA_HA *info);
static void maria_scan_end_dummy(MARIA_HA *info);
static my_bool maria_once_init_dummy(MARIA_SHARE *, File);
static my_bool maria_once_end_dummy(MARIA_SHARE *);
static byte *_ma_base_info_read(byte *ptr, MARIA_BASE_INFO *base);
static uchar *_ma_base_info_read(uchar *ptr, MARIA_BASE_INFO *base);
#define get_next_element(to,pos,size) { memcpy((char*) to,pos,(size_t) size); \
pos+=size;}
......@@ -97,7 +97,7 @@ static MARIA_HA *maria_clone_internal(MARIA_SHARE *share, int mode,
DBUG_ENTER("maria_clone_internal");
errpos= 0;
bzero((byte*) &info,sizeof(info));
bzero((uchar*) &info,sizeof(info));
if (mode == O_RDWR && share->mode == O_RDONLY)
{
......@@ -200,7 +200,7 @@ static MARIA_HA *maria_clone_internal(MARIA_SHARE *share, int mode,
switch (errpos) {
case 6:
(*share->end)(&info);
my_free((gptr) m_info,MYF(0));
my_free((uchar*) m_info,MYF(0));
/* fall through */
case 5:
if (data_file < 0)
......@@ -255,7 +255,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
kfile= -1;
errpos= 0;
head_length=sizeof(share_buff.state.header);
bzero((byte*) &info,sizeof(info));
bzero((uchar*) &info,sizeof(info));
my_realpath(name_buff, fn_format(org_name,name,"",MARIA_NAME_IEXT,
MY_UNPACK_FILENAME),MYF(0));
......@@ -263,7 +263,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
if (!(old_info=_ma_test_if_reopen(name_buff)))
{
share= &share_buff;
bzero((gptr) &share_buff,sizeof(share_buff));
bzero((uchar*) &share_buff,sizeof(share_buff));
share_buff.state.rec_per_key_part=rec_per_key_part;
share_buff.state.key_root=key_root;
share_buff.pagecache= multi_pagecache_search(name_buff, strlen(name_buff),
......@@ -290,8 +290,8 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
my_errno= HA_ERR_NOT_A_TABLE;
goto err;
}
if (memcmp((byte*) share->state.header.file_version,
(byte*) maria_file_magic, 4))
if (memcmp((uchar*) share->state.header.file_version,
(uchar*) maria_file_magic, 4))
{
DBUG_PRINT("error",("Wrong header in %s",name_buff));
DBUG_DUMP("error_dump",(char*) share->state.header.file_version,
......@@ -638,7 +638,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
(keys ? MARIA_INDEX_BLOCK_MARGIN *
share->block_size * keys : 0));
share->block_size= share->base.block_size;
my_afree((gptr) disk_cache);
my_afree((uchar*) disk_cache);
_ma_setup_functions(share);
if ((*share->once_init)(share, info.dfile.file))
goto err;
......@@ -724,12 +724,12 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
(*share->once_end)(share);
/* fall through */
case 4:
my_free((gptr) share,MYF(0));
my_free((uchar*) share,MYF(0));
/* fall through */
case 3:
/* fall through */
case 2:
my_afree((gptr) disk_cache);
my_afree((uchar*) disk_cache);
/* fall through */
case 1:
VOID(my_close(kfile,MYF(0)));
......@@ -748,13 +748,13 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
Reallocate a buffer, if the current buffer is not large enough
*/
my_bool _ma_alloc_buffer(byte **old_addr, my_size_t *old_size,
my_size_t new_size)
my_bool _ma_alloc_buffer(uchar **old_addr, size_t *old_size,
size_t new_size)
{
if (*old_size < new_size)
{
byte *addr;
if (!(addr= (byte*) my_realloc((gptr) *old_addr, new_size,
uchar *addr;
if (!(addr= (uchar*) my_realloc((uchar*) *old_addr, new_size,
MYF(MY_ALLOW_ZERO_PTR))))
return 1;
*old_addr= addr;
......@@ -1002,7 +1002,7 @@ uint _ma_state_info_write(File file, MARIA_STATE_INFO *state, uint pWrite)
}
byte *_ma_state_info_read(byte *ptr, MARIA_STATE_INFO *state)
uchar *_ma_state_info_read(uchar *ptr, MARIA_STATE_INFO *state)
{
uint i,keys,key_parts;
memcpy_fixed(&state->header,ptr, sizeof(state->header));
......@@ -1120,7 +1120,7 @@ uint _ma_base_info_write(File file, MARIA_BASE_INFO *base)
}
static byte *_ma_base_info_read(byte *ptr, MARIA_BASE_INFO *base)
static uchar *_ma_base_info_read(uchar *ptr, MARIA_BASE_INFO *base)
{
base->keystart= mi_sizekorr(ptr); ptr+= 8;
base->max_data_file_length= mi_sizekorr(ptr); ptr+= 8;
......@@ -1268,7 +1268,7 @@ char *_ma_uniquedef_read(char *ptr, MARIA_UNIQUEDEF *def)
def->keysegs = mi_uint2korr(ptr);
def->key = ptr[2];
def->null_are_equal=ptr[3];
return ptr+4; /* 1 extra byte */
return ptr+4; /* 1 extra uchar */
}
/***************************************************************************
......
This diff is collapsed.
......@@ -19,12 +19,12 @@
/* Fetch a key-page in memory */
byte *_ma_fetch_keypage(register MARIA_HA *info, MARIA_KEYDEF *keyinfo,
uchar *_ma_fetch_keypage(register MARIA_HA *info, MARIA_KEYDEF *keyinfo,
my_off_t page, int level,
byte *buff,
uchar *buff,
int return_buffer __attribute__ ((unused)))
{
byte *tmp;
uchar *tmp;
uint page_size;
DBUG_ENTER("_ma_fetch_keypage");
DBUG_PRINT("enter",("page: %ld", (long) page));
......@@ -66,7 +66,7 @@ byte *_ma_fetch_keypage(register MARIA_HA *info, MARIA_KEYDEF *keyinfo,
/* Write a key-page on disk */
int _ma_write_keypage(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
my_off_t page, int level, byte *buff)
my_off_t page, int level, uchar *buff)
{
DBUG_ENTER("_ma_write_keypage");
......@@ -84,14 +84,14 @@ int _ma_write_keypage(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
DBUG_RETURN((-1));
}
DBUG_PRINT("page",("write page at: %lu",(long) page));
DBUG_DUMP("buff",(byte*) buff,maria_data_on_page(buff));
DBUG_DUMP("buff",(uchar*) buff,maria_data_on_page(buff));
#endif
#ifdef HAVE_purify
{
/* Clear unitialized part of page to avoid valgrind/purify warnings */
uint length= maria_data_on_page(buff);
bzero((byte*) buff+length,keyinfo->block_length-length);
bzero((uchar*) buff+length,keyinfo->block_length-length);
length=keyinfo->block_length;
}
#endif
......@@ -150,7 +150,7 @@ int _ma_dispose(register MARIA_HA *info, MARIA_KEYDEF *keyinfo, my_off_t pos,
my_off_t _ma_new(register MARIA_HA *info, MARIA_KEYDEF *keyinfo, int level)
{
my_off_t pos;
byte *buff;
uchar *buff;
DBUG_ENTER("_ma_new");
if ((pos= info->s->state.key_del) == HA_OFFSET_ERROR)
......
This diff is collapsed.
......@@ -93,7 +93,7 @@ typedef struct st_pagecache_hash_link PAGECACHE_HASH_LINK;
#include <wqueue.h>
typedef my_bool (*pagecache_disk_read_validator)(byte *page, gptr data);
typedef my_bool (*pagecache_disk_read_validator)(uchar *page, uchar** data);
#define PAGECACHE_CHANGED_BLOCKS_HASH 128 /* must be power of 2 */
......@@ -108,7 +108,7 @@ typedef struct st_pagecache
my_bool resize_in_flush; /* true during flush of resize operation */
my_bool can_be_used; /* usage of cache for read/write is allowed */
uint shift; /* block size = 2 ^ shift */
my_size_t mem_size; /* specified size of the cache memory */
size_t mem_size; /* specified size of the cache memory */
uint32 block_size; /* size of the page buffer of a cache block */
ulong min_warm_blocks; /* min number of warm blocks; */
ulong age_threshold; /* age threshold for hot blocks */
......@@ -128,7 +128,7 @@ typedef struct st_pagecache
PAGECACHE_HASH_LINK *free_hash_list;/* list of free hash links */
PAGECACHE_BLOCK_LINK *free_block_list;/* list of free blocks */
PAGECACHE_BLOCK_LINK *block_root;/* memory for block links */
byte HUGE_PTR *block_mem; /* memory for block buffers */
uchar HUGE_PTR *block_mem; /* memory for block buffers */
PAGECACHE_BLOCK_LINK *used_last;/* ptr to the last block of the LRU chain */
PAGECACHE_BLOCK_LINK *used_ins;/* ptr to the insertion block in LRU chain */
pthread_mutex_t cache_lock; /* to lock access to the cache structure */
......@@ -164,11 +164,11 @@ typedef struct st_pagecache
/* The default key cache */
extern PAGECACHE dflt_pagecache_var, *dflt_pagecache;
extern int init_pagecache(PAGECACHE *pagecache, my_size_t use_mem,
extern int init_pagecache(PAGECACHE *pagecache, size_t use_mem,
uint division_limit, uint age_threshold,
uint block_size);
extern int resize_pagecache(PAGECACHE *pagecache,
my_size_t use_mem, uint division_limit,
size_t use_mem, uint division_limit,
uint age_threshold);
extern void change_pagecache_param(PAGECACHE *pagecache, uint division_limit,
uint age_threshold);
......@@ -176,16 +176,16 @@ extern void change_pagecache_param(PAGECACHE *pagecache, uint division_limit,
#define pagecache_read(P,F,N,L,B,T,K,I) \
pagecache_valid_read(P,F,N,L,B,T,K,I,0,0)
extern byte *pagecache_valid_read(PAGECACHE *pagecache,
extern uchar *pagecache_valid_read(PAGECACHE *pagecache,
PAGECACHE_FILE *file,
pgcache_page_no_t pageno,
uint level,
byte *buff,
uchar *buff,
enum pagecache_page_type type,
enum pagecache_page_lock lock,
PAGECACHE_PAGE_LINK *link,
pagecache_disk_read_validator validator,
gptr validator_data);
uchar* validator_data);
#define pagecache_write(P,F,N,L,B,T,O,I,M,K) \
pagecache_write_part(P,F,N,L,B,T,O,I,M,K,0,(P)->block_size)
......@@ -194,7 +194,7 @@ extern my_bool pagecache_write_part(PAGECACHE *pagecache,
PAGECACHE_FILE *file,
pgcache_page_no_t pageno,
uint level,
byte *buff,
uchar *buff,
enum pagecache_page_type type,
enum pagecache_page_lock lock,
enum pagecache_page_pin pin,
......@@ -247,9 +247,9 @@ extern int reset_pagecache_counters(const char *name, PAGECACHE *pagecache);
/* Functions to handle multiple key caches */
extern my_bool multi_pagecache_init(void);
extern void multi_pagecache_free(void);
extern PAGECACHE *multi_pagecache_search(byte *key, uint length,
extern PAGECACHE *multi_pagecache_search(uchar *key, uint length,
PAGECACHE *def);
extern my_bool multi_pagecache_set(const byte *key, uint length,
extern my_bool multi_pagecache_set(const uchar *key, uint length,
PAGECACHE *pagecache);
extern void multi_pagecache_change(PAGECACHE *old_data,
PAGECACHE *new_data);
......
......@@ -38,7 +38,7 @@ static SAFE_HASH pagecache_hash;
my_bool multi_pagecache_init(void)
{
return safe_hash_init(&pagecache_hash, 16, (byte*) maria_pagecache);
return safe_hash_init(&pagecache_hash, 16, (uchar*) maria_pagecache);
}
......@@ -65,7 +65,7 @@ void multi_pagecache_free(void)
key cache to use
*/
PAGECACHE *multi_pagecache_search(byte *key, uint length,
PAGECACHE *multi_pagecache_search(uchar *key, uint length,
PAGECACHE *def)
{
if (!pagecache_hash.hash.records)
......@@ -91,15 +91,15 @@ PAGECACHE *multi_pagecache_search(byte *key, uint length,
*/
my_bool multi_pagecache_set(const byte *key, uint length,
my_bool multi_pagecache_set(const uchar *key, uint length,
PAGECACHE *pagecache)
{
return safe_hash_set(&pagecache_hash, key, length, (byte*) pagecache);
return safe_hash_set(&pagecache_hash, key, length, (uchar*) pagecache);
}
void multi_pagecache_change(PAGECACHE *old_data,
PAGECACHE *new_data)
{
safe_hash_change(&pagecache_hash, (byte*) old_data, (byte*) new_data);
safe_hash_change(&pagecache_hash, (uchar*) old_data, (uchar*) new_data);
}
This diff is collapsed.
This diff is collapsed.
......@@ -17,7 +17,7 @@
/* Read first row through a specfic key */
int maria_rfirst(MARIA_HA *info, byte *buf, int inx)
int maria_rfirst(MARIA_HA *info, uchar *buf, int inx)
{
DBUG_ENTER("maria_rfirst");
info->cur_row.lastpos= HA_OFFSET_ERROR;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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