summaryrefslogtreecommitdiff
path: root/storage/heap
diff options
context:
space:
mode:
authorunknown <jani@a88-113-38-195.elisa-laajakaista.fi>2007-05-24 13:24:36 +0300
committerunknown <jani@a88-113-38-195.elisa-laajakaista.fi>2007-05-24 13:24:36 +0300
commit6e849907977dd503ad82b9aa5039d17b5db1d7b7 (patch)
tree94027c861a0c3fd6ad62c4bee7ae5f7b1088f056 /storage/heap
parent2d95236b718002a48e31ded9449327da077200d8 (diff)
parentf252f9248ab31bbd53132db2c72267592c716c85 (diff)
downloadmariadb-git-6e849907977dd503ad82b9aa5039d17b5db1d7b7.tar.gz
Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1
into a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel BitKeeper/etc/ignore: auto-union client/mysql.cc: Auto merged client/mysqldump.c: Auto merged client/mysqltest.c: Auto merged extra/comp_err.c: Auto merged include/decimal.h: Auto merged include/my_getopt.h: Auto merged include/my_global.h: Auto merged include/my_sys.h: Auto merged include/mysql.h: Auto merged mysys/array.c: Auto merged mysys/hash.c: Auto merged mysys/typelib.c: Auto merged sql/derror.cc: Auto merged sql/event_data_objects.cc: Auto merged sql/event_queue.cc: Auto merged sql/field.cc: Auto merged sql/filesort.cc: Auto merged sql/ha_ndbcluster.h: Auto merged sql/ha_ndbcluster_binlog.cc: Auto merged sql/ha_partition.cc: Auto merged sql/ha_partition.h: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/item_subselect.cc: Auto merged sql/item_sum.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/item_timefunc.h: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/my_decimal.cc: Auto merged sql/my_decimal.h: Auto merged sql/mysql_priv.h: Auto merged sql/opt_range.cc: Auto merged sql/opt_range.h: Auto merged sql/opt_sum.cc: Auto merged sql/protocol.cc: Auto merged sql/protocol.h: Auto merged sql/rpl_utility.h: Auto merged sql/slave.cc: Auto merged sql/sp.cc: Auto merged sql/sp_head.cc: Auto merged sql/sp_head.h: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_connect.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_load.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_partition.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_repl.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_select.h: Auto merged sql/sql_show.cc: Auto merged sql/sql_trigger.cc: Auto merged sql/sql_union.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_view.cc: Auto merged sql/structs.h: Auto merged sql/table.h: Auto merged sql/tztime.cc: Auto merged sql/unireg.cc: Auto merged storage/example/ha_example.cc: Auto merged storage/federated/ha_federated.cc: Auto merged storage/heap/ha_heap.cc: Auto merged storage/innobase/handler/ha_innodb.h: Auto merged storage/myisam/ha_myisam.cc: Auto merged storage/myisam/sort.c: Auto merged storage/myisammrg/ha_myisammrg.cc: Auto merged storage/ndb/tools/restore/consumer_restore.cpp: Auto merged strings/decimal.c: Auto merged strings/strtod.c: Auto merged include/hash.h: Manual merge with 5.1 main tree. mysys/my_getopt.c: Manual merge with 5.1 main tree. sql/field.h: Manual merge with 5.1 main tree. sql/ha_ndbcluster.cc: Manual merge with 5.1 main tree. sql/item_cmpfunc.h: Manual merge with 5.1 main tree. sql/item_create.cc: Manual merge with 5.1 main tree. sql/item_func.h: Manual merge with 5.1 main tree. sql/key.cc: Manual merge with 5.1 main tree. sql/lock.cc: Manual merge with 5.1 main tree. sql/mysqld.cc: Manual merge with 5.1 main tree. sql/set_var.cc: Manual merge with 5.1 main tree. sql/set_var.h: Manual merge with 5.1 main tree. sql/sql_base.cc: Manual merge with 5.1 main tree. sql/sql_handler.cc: Manual merge with 5.1 main tree. sql/sql_insert.cc: Manual merge with 5.1 main tree. sql/sql_plugin.cc: Manual merge with 5.1 main tree. sql/sql_table.cc: Manual merge with 5.1 main tree. sql/sql_yacc.yy: Manual merge with 5.1 main tree. sql/table.cc: Manual merge with 5.1 main tree. storage/innobase/handler/ha_innodb.cc: Manual merge with 5.1 main tree. storage/ndb/src/mgmsrv/InitConfigFileParser.cpp: Manual merge with 5.1 main tree. storage/ndb/tools/restore/restore_main.cpp: Manual merge with 5.1 main tree.
Diffstat (limited to 'storage/heap')
-rw-r--r--storage/heap/_check.c4
-rw-r--r--storage/heap/_rectest.c2
-rw-r--r--storage/heap/ha_heap.cc28
-rw-r--r--storage/heap/ha_heap.h28
-rw-r--r--storage/heap/heapdef.h52
-rw-r--r--storage/heap/hp_block.c23
-rw-r--r--storage/heap/hp_clear.c4
-rw-r--r--storage/heap/hp_close.c2
-rw-r--r--storage/heap/hp_create.c20
-rw-r--r--storage/heap/hp_delete.c10
-rw-r--r--storage/heap/hp_hash.c48
-rw-r--r--storage/heap/hp_info.c2
-rw-r--r--storage/heap/hp_open.c4
-rw-r--r--storage/heap/hp_rfirst.c6
-rw-r--r--storage/heap/hp_rkey.c8
-rw-r--r--storage/heap/hp_rlast.c6
-rw-r--r--storage/heap/hp_rnext.c6
-rw-r--r--storage/heap/hp_rprev.c6
-rw-r--r--storage/heap/hp_rrnd.c4
-rw-r--r--storage/heap/hp_rsame.c2
-rw-r--r--storage/heap/hp_scan.c2
-rw-r--r--storage/heap/hp_test1.c2
-rw-r--r--storage/heap/hp_test2.c4
-rw-r--r--storage/heap/hp_update.c4
-rw-r--r--storage/heap/hp_write.c32
25 files changed, 155 insertions, 154 deletions
diff --git a/storage/heap/_check.c b/storage/heap/_check.c
index 05f12dade0d..08b6da62ae1 100644
--- a/storage/heap/_check.c
+++ b/storage/heap/_check.c
@@ -167,7 +167,7 @@ static int check_one_rb_key(HP_INFO *info, uint keynr, ulong records,
HP_KEYDEF *keydef= info->s->keydef + keynr;
int error= 0;
ulong found= 0;
- byte *key, *recpos;
+ uchar *key, *recpos;
uint key_length;
uint not_used[2];
@@ -176,7 +176,7 @@ static int check_one_rb_key(HP_INFO *info, uint keynr, ulong records,
{
do
{
- memcpy(&recpos, key + (*keydef->get_key_length)(keydef,key), sizeof(byte*));
+ memcpy(&recpos, key + (*keydef->get_key_length)(keydef,key), sizeof(uchar*));
key_length= hp_rb_make_key(keydef, info->recbuf, recpos, 0);
if (ha_key_cmp(keydef->seg, (uchar*) info->recbuf, (uchar*) key,
key_length, SEARCH_FIND | SEARCH_SAME, not_used))
diff --git a/storage/heap/_rectest.c b/storage/heap/_rectest.c
index 2fd2d39bed7..068fedf719c 100644
--- a/storage/heap/_rectest.c
+++ b/storage/heap/_rectest.c
@@ -18,7 +18,7 @@
#include "heapdef.h"
-int hp_rectest(register HP_INFO *info, register const byte *old)
+int hp_rectest(register HP_INFO *info, register const uchar *old)
{
DBUG_ENTER("hp_rectest");
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index 096b0f63b5e..86bc2cc516e 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -178,7 +178,7 @@ void ha_heap::update_key_stats()
}
-int ha_heap::write_row(byte * buf)
+int ha_heap::write_row(uchar * buf)
{
int res;
ha_statistic_increment(&SSV::ha_write_count);
@@ -202,7 +202,7 @@ int ha_heap::write_row(byte * buf)
return res;
}
-int ha_heap::update_row(const byte * old_data, byte * new_data)
+int ha_heap::update_row(const uchar * old_data, uchar * new_data)
{
int res;
ha_statistic_increment(&SSV::ha_update_count);
@@ -221,7 +221,7 @@ int ha_heap::update_row(const byte * old_data, byte * new_data)
return res;
}
-int ha_heap::delete_row(const byte * buf)
+int ha_heap::delete_row(const uchar * buf)
{
int res;
ha_statistic_increment(&SSV::ha_delete_count);
@@ -238,7 +238,7 @@ int ha_heap::delete_row(const byte * buf)
return res;
}
-int ha_heap::index_read(byte * buf, const byte * key, key_part_map keypart_map,
+int ha_heap::index_read(uchar * buf, const uchar * key, key_part_map keypart_map,
enum ha_rkey_function find_flag)
{
DBUG_ASSERT(inited==INDEX);
@@ -248,7 +248,7 @@ int ha_heap::index_read(byte * buf, const byte * key, key_part_map keypart_map,
return error;
}
-int ha_heap::index_read_last(byte *buf, const byte *key, key_part_map keypart_map)
+int ha_heap::index_read_last(uchar *buf, const uchar *key, key_part_map keypart_map)
{
DBUG_ASSERT(inited==INDEX);
ha_statistic_increment(&SSV::ha_read_key_count);
@@ -258,7 +258,7 @@ int ha_heap::index_read_last(byte *buf, const byte *key, key_part_map keypart_ma
return error;
}
-int ha_heap::index_read_idx(byte * buf, uint index, const byte * key,
+int ha_heap::index_read_idx(uchar * buf, uint index, const uchar * key,
key_part_map keypart_map,
enum ha_rkey_function find_flag)
{
@@ -268,7 +268,7 @@ int ha_heap::index_read_idx(byte * buf, uint index, const byte * key,
return error;
}
-int ha_heap::index_next(byte * buf)
+int ha_heap::index_next(uchar * buf)
{
DBUG_ASSERT(inited==INDEX);
ha_statistic_increment(&SSV::ha_read_next_count);
@@ -277,7 +277,7 @@ int ha_heap::index_next(byte * buf)
return error;
}
-int ha_heap::index_prev(byte * buf)
+int ha_heap::index_prev(uchar * buf)
{
DBUG_ASSERT(inited==INDEX);
ha_statistic_increment(&SSV::ha_read_prev_count);
@@ -286,7 +286,7 @@ int ha_heap::index_prev(byte * buf)
return error;
}
-int ha_heap::index_first(byte * buf)
+int ha_heap::index_first(uchar * buf)
{
DBUG_ASSERT(inited==INDEX);
ha_statistic_increment(&SSV::ha_read_first_count);
@@ -295,7 +295,7 @@ int ha_heap::index_first(byte * buf)
return error;
}
-int ha_heap::index_last(byte * buf)
+int ha_heap::index_last(uchar * buf)
{
DBUG_ASSERT(inited==INDEX);
ha_statistic_increment(&SSV::ha_read_last_count);
@@ -309,7 +309,7 @@ int ha_heap::rnd_init(bool scan)
return scan ? heap_scan_init(file) : 0;
}
-int ha_heap::rnd_next(byte *buf)
+int ha_heap::rnd_next(uchar *buf)
{
ha_statistic_increment(&SSV::ha_read_rnd_next_count);
int error=heap_scan(file, buf);
@@ -317,7 +317,7 @@ int ha_heap::rnd_next(byte *buf)
return error;
}
-int ha_heap::rnd_pos(byte * buf, byte *pos)
+int ha_heap::rnd_pos(uchar * buf, uchar *pos)
{
int error;
HEAP_PTR heap_position;
@@ -328,7 +328,7 @@ int ha_heap::rnd_pos(byte * buf, byte *pos)
return error;
}
-void ha_heap::position(const byte *record)
+void ha_heap::position(const uchar *record)
{
*(HEAP_PTR*) ref= heap_position(file); // Ref is aligned
}
@@ -668,7 +668,7 @@ int ha_heap::create(const char *name, TABLE *table_arg,
share->max_rows) ?
share->max_rows : max_rows),
(ulong) share->min_rows, &hp_create_info);
- my_free((gptr) keydef, MYF(0));
+ my_free((uchar*) keydef, MYF(0));
if (file)
info(HA_STATUS_NO_LOCK | HA_STATUS_CONST | HA_STATUS_VARIABLE);
return (error);
diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h
index a2d531fc515..c93a33b524b 100644
--- a/storage/heap/ha_heap.h
+++ b/storage/heap/ha_heap.h
@@ -68,26 +68,26 @@ public:
int open(const char *name, int mode, uint test_if_locked);
int close(void);
void set_keys_for_scanning(void);
- int write_row(byte * buf);
- int update_row(const byte * old_data, byte * new_data);
- int delete_row(const byte * buf);
+ int write_row(uchar * buf);
+ int update_row(const uchar * old_data, uchar * new_data);
+ int delete_row(const uchar * buf);
virtual void get_auto_increment(ulonglong offset, ulonglong increment,
ulonglong nb_desired_values,
ulonglong *first_value,
ulonglong *nb_reserved_values);
- int index_read(byte * buf, const byte * key, key_part_map keypart_map,
+ int index_read(uchar * buf, const uchar * key, key_part_map keypart_map,
enum ha_rkey_function find_flag);
- int index_read_last(byte *buf, const byte *key, key_part_map keypart_map);
- int index_read_idx(byte * buf, uint index, const byte * key,
+ int index_read_last(uchar *buf, const uchar *key, key_part_map keypart_map);
+ int index_read_idx(uchar * buf, uint index, const uchar * key,
key_part_map keypart_map, enum ha_rkey_function find_flag);
- int index_next(byte * buf);
- int index_prev(byte * buf);
- int index_first(byte * buf);
- int index_last(byte * buf);
+ int index_next(uchar * buf);
+ int index_prev(uchar * buf);
+ int index_first(uchar * buf);
+ int index_last(uchar * buf);
int rnd_init(bool scan);
- int rnd_next(byte *buf);
- int rnd_pos(byte * buf, byte *pos);
- void position(const byte *record);
+ int rnd_next(uchar *buf);
+ int rnd_pos(uchar * buf, uchar *pos);
+ void position(const uchar *record);
int info(uint);
int extra(enum ha_extra_function operation);
int reset();
@@ -105,7 +105,7 @@ public:
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
enum thr_lock_type lock_type);
- int cmp_ref(const byte *ref1, const byte *ref2)
+ int cmp_ref(const uchar *ref1, const uchar *ref2)
{
HEAP_PTR ptr1=*(HEAP_PTR*)ref1;
HEAP_PTR ptr2=*(HEAP_PTR*)ref2;
diff --git a/storage/heap/heapdef.h b/storage/heap/heapdef.h
index b52a6c60ac6..c43d73eb96d 100644
--- a/storage/heap/heapdef.h
+++ b/storage/heap/heapdef.h
@@ -48,7 +48,7 @@ if (!(info->update & HA_STATE_AKTIV))\
typedef struct st_hp_hash_info
{
struct st_hp_hash_info *next_key;
- byte *ptr_to_rec;
+ uchar *ptr_to_rec;
} HASH_INFO;
typedef struct {
@@ -60,42 +60,42 @@ typedef struct {
/* Prototypes for intern functions */
extern HP_SHARE *hp_find_named_heap(const char *name);
-extern int hp_rectest(HP_INFO *info,const byte *old);
-extern byte *hp_find_block(HP_BLOCK *info,ulong pos);
-extern int hp_get_new_block(HP_BLOCK *info, ulong* alloc_length);
+extern int hp_rectest(HP_INFO *info,const uchar *old);
+extern uchar *hp_find_block(HP_BLOCK *info,ulong pos);
+extern int hp_get_new_block(HP_BLOCK *info, size_t* alloc_length);
extern void hp_free(HP_SHARE *info);
-extern byte *hp_free_level(HP_BLOCK *block,uint level,HP_PTRS *pos,
- byte *last_pos);
+extern uchar *hp_free_level(HP_BLOCK *block,uint level,HP_PTRS *pos,
+ uchar *last_pos);
extern int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo,
- const byte *record, byte *recpos);
+ const uchar *record, uchar *recpos);
extern int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo,
- const byte *record, byte *recpos);
+ const uchar *record, uchar *recpos);
extern int hp_rb_delete_key(HP_INFO *info,HP_KEYDEF *keyinfo,
- const byte *record,byte *recpos,int flag);
+ const uchar *record,uchar *recpos,int flag);
extern int hp_delete_key(HP_INFO *info,HP_KEYDEF *keyinfo,
- const byte *record,byte *recpos,int flag);
+ const uchar *record,uchar *recpos,int flag);
extern HASH_INFO *_heap_find_hash(HP_BLOCK *block,ulong pos);
-extern byte *hp_search(HP_INFO *info,HP_KEYDEF *keyinfo,const byte *key,
+extern uchar *hp_search(HP_INFO *info,HP_KEYDEF *keyinfo,const uchar *key,
uint nextflag);
-extern byte *hp_search_next(HP_INFO *info, HP_KEYDEF *keyinfo,
- const byte *key, HASH_INFO *pos);
-extern ulong hp_hashnr(HP_KEYDEF *keyinfo,const byte *key);
-extern ulong hp_rec_hashnr(HP_KEYDEF *keyinfo,const byte *rec);
+extern uchar *hp_search_next(HP_INFO *info, HP_KEYDEF *keyinfo,
+ const uchar *key, HASH_INFO *pos);
+extern ulong hp_hashnr(HP_KEYDEF *keyinfo,const uchar *key);
+extern ulong hp_rec_hashnr(HP_KEYDEF *keyinfo,const uchar *rec);
extern ulong hp_mask(ulong hashnr,ulong buffmax,ulong maxlength);
extern void hp_movelink(HASH_INFO *pos,HASH_INFO *next_link,
HASH_INFO *newlink);
-extern int hp_rec_key_cmp(HP_KEYDEF *keydef,const byte *rec1,
- const byte *rec2,
+extern int hp_rec_key_cmp(HP_KEYDEF *keydef,const uchar *rec1,
+ const uchar *rec2,
my_bool diff_if_only_endspace_difference);
-extern int hp_key_cmp(HP_KEYDEF *keydef,const byte *rec,
- const byte *key);
-extern void hp_make_key(HP_KEYDEF *keydef,byte *key,const byte *rec);
-extern uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key,
- const byte *rec, byte *recpos);
-extern uint hp_rb_key_length(HP_KEYDEF *keydef, const byte *key);
-extern uint hp_rb_null_key_length(HP_KEYDEF *keydef, const byte *key);
-extern uint hp_rb_var_key_length(HP_KEYDEF *keydef, const byte *key);
-extern my_bool hp_if_null_in_key(HP_KEYDEF *keyinfo, const byte *record);
+extern int hp_key_cmp(HP_KEYDEF *keydef,const uchar *rec,
+ const uchar *key);
+extern void hp_make_key(HP_KEYDEF *keydef,uchar *key,const uchar *rec);
+extern uint hp_rb_make_key(HP_KEYDEF *keydef, uchar *key,
+ const uchar *rec, uchar *recpos);
+extern uint hp_rb_key_length(HP_KEYDEF *keydef, const uchar *key);
+extern uint hp_rb_null_key_length(HP_KEYDEF *keydef, const uchar *key);
+extern uint hp_rb_var_key_length(HP_KEYDEF *keydef, const uchar *key);
+extern my_bool hp_if_null_in_key(HP_KEYDEF *keyinfo, const uchar *record);
extern int hp_close(register HP_INFO *info);
extern void hp_clear(HP_SHARE *info);
extern void hp_clear_keys(HP_SHARE *info);
diff --git a/storage/heap/hp_block.c b/storage/heap/hp_block.c
index 85219380287..c622a9e52f8 100644
--- a/storage/heap/hp_block.c
+++ b/storage/heap/hp_block.c
@@ -26,7 +26,7 @@
{p_0, p_1, ...} serve as indexes to descend the blocks tree.
*/
-byte *hp_find_block(HP_BLOCK *block, ulong pos)
+uchar *hp_find_block(HP_BLOCK *block, ulong pos)
{
reg1 int i;
reg3 HP_PTRS *ptr; /* block base ptr */
@@ -36,12 +36,13 @@ byte *hp_find_block(HP_BLOCK *block, ulong pos)
ptr=(HP_PTRS*)ptr->blocks[pos/block->level_info[i].records_under_level];
pos%=block->level_info[i].records_under_level;
}
- return (byte*) ptr+ pos*block->recbuffer;
+ return (uchar*) ptr+ pos*block->recbuffer;
}
/*
Get one new block-of-records. Alloc ptr to block if needed
+
SYNOPSIS
hp_get_new_block()
block HP_BLOCK tree-like block
@@ -53,7 +54,7 @@ byte *hp_find_block(HP_BLOCK *block, ulong pos)
1 Out of memory
*/
-int hp_get_new_block(HP_BLOCK *block, ulong *alloc_length)
+int hp_get_new_block(HP_BLOCK *block, size_t *alloc_length)
{
reg1 uint i,j;
HP_PTRS *root;
@@ -101,13 +102,13 @@ int hp_get_new_block(HP_BLOCK *block, ulong *alloc_length)
/* Occupy the free slot we've found at level i */
block->level_info[i].last_blocks->
blocks[HP_PTRS_IN_NOD - block->level_info[i].free_ptrs_in_block--]=
- (byte*) root;
+ (uchar*) root;
/* Add a block subtree with each node having one left-most child */
for (j=i-1 ; j >0 ; j--)
{
block->level_info[j].last_blocks= root++;
- block->level_info[j].last_blocks->blocks[0]=(byte*) root;
+ block->level_info[j].last_blocks->blocks[0]=(uchar*) root;
block->level_info[j].free_ptrs_in_block=HP_PTRS_IN_NOD-1;
}
@@ -124,27 +125,27 @@ int hp_get_new_block(HP_BLOCK *block, ulong *alloc_length)
/* free all blocks under level */
-byte *hp_free_level(HP_BLOCK *block, uint level, HP_PTRS *pos, byte *last_pos)
+uchar *hp_free_level(HP_BLOCK *block, uint level, HP_PTRS *pos, uchar *last_pos)
{
int i,max_pos;
- byte *next_ptr;
+ uchar *next_ptr;
if (level == 1)
- next_ptr=(byte*) pos+block->recbuffer;
+ next_ptr=(uchar*) pos+block->recbuffer;
else
{
max_pos= (block->level_info[level-1].last_blocks == pos) ?
HP_PTRS_IN_NOD - block->level_info[level-1].free_ptrs_in_block :
HP_PTRS_IN_NOD;
- next_ptr=(byte*) (pos+1);
+ next_ptr=(uchar*) (pos+1);
for (i=0 ; i < max_pos ; i++)
next_ptr=hp_free_level(block,level-1,
(HP_PTRS*) pos->blocks[i],next_ptr);
}
- if ((byte*) pos != last_pos)
+ if ((uchar*) pos != last_pos)
{
- my_free((gptr) pos,MYF(0));
+ my_free((uchar*) pos,MYF(0));
return last_pos;
}
return next_ptr; /* next memory position */
diff --git a/storage/heap/hp_clear.c b/storage/heap/hp_clear.c
index 2d8b8b394d5..babfcbd6f41 100644
--- a/storage/heap/hp_clear.c
+++ b/storage/heap/hp_clear.c
@@ -32,7 +32,7 @@ void hp_clear(HP_SHARE *info)
if (info->block.levels)
VOID(hp_free_level(&info->block,info->block.levels,info->block.root,
- (byte*) 0));
+ (uchar*) 0));
info->block.levels=0;
hp_clear_keys(info);
info->records= info->deleted= 0;
@@ -94,7 +94,7 @@ void hp_clear_keys(HP_SHARE *info)
{
HP_BLOCK *block= &keyinfo->block;
if (block->levels)
- VOID(hp_free_level(block,block->levels,block->root,(byte*) 0));
+ VOID(hp_free_level(block,block->levels,block->root,(uchar*) 0));
block->levels=0;
block->last_allocated=0;
keyinfo->hash_buckets= 0;
diff --git a/storage/heap/hp_close.c b/storage/heap/hp_close.c
index 5f6fc3249b5..79fed859487 100644
--- a/storage/heap/hp_close.c
+++ b/storage/heap/hp_close.c
@@ -45,6 +45,6 @@ int hp_close(register HP_INFO *info)
heap_open_list=list_delete(heap_open_list,&info->open_list);
if (!--info->s->open_count && info->s->delete_on_close)
hp_free(info->s); /* Table was deleted */
- my_free((gptr) info,MYF(0));
+ my_free((uchar*) info,MYF(0));
DBUG_RETURN(error);
}
diff --git a/storage/heap/hp_create.c b/storage/heap/hp_create.c
index 4e1347966b9..b910b89ffcd 100644
--- a/storage/heap/hp_create.c
+++ b/storage/heap/hp_create.c
@@ -42,10 +42,10 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
DBUG_PRINT("info",("Initializing new table"));
/*
- We have to store sometimes byte* del_link in records,
- so the record length should be at least sizeof(byte*)
+ We have to store sometimes uchar* del_link in records,
+ so the record length should be at least sizeof(uchar*)
*/
- set_if_bigger(reclength, sizeof (byte*));
+ set_if_bigger(reclength, sizeof (uchar*));
for (i= key_segs= max_length= 0, keyinfo= keydef; i < keys; i++, keyinfo++)
{
@@ -112,7 +112,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
}
keyinfo->length= length;
length+= keyinfo->rb_tree.size_of_element +
- ((keyinfo->algorithm == HA_KEY_ALG_BTREE) ? sizeof(byte*) : 0);
+ ((keyinfo->algorithm == HA_KEY_ALG_BTREE) ? sizeof(uchar*) : 0);
if (length > max_length)
max_length= length;
key_segs+= keyinfo->keysegs;
@@ -152,12 +152,12 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
{
/* additional HA_KEYTYPE_END keyseg */
keyseg->type= HA_KEYTYPE_END;
- keyseg->length= sizeof(byte*);
+ keyseg->length= sizeof(uchar*);
keyseg->flag= 0;
keyseg->null_bit= 0;
keyseg++;
- init_tree(&keyinfo->rb_tree, 0, 0, sizeof(byte*),
+ init_tree(&keyinfo->rb_tree, 0, 0, sizeof(uchar*),
(qsort_cmp2)keys_compare, 1, NULL, NULL);
keyinfo->delete_key= hp_rb_delete_key;
keyinfo->write_key= hp_rb_write_key;
@@ -188,7 +188,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
/* Must be allocated separately for rename to work */
if (!(share->name= my_strdup(name,MYF(0))))
{
- my_free((gptr) share,MYF(0));
+ my_free((uchar*) share,MYF(0));
pthread_mutex_unlock(&THR_LOCK_heap);
DBUG_RETURN(1);
}
@@ -218,7 +218,7 @@ static void init_block(HP_BLOCK *block, uint reclength, ulong min_records,
max_records= max(min_records,max_records);
if (!max_records)
max_records= 1000; /* As good as quess as anything */
- recbuffer= (uint) (reclength + sizeof(byte**) - 1) & ~(sizeof(byte**) - 1);
+ recbuffer= (uint) (reclength + sizeof(uchar**) - 1) & ~(sizeof(uchar**) - 1);
records_in_block= max_records / 10;
if (records_in_block < 10 && max_records)
records_in_block= 10;
@@ -285,7 +285,7 @@ void hp_free(HP_SHARE *share)
thr_lock_delete(&share->lock);
VOID(pthread_mutex_destroy(&share->intern_lock));
#endif
- my_free((gptr) share->name, MYF(0));
- my_free((gptr) share, MYF(0));
+ my_free((uchar*) share->name, MYF(0));
+ my_free((uchar*) share, MYF(0));
return;
}
diff --git a/storage/heap/hp_delete.c b/storage/heap/hp_delete.c
index 637e5f1a497..1dd79a42e0b 100644
--- a/storage/heap/hp_delete.c
+++ b/storage/heap/hp_delete.c
@@ -17,9 +17,9 @@
#include "heapdef.h"
-int heap_delete(HP_INFO *info, const byte *record)
+int heap_delete(HP_INFO *info, const uchar *record)
{
- byte *pos;
+ uchar *pos;
HP_SHARE *share=info->s;
HP_KEYDEF *keydef, *end, *p_lastinx;
DBUG_ENTER("heap_delete");
@@ -43,7 +43,7 @@ int heap_delete(HP_INFO *info, const byte *record)
}
info->update=HA_STATE_DELETED;
- *((byte**) pos)=share->del_link;
+ *((uchar**) pos)=share->del_link;
share->del_link=pos;
pos[share->reclength]=0; /* Record deleted */
share->deleted++;
@@ -65,7 +65,7 @@ err:
*/
int hp_rb_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
- const byte *record, byte *recpos, int flag)
+ const uchar *record, uchar *recpos, int flag)
{
heap_rb_param custom_arg;
uint old_allocated;
@@ -105,7 +105,7 @@ int hp_rb_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
*/
int hp_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
- const byte *record, byte *recpos, int flag)
+ const uchar *record, uchar *recpos, int flag)
{
ulong blength,pos2,pos_hashnr,lastpos_hashnr;
HASH_INFO *lastpos,*gpos,*pos,*pos3,*empty,*last_ptr;
diff --git a/storage/heap/hp_hash.c b/storage/heap/hp_hash.c
index fbf3e541372..470b8c6841f 100644
--- a/storage/heap/hp_hash.c
+++ b/storage/heap/hp_hash.c
@@ -97,7 +97,7 @@ ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, key_range *min_key,
/* Sets info->current_ptr to found record */
/* next_flag: Search=0, next=1, prev =2, same =3 */
-byte *hp_search(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *key,
+uchar *hp_search(HP_INFO *info, HP_KEYDEF *keyinfo, const uchar *key,
uint nextflag)
{
reg1 HASH_INFO *pos,*prev_ptr;
@@ -175,7 +175,7 @@ byte *hp_search(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *key,
since last read !
*/
-byte *hp_search_next(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *key,
+uchar *hp_search_next(HP_INFO *info, HP_KEYDEF *keyinfo, const uchar *key,
HASH_INFO *pos)
{
DBUG_ENTER("hp_search_next");
@@ -238,7 +238,7 @@ void hp_movelink(HASH_INFO *pos, HASH_INFO *next_link, HASH_INFO *newlink)
/* Calc hashvalue for a key */
-ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
+ulong hp_hashnr(register HP_KEYDEF *keydef, register const uchar *key)
{
/*register*/
ulong nr=1, nr2=4;
@@ -304,7 +304,7 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
/* Calc hashvalue for a key in a record */
-ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
+ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const uchar *rec)
{
ulong nr=1, nr2=4;
HA_KEYSEG *seg,*endseg;
@@ -377,7 +377,7 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
* far, and works well on both numbers and strings.
*/
-ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
+ulong hp_hashnr(register HP_KEYDEF *keydef, register const uchar *key)
{
register ulong nr=0;
HA_KEYSEG *seg,*endseg;
@@ -426,7 +426,7 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
/* Calc hashvalue for a key in a record */
-ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
+ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const uchar *rec)
{
register ulong nr=0;
HA_KEYSEG *seg,*endseg;
@@ -490,7 +490,7 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
<> 0 Key differes
*/
-int hp_rec_key_cmp(HP_KEYDEF *keydef, const byte *rec1, const byte *rec2,
+int hp_rec_key_cmp(HP_KEYDEF *keydef, const uchar *rec1, const uchar *rec2,
my_bool diff_if_only_endspace_difference)
{
HA_KEYSEG *seg,*endseg;
@@ -577,7 +577,7 @@ int hp_rec_key_cmp(HP_KEYDEF *keydef, const byte *rec1, const byte *rec2,
/* Compare a key in a record to a whole key */
-int hp_key_cmp(HP_KEYDEF *keydef, const byte *rec, const byte *key)
+int hp_key_cmp(HP_KEYDEF *keydef, const uchar *rec, const uchar *key)
{
HA_KEYSEG *seg,*endseg;
@@ -661,7 +661,7 @@ int hp_key_cmp(HP_KEYDEF *keydef, const byte *rec, const byte *key)
/* Copy a key from a record to a keybuffer */
-void hp_make_key(HP_KEYDEF *keydef, byte *key, const byte *rec)
+void hp_make_key(HP_KEYDEF *keydef, uchar *key, const uchar *rec)
{
HA_KEYSEG *seg,*endseg;
@@ -693,10 +693,10 @@ void hp_make_key(HP_KEYDEF *keydef, byte *key, const byte *rec)
} while(0)
-uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key,
- const byte *rec, byte *recpos)
+uint hp_rb_make_key(HP_KEYDEF *keydef, uchar *key,
+ const uchar *rec, uchar *recpos)
{
- byte *start_key= key;
+ uchar *start_key= key;
HA_KEYSEG *seg, *endseg;
for (seg= keydef->seg, endseg= seg + keydef->keysegs; seg < endseg; seg++)
@@ -710,7 +710,7 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key,
if (seg->flag & HA_SWAP_KEY)
{
uint length= seg->length;
- byte *pos= (byte*) rec + seg->start;
+ uchar *pos= (uchar*) rec + seg->start;
#ifdef HAVE_ISNAN
if (seg->type == HA_KEYTYPE_FLOAT)
@@ -759,7 +759,7 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key,
set_if_smaller(length,tmp_length);
FIX_LENGTH(cs, pos, length, char_length);
store_key_length_inc(key,char_length);
- memcpy((byte*) key,(byte*) pos,(size_t) char_length);
+ memcpy((uchar*) key,(uchar*) pos,(size_t) char_length);
key+= char_length;
continue;
}
@@ -778,7 +778,7 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key,
memcpy(key, rec + seg->start, (size_t) char_length);
key+= seg->length;
}
- memcpy(key, &recpos, sizeof(byte*));
+ memcpy(key, &recpos, sizeof(uchar*));
return (uint) (key - start_key);
}
@@ -802,7 +802,7 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,
if (seg->flag & HA_SWAP_KEY)
{
uint length= seg->length;
- byte *pos= (byte*) old + length;
+ uchar *pos= (uchar*) old + length;
while (length--)
{
@@ -822,7 +822,7 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,
set_if_smaller(length,tmp_length); /* Safety */
FIX_LENGTH(cs, old, length, char_length);
store_key_length_inc(key,char_length);
- memcpy((byte*) key, old,(size_t) char_length);
+ memcpy((uchar*) key, old,(size_t) char_length);
key+= char_length;
continue;
}
@@ -844,15 +844,15 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,
uint hp_rb_key_length(HP_KEYDEF *keydef,
- const byte *key __attribute__((unused)))
+ const uchar *key __attribute__((unused)))
{
return keydef->length;
}
-uint hp_rb_null_key_length(HP_KEYDEF *keydef, const byte *key)
+uint hp_rb_null_key_length(HP_KEYDEF *keydef, const uchar *key)
{
- const byte *start_key= key;
+ const uchar *start_key= key;
HA_KEYSEG *seg, *endseg;
for (seg= keydef->seg, endseg= seg + keydef->keysegs; seg < endseg; seg++)
@@ -865,9 +865,9 @@ uint hp_rb_null_key_length(HP_KEYDEF *keydef, const byte *key)
}
-uint hp_rb_var_key_length(HP_KEYDEF *keydef, const byte *key)
+uint hp_rb_var_key_length(HP_KEYDEF *keydef, const uchar *key)
{
- const byte *start_key= key;
+ const uchar *start_key= key;
HA_KEYSEG *seg, *endseg;
for (seg= keydef->seg, endseg= seg + keydef->keysegs; seg < endseg; seg++)
@@ -892,7 +892,7 @@ uint hp_rb_var_key_length(HP_KEYDEF *keydef, const byte *key)
0 otherwise
*/
-my_bool hp_if_null_in_key(HP_KEYDEF *keydef, const byte *record)
+my_bool hp_if_null_in_key(HP_KEYDEF *keydef, const uchar *record)
{
HA_KEYSEG *seg,*endseg;
for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++)
@@ -918,7 +918,7 @@ my_bool hp_if_null_in_key(HP_KEYDEF *keydef, const byte *record)
less than zero.
*/
-void heap_update_auto_increment(HP_INFO *info, const byte *record)
+void heap_update_auto_increment(HP_INFO *info, const uchar *record)
{
ulonglong value= 0; /* Store unsigned values here */
longlong s_value= 0; /* Store signed values here */
diff --git a/storage/heap/hp_info.c b/storage/heap/hp_info.c
index 2c58604eed1..ea78c53fd40 100644
--- a/storage/heap/hp_info.c
+++ b/storage/heap/hp_info.c
@@ -18,7 +18,7 @@
#include "heapdef.h"
-byte *heap_position(HP_INFO *info)
+uchar *heap_position(HP_INFO *info)
{
return ((info->update & HA_STATE_AKTIV) ? info->current_ptr :
(HEAP_PTR) 0);
diff --git a/storage/heap/hp_open.c b/storage/heap/hp_open.c
index 02a8d4f95ca..d252704a11b 100644
--- a/storage/heap/hp_open.c
+++ b/storage/heap/hp_open.c
@@ -51,8 +51,8 @@ HP_INFO *heap_open(const char *name, int mode)
pthread_mutex_unlock(&THR_LOCK_heap);
info->s= share;
- info->lastkey= (byte*) (info + 1);
- info->recbuf= (byte*) (info->lastkey + share->max_key_length);
+ info->lastkey= (uchar*) (info + 1);
+ info->recbuf= (uchar*) (info->lastkey + share->max_key_length);
info->mode= mode;
info->current_record= (ulong) ~0L; /* No current record */
info->current_ptr= 0;
diff --git a/storage/heap/hp_rfirst.c b/storage/heap/hp_rfirst.c
index d1842949421..48c1e625bd8 100644
--- a/storage/heap/hp_rfirst.c
+++ b/storage/heap/hp_rfirst.c
@@ -17,7 +17,7 @@
/* Read first record with the current key */
-int heap_rfirst(HP_INFO *info, byte *record, int inx)
+int heap_rfirst(HP_INFO *info, uchar *record, int inx)
{
HP_SHARE *share = info->s;
HP_KEYDEF *keyinfo = share->keydef + inx;
@@ -26,13 +26,13 @@ int heap_rfirst(HP_INFO *info, byte *record, int inx)
info->lastinx= inx;
if (keyinfo->algorithm == HA_KEY_ALG_BTREE)
{
- byte *pos;
+ uchar *pos;
if ((pos = tree_search_edge(&keyinfo->rb_tree, info->parents,
&info->last_pos, offsetof(TREE_ELEMENT, left))))
{
memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos),
- sizeof(byte*));
+ sizeof(uchar*));
info->current_ptr = pos;
memcpy(record, pos, (size_t)share->reclength);
info->update = HA_STATE_AKTIV;
diff --git a/storage/heap/hp_rkey.c b/storage/heap/hp_rkey.c
index ced81985f99..6eeac6acd7b 100644
--- a/storage/heap/hp_rkey.c
+++ b/storage/heap/hp_rkey.c
@@ -15,10 +15,10 @@
#include "heapdef.h"
-int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key,
+int heap_rkey(HP_INFO *info, uchar *record, int inx, const uchar *key,
key_part_map keypart_map, enum ha_rkey_function find_flag)
{
- byte *pos;
+ uchar *pos;
HP_SHARE *share= info->s;
HP_KEYDEF *keyinfo= share->keydef + inx;
DBUG_ENTER("heap_rkey");
@@ -53,7 +53,7 @@ int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key,
info->update= 0;
DBUG_RETURN(my_errno= HA_ERR_KEY_NOT_FOUND);
}
- memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos), sizeof(byte*));
+ memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos), sizeof(uchar*));
info->current_ptr= pos;
}
else
@@ -74,7 +74,7 @@ int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key,
/* Quick find of record */
-gptr heap_find(HP_INFO *info, int inx, const byte *key)
+uchar* heap_find(HP_INFO *info, int inx, const uchar *key)
{
return hp_search(info, info->s->keydef + inx, key, 0);
}
diff --git a/storage/heap/hp_rlast.c b/storage/heap/hp_rlast.c
index b72e815147f..45ad7c21f49 100644
--- a/storage/heap/hp_rlast.c
+++ b/storage/heap/hp_rlast.c
@@ -18,7 +18,7 @@
/* Read first record with the current key */
-int heap_rlast(HP_INFO *info, byte *record, int inx)
+int heap_rlast(HP_INFO *info, uchar *record, int inx)
{
HP_SHARE *share= info->s;
HP_KEYDEF *keyinfo= share->keydef + inx;
@@ -27,13 +27,13 @@ int heap_rlast(HP_INFO *info, byte *record, int inx)
info->lastinx= inx;
if (keyinfo->algorithm == HA_KEY_ALG_BTREE)
{
- byte *pos;
+ uchar *pos;
if ((pos = tree_search_edge(&keyinfo->rb_tree, info->parents,
&info->last_pos, offsetof(TREE_ELEMENT, right))))
{
memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos),
- sizeof(byte*));
+ sizeof(uchar*));
info->current_ptr = pos;
memcpy(record, pos, (size_t)share->reclength);
info->update = HA_STATE_AKTIV;
diff --git a/storage/heap/hp_rnext.c b/storage/heap/hp_rnext.c
index 3b436fe87aa..262754e9e64 100644
--- a/storage/heap/hp_rnext.c
+++ b/storage/heap/hp_rnext.c
@@ -17,9 +17,9 @@
/* Read next record with the same key */
-int heap_rnext(HP_INFO *info, byte *record)
+int heap_rnext(HP_INFO *info, uchar *record)
{
- byte *pos;
+ uchar *pos;
HP_SHARE *share=info->s;
HP_KEYDEF *keyinfo;
DBUG_ENTER("heap_rnext");
@@ -47,7 +47,7 @@ int heap_rnext(HP_INFO *info, byte *record)
if (pos)
{
memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos),
- sizeof(byte*));
+ sizeof(uchar*));
info->current_ptr = pos;
}
else
diff --git a/storage/heap/hp_rprev.c b/storage/heap/hp_rprev.c
index bfdd2f9d47a..63bfffffba9 100644
--- a/storage/heap/hp_rprev.c
+++ b/storage/heap/hp_rprev.c
@@ -18,9 +18,9 @@
/* Read prev record for key */
-int heap_rprev(HP_INFO *info, byte *record)
+int heap_rprev(HP_INFO *info, uchar *record)
{
- byte *pos;
+ uchar *pos;
HP_SHARE *share=info->s;
HP_KEYDEF *keyinfo;
DBUG_ENTER("heap_rprev");
@@ -47,7 +47,7 @@ int heap_rprev(HP_INFO *info, byte *record)
if (pos)
{
memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos),
- sizeof(byte*));
+ sizeof(uchar*));
info->current_ptr = pos;
}
else
diff --git a/storage/heap/hp_rrnd.c b/storage/heap/hp_rrnd.c
index ad0190cc00c..3ac23d293f2 100644
--- a/storage/heap/hp_rrnd.c
+++ b/storage/heap/hp_rrnd.c
@@ -24,7 +24,7 @@
HA_ERR_END_OF_FILE = EOF.
*/
-int heap_rrnd(register HP_INFO *info, byte *record, byte *pos)
+int heap_rrnd(register HP_INFO *info, uchar *record, uchar *pos)
{
HP_SHARE *share=info->s;
DBUG_ENTER("heap_rrnd");
@@ -59,7 +59,7 @@ int heap_rrnd(register HP_INFO *info, byte *record, byte *pos)
HA_ERR_END_OF_FILE = EOF.
*/
-int heap_rrnd_old(register HP_INFO *info, byte *record, ulong pos)
+int heap_rrnd_old(register HP_INFO *info, uchar *record, ulong pos)
{
HP_SHARE *share=info->s;
DBUG_ENTER("heap_rrnd");
diff --git a/storage/heap/hp_rsame.c b/storage/heap/hp_rsame.c
index 10513f91726..1a3724672b6 100644
--- a/storage/heap/hp_rsame.c
+++ b/storage/heap/hp_rsame.c
@@ -25,7 +25,7 @@
HA_ERR_KEY_NOT_FOUND = Record not found with key
*/
-int heap_rsame(register HP_INFO *info, byte *record, int inx)
+int heap_rsame(register HP_INFO *info, uchar *record, int inx)
{
HP_SHARE *share=info->s;
DBUG_ENTER("heap_rsame");
diff --git a/storage/heap/hp_scan.c b/storage/heap/hp_scan.c
index 4249ac4148a..e8913e92c86 100644
--- a/storage/heap/hp_scan.c
+++ b/storage/heap/hp_scan.c
@@ -34,7 +34,7 @@ int heap_scan_init(register HP_INFO *info)
DBUG_RETURN(0);
}
-int heap_scan(register HP_INFO *info, byte *record)
+int heap_scan(register HP_INFO *info, uchar *record)
{
HP_SHARE *share=info->s;
ulong pos;
diff --git a/storage/heap/hp_test1.c b/storage/heap/hp_test1.c
index 31c9b8f2f30..aad5677db69 100644
--- a/storage/heap/hp_test1.c
+++ b/storage/heap/hp_test1.c
@@ -55,7 +55,7 @@ int main(int argc, char **argv)
keyinfo[0].flag = HA_NOSAME;
deleted=0;
- bzero((gptr) flags,sizeof(flags));
+ bzero((uchar*) flags,sizeof(flags));
printf("- Creating heap-file\n");
if (heap_create(filename,1,keyinfo,30,(ulong) flag*100000L,10L,
diff --git a/storage/heap/hp_test2.c b/storage/heap/hp_test2.c
index dcca5fb44b9..46b1fd61d46 100644
--- a/storage/heap/hp_test2.c
+++ b/storage/heap/hp_test2.c
@@ -42,7 +42,7 @@ static my_bool key3[MAX_RECORDS];
static int reclength=39;
-static int calc_check(byte *buf,uint length);
+static int calc_check(uchar *buf,uint length);
static void make_record(char *record, uint n1, uint n2, uint n3,
const char *mark, uint count);
@@ -674,7 +674,7 @@ static sig_handler endprog(int sig_number __attribute__((unused)))
}
}
-static int calc_check(byte *buf, uint length)
+static int calc_check(uchar *buf, uint length)
{
int check=0;
while (length--)
diff --git a/storage/heap/hp_update.c b/storage/heap/hp_update.c
index e7314e3d38c..11dca974ad4 100644
--- a/storage/heap/hp_update.c
+++ b/storage/heap/hp_update.c
@@ -17,10 +17,10 @@
#include "heapdef.h"
-int heap_update(HP_INFO *info, const byte *old, const byte *heap_new)
+int heap_update(HP_INFO *info, const uchar *old, const uchar *heap_new)
{
HP_KEYDEF *keydef, *end, *p_lastinx;
- byte *pos;
+ uchar *pos;
bool auto_key_changed= 0;
HP_SHARE *share= info->s;
DBUG_ENTER("heap_update");
diff --git a/storage/heap/hp_write.c b/storage/heap/hp_write.c
index 19215fcf017..2abef2d9b43 100644
--- a/storage/heap/hp_write.c
+++ b/storage/heap/hp_write.c
@@ -25,14 +25,14 @@
#define HIGHFIND 4
#define HIGHUSED 8
-static byte *next_free_record_pos(HP_SHARE *info);
+static uchar *next_free_record_pos(HP_SHARE *info);
static HASH_INFO *hp_find_free_hash(HP_SHARE *info, HP_BLOCK *block,
ulong records);
-int heap_write(HP_INFO *info, const byte *record)
+int heap_write(HP_INFO *info, const uchar *record)
{
HP_KEYDEF *keydef, *end;
- byte *pos;
+ uchar *pos;
HP_SHARE *share=info->s;
DBUG_ENTER("heap_write");
#ifndef DBUG_OFF
@@ -88,7 +88,7 @@ err:
}
share->deleted++;
- *((byte**) pos)=share->del_link;
+ *((uchar**) pos)=share->del_link;
share->del_link=pos;
pos[share->reclength]=0; /* Record deleted */
@@ -99,8 +99,8 @@ err:
Write a key to rb_tree-index
*/
-int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *record,
- byte *recpos)
+int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, const uchar *record,
+ uchar *recpos)
{
heap_rb_param custom_arg;
uint old_allocated;
@@ -130,17 +130,17 @@ int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *record,
/* Find where to place new record */
-static byte *next_free_record_pos(HP_SHARE *info)
+static uchar *next_free_record_pos(HP_SHARE *info)
{
int block_pos;
- byte *pos;
- ulong length;
+ uchar *pos;
+ size_t length;
DBUG_ENTER("next_free_record_pos");
if (info->del_link)
{
pos=info->del_link;
- info->del_link= *((byte**) pos);
+ info->del_link= *((uchar**) pos);
info->deleted--;
DBUG_PRINT("exit",("Used old position: 0x%lx",(long) pos));
DBUG_RETURN(pos);
@@ -158,9 +158,9 @@ static byte *next_free_record_pos(HP_SHARE *info)
info->data_length+=length;
}
DBUG_PRINT("exit",("Used new position: 0x%lx",
- (long) ((byte*) info->block.level_info[0].last_blocks+
+ (long) ((uchar*) info->block.level_info[0].last_blocks+
block_pos * info->block.recbuffer)));
- DBUG_RETURN((byte*) info->block.level_info[0].last_blocks+
+ DBUG_RETURN((uchar*) info->block.level_info[0].last_blocks+
block_pos*info->block.recbuffer);
}
@@ -191,12 +191,12 @@ static byte *next_free_record_pos(HP_SHARE *info)
*/
int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo,
- const byte *record, byte *recpos)
+ const uchar *record, uchar *recpos)
{
HP_SHARE *share = info->s;
int flag;
ulong halfbuff,hashnr,first_index;
- byte *ptr_to_rec,*ptr_to_rec2;
+ uchar *ptr_to_rec,*ptr_to_rec2;
HASH_INFO *empty,*gpos,*gpos2,*pos;
DBUG_ENTER("hp_write_key");
@@ -390,7 +390,7 @@ static HASH_INFO *hp_find_free_hash(HP_SHARE *info,
HP_BLOCK *block, ulong records)
{
uint block_pos;
- ulong length;
+ size_t length;
if (records < block->last_allocated)
return hp_find_hash(block,records);
@@ -401,6 +401,6 @@ static HASH_INFO *hp_find_free_hash(HP_SHARE *info,
info->index_length+=length;
}
block->last_allocated=records+1;
- return((HASH_INFO*) ((byte*) block->level_info[0].last_blocks+
+ return((HASH_INFO*) ((uchar*) block->level_info[0].last_blocks+
block_pos*block->recbuffer));
}