summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorunknown <jani@hynda.mysql.fi>2007-07-02 20:45:15 +0300
committerunknown <jani@hynda.mysql.fi>2007-07-02 20:45:15 +0300
commit631ecaabea7336a8f28367c0d1c291f0433f7e88 (patch)
tree2eb68f1f6af5e60c4bcdd8fcfa7e14f3650de830 /storage
parentcfdd73369c0c2d57908af8dc727de33567fe9e0b (diff)
downloadmariadb-git-631ecaabea7336a8f28367c0d1c291f0433f7e88.tar.gz
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.
Diffstat (limited to 'storage')
-rw-r--r--storage/maria/ft_maria.c4
-rw-r--r--storage/maria/ha_maria.cc98
-rw-r--r--storage/maria/ha_maria.h34
-rw-r--r--storage/maria/ma_bitmap.c12
-rw-r--r--storage/maria/ma_blockrec.c234
-rw-r--r--storage/maria/ma_blockrec.h26
-rw-r--r--storage/maria/ma_cache.c4
-rw-r--r--storage/maria/ma_check.c222
-rw-r--r--storage/maria/ma_checkpoint.c2
-rw-r--r--storage/maria/ma_checksum.c6
-rw-r--r--storage/maria/ma_close.c6
-rw-r--r--storage/maria/ma_create.c18
-rw-r--r--storage/maria/ma_dbug.c6
-rw-r--r--storage/maria/ma_delete.c104
-rw-r--r--storage/maria/ma_dynrec.c183
-rw-r--r--storage/maria/ma_extra.c8
-rw-r--r--storage/maria/ma_ft_boolean_search.c35
-rw-r--r--storage/maria/ma_ft_nlq_search.c12
-rw-r--r--storage/maria/ma_ft_parser.c26
-rw-r--r--storage/maria/ma_ft_update.c34
-rw-r--r--storage/maria/ma_ftdefs.h28
-rw-r--r--storage/maria/ma_fulltext.h8
-rw-r--r--storage/maria/ma_key.c42
-rw-r--r--storage/maria/ma_loghandler.c156
-rw-r--r--storage/maria/ma_loghandler.h8
-rw-r--r--storage/maria/ma_loghandler_lsn.h2
-rw-r--r--storage/maria/ma_open.c34
-rw-r--r--storage/maria/ma_packrec.c230
-rw-r--r--storage/maria/ma_page.c14
-rwxr-xr-xstorage/maria/ma_pagecache.c54
-rw-r--r--storage/maria/ma_pagecache.h22
-rw-r--r--storage/maria/ma_pagecaches.c10
-rw-r--r--storage/maria/ma_preload.c6
-rw-r--r--storage/maria/ma_range.c22
-rw-r--r--storage/maria/ma_rfirst.c2
-rw-r--r--storage/maria/ma_rkey.c4
-rw-r--r--storage/maria/ma_rlast.c2
-rw-r--r--storage/maria/ma_rnext.c2
-rw-r--r--storage/maria/ma_rnext_same.c2
-rw-r--r--storage/maria/ma_rprev.c2
-rw-r--r--storage/maria/ma_rrnd.c2
-rw-r--r--storage/maria/ma_rsame.c2
-rw-r--r--storage/maria/ma_rsamepos.c2
-rw-r--r--storage/maria/ma_rt_index.c94
-rw-r--r--storage/maria/ma_rt_index.h14
-rw-r--r--storage/maria/ma_rt_key.c10
-rw-r--r--storage/maria/ma_rt_key.h8
-rw-r--r--storage/maria/ma_rt_mbr.c24
-rw-r--r--storage/maria/ma_rt_mbr.h18
-rw-r--r--storage/maria/ma_rt_split.c16
-rw-r--r--storage/maria/ma_scan.c2
-rw-r--r--storage/maria/ma_search.c162
-rw-r--r--storage/maria/ma_sort.c132
-rw-r--r--storage/maria/ma_sp_defs.h4
-rw-r--r--storage/maria/ma_sp_key.c16
-rw-r--r--storage/maria/ma_static.c2
-rw-r--r--storage/maria/ma_statrec.c34
-rw-r--r--storage/maria/ma_test1.c50
-rw-r--r--storage/maria/ma_test2.c8
-rw-r--r--storage/maria/ma_test3.c4
-rw-r--r--storage/maria/ma_unique.c18
-rw-r--r--storage/maria/ma_update.c4
-rw-r--r--storage/maria/ma_write.c158
-rw-r--r--storage/maria/maria_chk.c98
-rw-r--r--storage/maria/maria_def.h270
-rw-r--r--storage/maria/maria_ftdump.c2
-rw-r--r--storage/maria/maria_pack.c162
-rw-r--r--storage/maria/tablockman.c8
-rw-r--r--storage/maria/trnman.c4
-rw-r--r--storage/maria/trnman.h2
-rw-r--r--storage/maria/unittest/ma_pagecache_consist.c6
-rw-r--r--storage/maria/unittest/ma_pagecache_single.c2
-rw-r--r--storage/maria/unittest/ma_test_loghandler-t.c12
-rw-r--r--storage/maria/unittest/ma_test_loghandler_multigroup-t.c14
-rw-r--r--storage/maria/unittest/ma_test_loghandler_multithread-t.c12
-rw-r--r--storage/maria/unittest/ma_test_loghandler_pagecache-t.c2
-rw-r--r--storage/myisam/ft_myisam.c4
-rw-r--r--storage/myisam/ha_myisam.cc9
-rw-r--r--storage/myisam/myisamdef.h7
-rw-r--r--storage/myisam/sort.c8
-rw-r--r--storage/myisammrg/ha_myisammrg.cc20
81 files changed, 1575 insertions, 1575 deletions
diff --git a/storage/maria/ft_maria.c b/storage/maria/ft_maria.c
index 06e7c4bd59c..1b082f904d0 100644
--- a/storage/maria/ft_maria.c
+++ b/storage/maria/ft_maria.c
@@ -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)
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index e05f97a384d..0e629d6638c 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -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;
diff --git a/storage/maria/ha_maria.h b/storage/maria/ha_maria.h
index a2f6b190657..22741ddb24d 100644
--- a/storage/maria/ha_maria.h
+++ b/storage/maria/ha_maria.h
@@ -77,19 +77,19 @@ public:
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 @@ public:
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);
diff --git a/storage/maria/ma_bitmap.c b/storage/maria/ma_bitmap.c
index e1308bce487..e781c47c241 100644
--- a/storage/maria/ma_bitmap.c
+++ b/storage/maria/ma_bitmap.c
@@ -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 @@ err:
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");
diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c
index d2512f1e025..0c502641d9b 100644
--- a/storage/maria/ma_blockrec.c
+++ b/storage/maria/ma_blockrec.c
@@ -53,8 +53,8 @@
Page header:
LSN 7 bytes Log position for last page change
- PAGE_TYPE 1 byte 1 for head / 2 for tail / 3 for blob
- NO 1 byte Number of row/tail entries on page
+ PAGE_TYPE 1 uchar 1 for head / 2 for tail / 3 for blob
+ NO 1 uchar Number of row/tail entries on page
empty space 2 bytes Empty space on page
The most significant bit in PAGE_TYPE is set to 1 if the data on the page
@@ -72,7 +72,7 @@
the 1 most significant bit of the length could be used for some states of
the row (in other words, we should try to keep these reserved)
- eof flag 1 byte Reserved for full page read testing. (Ie, did the
+ eof flag 1 uchar Reserved for full page read testing. (Ie, did the
previous write get the whole block on disk.
----------------
@@ -80,7 +80,7 @@
Structure of blob pages:
LSN 7 bytes Log position for last page change
- PAGE_TYPE 1 byte 3
+ PAGE_TYPE 1 uchar 3
data
@@ -88,7 +88,7 @@
Row data structure:
- Flag 1 byte Marker of which header field exists
+ Flag 1 uchar Marker of which header field exists
TRANSID 6 bytes TRANSID of changing transaction
(optional, added on insert and first
update/delete)
@@ -98,17 +98,17 @@
update/delete)
DELETE_TRANSID 6 bytes (optional). TRANSID of original row.
Added on delete.
- Nulls_extended 1 byte To allow us to add new DEFAULT NULL
+ Nulls_extended 1 uchar To allow us to add new DEFAULT NULL
fields (optional, added after first
change of row after alter table)
- Number of ROW_EXTENT's 1-3 byte Length encoded, optional
+ Number of ROW_EXTENT's 1-3 uchar Length encoded, optional
This is the number of extents the
row is split into
- First row_extent 7 byte Pointer to first row extent (optional)
+ First row_extent 7 uchar Pointer to first row extent (optional)
- Total length of length array 1-3 byte Only used if we have
+ Total length of length array 1-3 uchar Only used if we have
char/varchar/blob fields.
- Row checksum 1 byte Only if table created with checksums
+ Row checksum 1 uchar Only if table created with checksums
Null_bits .. One bit for each NULL field (a field that may
have the value NULL)
Empty_bits .. One bit for each field that may be 'empty'.
@@ -137,7 +137,7 @@
Critical fixed length, not null, fields. (Note, these can't be dropped)
Fixed length, null fields
- Length array, 1-4 byte per field for all CHAR/VARCHAR/BLOB fields.
+ Length array, 1-4 uchar per field for all CHAR/VARCHAR/BLOB fields.
Number of bytes used in length array per entry is depending on max length
for field.
@@ -272,12 +272,12 @@
typedef struct st_maria_extent_cursor
{
/*
- Pointer to packed byte array of extents for the row.
+ Pointer to packed uchar array of extents for the row.
Format is described above in the header
*/
- byte *extent;
+ uchar *extent;
/* Where data starts on page; Only for debugging */
- byte *data_start;
+ uchar *data_start;
/* Position to all tails in the row. Updated when reading a row */
MARIA_RECORD_POS *tail_positions;
/* Current page */
@@ -300,16 +300,16 @@ static my_bool delete_tails(MARIA_HA *info, MARIA_RECORD_POS *tails);
static my_bool delete_head_or_tail(MARIA_HA *info,
ulonglong page, uint record_number,
my_bool head);
-static void _ma_print_directory(byte *buff, uint block_size);
-static void compact_page(byte *buff, uint block_size, uint rownr,
+static void _ma_print_directory(uchar *buff, uint block_size);
+static void compact_page(uchar *buff, uint block_size, uint rownr,
my_bool extend_block);
static uchar *store_page_range(uchar *to, MARIA_BITMAP_BLOCK *block,
uint block_size, ulong length);
-static size_t fill_insert_undo_parts(MARIA_HA *info, const byte *record,
+static size_t fill_insert_undo_parts(MARIA_HA *info, const uchar *record,
LEX_STRING *log_parts,
uint *log_parts_count);
-static size_t fill_update_undo_parts(MARIA_HA *info, const byte *oldrec,
- const byte *newrec,
+static size_t fill_update_undo_parts(MARIA_HA *info, const uchar *oldrec,
+ const uchar *newrec,
LEX_STRING *log_parts,
uint *log_parts_count);
@@ -358,7 +358,7 @@ void _ma_init_block_record_data(void)
{
uint i;
bzero(total_header_size, sizeof(total_header_size));
- total_header_size[0]= FLAG_SIZE; /* Flag byte */
+ total_header_size[0]= FLAG_SIZE; /* Flag uchar */
for (i= 1; i < array_elements(total_header_size); i++)
{
uint size= FLAG_SIZE, j, bit;
@@ -484,10 +484,10 @@ err:
void _ma_end_block_record(MARIA_HA *info)
{
DBUG_ENTER("_ma_end_block_record");
- my_free((gptr) info->cur_row.empty_bits, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) info->cur_row.empty_bits, MYF(MY_ALLOW_ZERO_PTR));
delete_dynamic(&info->bitmap_blocks);
delete_dynamic(&info->pinned_pages);
- my_free((gptr) info->cur_row.extents, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) info->cur_row.extents, MYF(MY_ALLOW_ZERO_PTR));
/*
The data file is closed, when needed, in ma_once_end_block_record().
The following protects us from doing an extra, not allowed, close
@@ -503,7 +503,7 @@ void _ma_end_block_record(MARIA_HA *info)
****************************************************************************/
/*
- Return the next used byte on the page after a directory entry.
+ Return the next used uchar on the page after a directory entry.
SYNOPSIS
start_of_next_entry()
@@ -514,9 +514,9 @@ void _ma_end_block_record(MARIA_HA *info)
Everything between the '*dir' and this are free to be used.
*/
-static inline uint start_of_next_entry(byte *dir)
+static inline uint start_of_next_entry(uchar *dir)
{
- byte *prev;
+ uchar *prev;
/*
Find previous used entry. (There is always a previous entry as
the directory never starts with a deleted entry)
@@ -541,9 +541,9 @@ static inline uint start_of_next_entry(byte *dir)
Used mainly to detect rows with wrong extent information
*/
-static my_bool check_if_zero(byte *pos, uint length)
+static my_bool check_if_zero(uchar *pos, uint length)
{
- byte *end;
+ uchar *end;
for (end= pos+ length; pos != end ; pos++)
if (pos[0] != 0)
return 1;
@@ -636,12 +636,12 @@ void _ma_unpin_all_pages(MARIA_HA *info, LSN undo_lsn)
# Pointer to directory entry on page
*/
-static byte *find_free_position(byte *buff, uint block_size, uint *res_rownr,
+static uchar *find_free_position(uchar *buff, uint block_size, uint *res_rownr,
uint *res_length, uint *empty_space)
{
uint max_entry= (uint) ((uchar*) buff)[DIR_COUNT_OFFSET];
uint entry, length, first_pos;
- byte *dir, *end;
+ uchar *dir, *end;
DBUG_ENTER("find_free_position");
DBUG_PRINT("info", ("max_entry: %u", max_entry));
@@ -680,7 +680,7 @@ static byte *find_free_position(byte *buff, uint block_size, uint *res_rownr,
uint2korr(end + DIR_ENTRY_SIZE+ 2));
*empty_space= uint2korr(buff + EMPTY_SPACE_OFFSET);
}
- buff[DIR_COUNT_OFFSET]= (byte) (uchar) max_entry+1;
+ buff[DIR_COUNT_OFFSET]= (uchar) (uchar) max_entry+1;
length= (uint) (dir - buff - first_pos);
DBUG_ASSERT(length <= *empty_space - DIR_ENTRY_SIZE);
int2store(dir, first_pos);
@@ -713,11 +713,11 @@ static byte *find_free_position(byte *buff, uint block_size, uint *res_rownr,
extents.
*/
-static void calc_record_size(MARIA_HA *info, const byte *record,
+static void calc_record_size(MARIA_HA *info, const uchar *record,
MARIA_ROW *row)
{
MARIA_SHARE *share= info->s;
- byte *field_length_data;
+ uchar *field_length_data;
MARIA_COLUMNDEF *column, *end_column;
uint *null_field_lengths= row->null_field_lengths;
ulong *blob_lengths= row->blob_lengths;
@@ -778,7 +778,7 @@ static void calc_record_size(MARIA_HA *info, const byte *record,
{
uint length= (end - pos);
if (column->length <= 255)
- *field_length_data++= (byte) (uchar) length;
+ *field_length_data++= (uchar) length;
else
{
int2store(field_length_data, length);
@@ -792,8 +792,8 @@ static void calc_record_size(MARIA_HA *info, const byte *record,
case FIELD_VARCHAR:
{
uint length, field_length_data_length;
- const byte *field_pos= record + column->offset;
- /* 256 is correct as this includes the length byte */
+ const uchar *field_pos= record + column->offset;
+ /* 256 is correct as this includes the length uchar */
field_length_data[0]= field_pos[0];
if (column->length <= 256)
@@ -820,7 +820,7 @@ static void calc_record_size(MARIA_HA *info, const byte *record,
}
case FIELD_BLOB:
{
- const byte *field_pos= record + column->offset;
+ const uchar *field_pos= record + column->offset;
uint size_length= column->length - portable_sizeof_char_ptr;
ulong blob_length= _ma_calc_blob_length(size_length, field_pos);
@@ -872,12 +872,12 @@ static void calc_record_size(MARIA_HA *info, const byte *record,
*/
-static void compact_page(byte *buff, uint block_size, uint rownr,
+static void compact_page(uchar *buff, uint block_size, uint rownr,
my_bool extend_block)
{
uint max_entry= (uint) ((uchar *) buff)[DIR_COUNT_OFFSET];
uint page_pos, next_free_pos, start_of_found_block, diff, end_of_found_block;
- byte *dir, *end;
+ uchar *dir, *end;
DBUG_ENTER("compact_page");
DBUG_PRINT("enter", ("rownr: %u", rownr));
DBUG_ASSERT(max_entry > 0 &&
@@ -978,7 +978,7 @@ static void compact_page(byte *buff, uint block_size, uint rownr,
uint length= (uint) (dir - buff) - start_of_found_block;
int2store(dir+2, length);
}
- buff[PAGE_TYPE_OFFSET]&= ~(byte) PAGE_CAN_BE_COMPACTED;
+ buff[PAGE_TYPE_OFFSET]&= ~(uchar) PAGE_CAN_BE_COMPACTED;
}
DBUG_EXECUTE("directory", _ma_print_directory(buff, block_size););
DBUG_VOID_RETURN;
@@ -1009,9 +1009,9 @@ static void compact_page(byte *buff, uint block_size, uint rownr,
struct st_row_pos_info
{
- byte *buff; /* page buffer */
- byte *data; /* Place for data */
- byte *dir; /* Directory */
+ uchar *buff; /* page buffer */
+ uchar *data; /* Place for data */
+ uchar *dir; /* Directory */
uint length; /* Length for data */
uint rownr; /* Offset in directory */
uint empty_space; /* Space left on page */
@@ -1019,7 +1019,7 @@ struct st_row_pos_info
static my_bool get_head_or_tail_page(MARIA_HA *info,
MARIA_BITMAP_BLOCK *block,
- byte *buff, uint length, uint page_type,
+ uchar *buff, uint length, uint page_type,
enum pagecache_page_lock lock,
struct st_row_pos_info *res)
{
@@ -1043,7 +1043,7 @@ static my_bool get_head_or_tail_page(MARIA_HA *info,
*/
bzero(buff+ PAGE_HEADER_SIZE, block_size - PAGE_HEADER_SIZE);
- buff[PAGE_TYPE_OFFSET]= (byte) page_type;
+ buff[PAGE_TYPE_OFFSET]= (uchar) page_type;
buff[DIR_COUNT_OFFSET]= 1;
res->buff= buff;
res->empty_space= res->length= (block_size - PAGE_OVERHEAD_SIZE);
@@ -1056,7 +1056,7 @@ static my_bool get_head_or_tail_page(MARIA_HA *info,
}
else
{
- byte *dir;
+ uchar *dir;
/* Read old page */
DBUG_ASSERT(share->pagecache->block_size == block_size);
if (!(res->buff= pagecache_read(share->pagecache,
@@ -1120,7 +1120,7 @@ crashed:
static my_bool write_tail(MARIA_HA *info,
MARIA_BITMAP_BLOCK *block,
- byte *row_part, uint length)
+ uchar *row_part, uint length)
{
MARIA_SHARE *share= share= info->s;
MARIA_PINNED_PAGE page_link;
@@ -1237,13 +1237,13 @@ static my_bool write_tail(MARIA_HA *info,
static my_bool write_full_pages(MARIA_HA *info,
LSN lsn,
MARIA_BITMAP_BLOCK *block,
- byte *data, ulong length)
+ uchar *data, ulong length)
{
my_off_t page;
MARIA_SHARE *share= share= info->s;
uint block_size= share->block_size;
uint data_size= FULL_PAGE_SIZE(block_size);
- byte *buff= info->keyread_buff;
+ uchar *buff= info->keyread_buff;
uint page_count;
my_off_t position;
DBUG_ENTER("write_full_pages");
@@ -1277,7 +1277,7 @@ static my_bool write_full_pages(MARIA_HA *info,
info->state->data_file_length= position;
}
lsn_store(buff, lsn);
- buff[PAGE_TYPE_OFFSET]= (byte) BLOB_PAGE;
+ buff[PAGE_TYPE_OFFSET]= (uchar) BLOB_PAGE;
copy_length= min(data_size, length);
memcpy(buff + LSN_SIZE + PAGE_TYPE_SIZE, data, copy_length);
length-= copy_length;
@@ -1354,8 +1354,8 @@ static uchar *store_page_range(uchar *to, MARIA_BITMAP_BLOCK *block,
We don't have to store the position for the head block
*/
-static void store_extent_info(byte *to,
- byte *row_extents_second_part,
+static void store_extent_info(uchar *to,
+ uchar *row_extents_second_part,
MARIA_BITMAP_BLOCK *first_block,
uint count)
{
@@ -1385,7 +1385,7 @@ static void store_extent_info(byte *to,
In some unlikely cases we have allocated to many blocks. Clear this
data.
*/
- bzero(to, (my_size_t) (row_extents_second_part + copy_length - to));
+ bzero(to, (size_t) (row_extents_second_part + copy_length - to));
}
@@ -1494,16 +1494,16 @@ static my_bool free_full_page_range(MARIA_HA *info, ulonglong page, uint count)
*/
static my_bool write_block_record(MARIA_HA *info,
- const byte *old_record, const byte *record,
+ const uchar *old_record, const uchar *record,
MARIA_ROW *row,
MARIA_BITMAP_BLOCKS *bitmap_blocks,
my_bool head_block_is_read,
struct st_row_pos_info *row_pos)
{
- byte *data, *end_of_data, *tmp_data_used, *tmp_data;
- byte *row_extents_first_part, *row_extents_second_part;
- byte *field_length_data;
- byte *page_buff;
+ uchar *data, *end_of_data, *tmp_data_used, *tmp_data;
+ uchar *row_extents_first_part, *row_extents_second_part;
+ uchar *field_length_data;
+ uchar *page_buff;
MARIA_BITMAP_BLOCK *block, *head_block;
MARIA_SHARE *share= info->s;
MARIA_COLUMNDEF *column, *end_column;
@@ -1552,7 +1552,7 @@ static my_bool write_block_record(MARIA_HA *info,
if (share->base.pack_fields)
store_key_length_inc(data, row->field_lengths_length);
if (share->calc_checksum)
- *(data++)= (byte) info->cur_row.checksum;
+ *(data++)= (uchar) info->cur_row.checksum;
memcpy(data, record, share->base.null_bytes);
data+= share->base.null_bytes;
memcpy(data, row->empty_bits, share->base.pack_bytes);
@@ -1572,7 +1572,7 @@ static my_bool write_block_record(MARIA_HA *info,
row->head_length))
DBUG_RETURN(1);
- tmp_data_used= 0; /* Either 0 or last used byte in 'data' */
+ tmp_data_used= 0; /* Either 0 or last used uchar in 'data' */
tmp_data= data;
if (row_extents_in_use)
@@ -1620,7 +1620,7 @@ static my_bool write_block_record(MARIA_HA *info,
column < end_column ;
column++)
{
- const byte *field_pos;
+ const uchar *field_pos;
ulong length;
if ((record[column->null_pos] & column->null_bit) ||
(row->empty_bits[column->empty_pos] & column->empty_bit))
@@ -1647,7 +1647,7 @@ static my_bool write_block_record(MARIA_HA *info,
if (column->length <= 256)
{
length= (uint) (uchar) *field_length_data++;
- field_pos++; /* Skip length byte */
+ field_pos++; /* Skip length uchar */
}
else
{
@@ -1681,12 +1681,12 @@ static my_bool write_block_record(MARIA_HA *info,
for (; column < end_column && *blob_lengths < (ulong) (end_of_data - data);
column++, blob_lengths++)
{
- byte *tmp_pos;
+ uchar *tmp_pos;
uint length;
if (!*blob_lengths) /* Null or "" */
continue;
length= column->length - portable_sizeof_char_ptr;
- memcpy_fixed((byte*) &tmp_pos, record + column->offset + length,
+ memcpy_fixed((uchar*) &tmp_pos, record + column->offset + length,
sizeof(char*));
memcpy(data, tmp_pos, *blob_lengths);
data+= *blob_lengths;
@@ -1746,14 +1746,14 @@ static my_bool write_block_record(MARIA_HA *info,
for (; column < end_column; column++, blob_lengths++)
{
- byte *blob_pos;
+ uchar *blob_pos;
if (!*blob_lengths) /* Null or "" */
continue;
if (block[block->sub_blocks - 1].used & BLOCKUSED_TAIL)
{
uint length;
length= column->length - portable_sizeof_char_ptr;
- memcpy_fixed((byte *) &blob_pos, record + column->offset + length,
+ memcpy_fixed((uchar *) &blob_pos, record + column->offset + length,
sizeof(char*));
length= *blob_lengths % FULL_PAGE_SIZE(block_size); /* tail size */
if (length != *blob_lengths)
@@ -1912,7 +1912,7 @@ static my_bool write_block_record(MARIA_HA *info,
{
ulong data_length= (tmp_data - info->rec_buff);
uint length;
- byte *extent_data;
+ uchar *extent_data;
length= (uint) (data_length % FULL_PAGE_SIZE(block_size));
if (write_tail(info, head_tail_block,
@@ -2062,9 +2062,9 @@ static my_bool write_block_record(MARIA_HA *info,
blob_length-= (blob_length % FULL_PAGE_SIZE(block_size));
if (blob_length)
{
- memcpy_fixed((byte*) &log_array_pos->str,
+ memcpy_fixed((uchar*) &log_array_pos->str,
record + column->offset + length,
- sizeof(byte*));
+ sizeof(uchar*));
log_array_pos->length= blob_length;
log_entry_length+= blob_length;
log_array_pos++;
@@ -2087,7 +2087,7 @@ static my_bool write_block_record(MARIA_HA *info,
(uint) (log_array_pos - log_array),
log_array, log_data);
if (log_array != tmp_log_array)
- my_free((gptr) log_array, MYF(0));
+ my_free((uchar*) log_array, MYF(0));
if (error)
goto disk_err;
}
@@ -2153,13 +2153,13 @@ static my_bool write_block_record(MARIA_HA *info,
/* Write rest of blobs (data, but no tails as they are already written) */
for (; column < end_column; column++, blob_lengths++)
{
- byte *blob_pos;
+ uchar *blob_pos;
uint length;
ulong blob_length;
if (!*blob_lengths) /* Null or "" */
continue;
length= column->length - portable_sizeof_char_ptr;
- memcpy_fixed((byte*) &blob_pos, record + column->offset + length,
+ memcpy_fixed((uchar*) &blob_pos, record + column->offset + length,
sizeof(char*));
/* remove tail part */
blob_length= *blob_lengths;
@@ -2214,7 +2214,7 @@ disk_err:
*/
MARIA_RECORD_POS _ma_write_init_block_record(MARIA_HA *info,
- const byte *record)
+ const uchar *record)
{
MARIA_BITMAP_BLOCKS *blocks= &info->cur_row.insert_blocks;
struct st_row_pos_info row_pos;
@@ -2231,7 +2231,7 @@ MARIA_RECORD_POS _ma_write_init_block_record(MARIA_HA *info,
info->cur_row.lastpos= ma_recordpos(blocks->block->page, row_pos.rownr);
if (info->s->calc_checksum)
info->cur_row.checksum= (info->s->calc_checksum)(info,record);
- if (write_block_record(info, (byte*) 0, record, &info->cur_row,
+ if (write_block_record(info, (uchar*) 0, record, &info->cur_row,
blocks, blocks->block->org_bitmap_value != 0,
&row_pos))
DBUG_RETURN(HA_OFFSET_ERROR); /* Error reading bitmap */
@@ -2249,7 +2249,7 @@ MARIA_RECORD_POS _ma_write_init_block_record(MARIA_HA *info,
*/
my_bool _ma_write_block_record(MARIA_HA *info __attribute__ ((unused)),
- const byte *record __attribute__ ((unused)))
+ const uchar *record __attribute__ ((unused)))
{
return 0; /* Row already written */
}
@@ -2342,15 +2342,15 @@ my_bool _ma_write_abort_block_record(MARIA_HA *info)
*/
my_bool _ma_update_block_record(MARIA_HA *info, MARIA_RECORD_POS record_pos,
- const byte *oldrec, const byte *record)
+ const uchar *oldrec, const uchar *record)
{
MARIA_BITMAP_BLOCKS *blocks= &info->cur_row.insert_blocks;
- byte *buff;
+ uchar *buff;
MARIA_ROW *cur_row= &info->cur_row, *new_row= &info->new_row;
MARIA_PINNED_PAGE page_link;
uint rownr, org_empty_size, head_length;
uint block_size= info->s->block_size;
- byte *dir;
+ uchar *dir;
ulonglong page;
struct st_row_pos_info row_pos;
MARIA_SHARE *share= info->s;
@@ -2483,7 +2483,7 @@ static my_bool delete_head_or_tail(MARIA_HA *info,
MARIA_SHARE *share= info->s;
uint number_of_records, empty_space, length;
uint block_size= share->block_size;
- byte *buff, *dir;
+ uchar *buff, *dir;
LSN lsn;
MARIA_PINNED_PAGE page_link;
DBUG_ENTER("delete_head_or_tail");
@@ -2520,14 +2520,14 @@ static my_bool delete_head_or_tail(MARIA_HA *info,
if (record_number == number_of_records - 1)
{
/* Delete this entry and all following empty directory entries */
- byte *end= buff + block_size - PAGE_SUFFIX_SIZE;
+ uchar *end= buff + block_size - PAGE_SUFFIX_SIZE;
do
{
number_of_records--;
dir+= DIR_ENTRY_SIZE;
empty_space+= DIR_ENTRY_SIZE;
} while (dir < end && dir[0] == 0 && dir[1] == 0);
- buff[DIR_COUNT_OFFSET]= (byte) (uchar) number_of_records;
+ buff[DIR_COUNT_OFFSET]= (uchar) (uchar) number_of_records;
}
empty_space+= length;
if (number_of_records != 0)
@@ -2537,7 +2537,7 @@ static my_bool delete_head_or_tail(MARIA_HA *info,
/* Update directory */
int2store(buff + EMPTY_SPACE_OFFSET, empty_space);
- buff[PAGE_TYPE_OFFSET]|= (byte) PAGE_CAN_BE_COMPACTED;
+ buff[PAGE_TYPE_OFFSET]|= (uchar) PAGE_CAN_BE_COMPACTED;
DBUG_ASSERT(share->pagecache->block_size == block_size);
/* Log REDO data */
@@ -2630,7 +2630,7 @@ static my_bool delete_tails(MARIA_HA *info, MARIA_RECORD_POS *tails)
for rows with many splits.
*/
-my_bool _ma_delete_block_record(MARIA_HA *info, const byte *record)
+my_bool _ma_delete_block_record(MARIA_HA *info, const uchar *record)
{
ulonglong page;
uint record_number;
@@ -2705,12 +2705,12 @@ err:
In this case *end_of_data is set.
*/
-static byte *get_record_position(byte *buff, uint block_size,
- uint record_number, byte **end_of_data)
+static uchar *get_record_position(uchar *buff, uint block_size,
+ uint record_number, uchar **end_of_data)
{
uint number_of_records= (uint) ((uchar *) buff)[DIR_COUNT_OFFSET];
- byte *dir;
- byte *data;
+ uchar *dir;
+ uchar *data;
uint offset, length;
#ifdef SANITY_CHECKS
@@ -2755,7 +2755,7 @@ static byte *get_record_position(byte *buff, uint block_size,
extent is a cursor over which pages to read
*/
-static void init_extent(MARIA_EXTENT_CURSOR *extent, byte *extent_info,
+static void init_extent(MARIA_EXTENT_CURSOR *extent, uchar *extent_info,
uint extents, MARIA_RECORD_POS *tail_positions)
{
uint page_count;
@@ -2788,11 +2788,11 @@ static void init_extent(MARIA_EXTENT_CURSOR *extent, byte *extent_info,
In this case end_of_data is updated to point to end of data.
*/
-static byte *read_next_extent(MARIA_HA *info, MARIA_EXTENT_CURSOR *extent,
- byte **end_of_data)
+static uchar *read_next_extent(MARIA_HA *info, MARIA_EXTENT_CURSOR *extent,
+ uchar **end_of_data)
{
MARIA_SHARE *share= info->s;
- byte *buff, *data;
+ uchar *buff, *data;
DBUG_ENTER("read_next_extent");
if (!extent->page_count)
@@ -2879,9 +2879,9 @@ crashed:
1 error
*/
-static my_bool read_long_data(MARIA_HA *info, byte *to, ulong length,
+static my_bool read_long_data(MARIA_HA *info, uchar *to, ulong length,
MARIA_EXTENT_CURSOR *extent,
- byte **data, byte **end_of_data)
+ uchar **data, uchar **end_of_data)
{
DBUG_ENTER("read_long_data");
DBUG_PRINT("enter", ("length: %lu", length));
@@ -2946,11 +2946,11 @@ static my_bool read_long_data(MARIA_HA *info, byte *to, ulong length,
# Error code
*/
-int _ma_read_block_record2(MARIA_HA *info, byte *record,
- byte *data, byte *end_of_data)
+int _ma_read_block_record2(MARIA_HA *info, uchar *record,
+ uchar *data, uchar *end_of_data)
{
MARIA_SHARE *share= info->s;
- byte *field_length_data, *blob_buffer, *start_of_data;
+ uchar *field_length_data, *blob_buffer, *start_of_data;
uint flag, null_bytes, cur_null_bytes, row_extents, field_lengths;
my_bool found_blob= 0;
MARIA_EXTENT_CURSOR extent;
@@ -3075,7 +3075,7 @@ int _ma_read_block_record2(MARIA_HA *info, byte *record,
column < end_column; column++)
{
enum en_fieldtype type= (enum en_fieldtype) column->type;
- byte *field_pos= record + column->offset;
+ uchar *field_pos= record + column->offset;
/* First check if field is present in record */
if ((record[column->null_pos] & column->null_bit) ||
(info->cur_row.empty_bits[column->empty_pos] & column->empty_bit))
@@ -3146,7 +3146,7 @@ int _ma_read_block_record2(MARIA_HA *info, byte *record,
{
/* Calculate total length for all blobs */
ulong blob_lengths= 0;
- byte *length_data= field_length_data;
+ uchar *length_data= field_length_data;
MARIA_COLUMNDEF *blob_field= column;
found_blob= 1;
@@ -3169,7 +3169,7 @@ int _ma_read_block_record2(MARIA_HA *info, byte *record,
}
memcpy(field_pos, field_length_data, size_length);
- memcpy_fixed(field_pos + size_length, (byte *) & blob_buffer,
+ memcpy_fixed(field_pos + size_length, (uchar *) & blob_buffer,
sizeof(char*));
field_length_data+= size_length;
@@ -3239,10 +3239,10 @@ err:
record_pos Record position
*/
-int _ma_read_block_record(MARIA_HA *info, byte *record,
+int _ma_read_block_record(MARIA_HA *info, uchar *record,
MARIA_RECORD_POS record_pos)
{
- byte *data, *end_of_data, *buff;
+ uchar *data, *end_of_data, *buff;
uint offset;
uint block_size= info->s->block_size;
DBUG_ENTER("_ma_read_block_record");
@@ -3271,10 +3271,10 @@ int _ma_read_block_record(MARIA_HA *info, byte *record,
/* compare unique constraint between stored rows */
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)
{
- byte *org_rec_buff, *old_record;
- my_size_t org_rec_buff_size;
+ uchar *org_rec_buff, *old_record;
+ size_t org_rec_buff_size;
int error;
DBUG_ENTER("_ma_cmp_block_unique");
@@ -3333,7 +3333,7 @@ my_bool _ma_scan_init_block_record(MARIA_HA *info)
*/
if (!(info->scan.bitmap_buff ||
((info->scan.bitmap_buff=
- (byte *) my_malloc(info->s->block_size * 2, MYF(MY_WME))))))
+ (uchar *) my_malloc(info->s->block_size * 2, MYF(MY_WME))))))
DBUG_RETURN(1);
info->scan.page_buff= info->scan.bitmap_buff + info->s->block_size;
info->scan.bitmap_end= info->scan.bitmap_buff + info->s->bitmap.total_size;
@@ -3387,7 +3387,7 @@ void _ma_scan_end_block_record(MARIA_HA *info)
# Error code
*/
-int _ma_scan_block_record(MARIA_HA *info, byte *record,
+int _ma_scan_block_record(MARIA_HA *info, uchar *record,
MARIA_RECORD_POS record_pos,
my_bool skip_deleted __attribute__ ((unused)))
{
@@ -3401,7 +3401,7 @@ restart_record_read:
if (likely(record_pos < info->scan.number_of_rows))
{
uint length, offset;
- byte *data, *end_of_data;
+ uchar *data, *end_of_data;
while (!(offset= uint2korr(info->scan.dir)))
{
@@ -3433,7 +3433,7 @@ restart_bitmap_scan:
block_size= share->block_size;
if (likely(info->scan.bitmap_pos < info->scan.bitmap_end))
{
- byte *data= info->scan.bitmap_pos;
+ uchar *data= info->scan.bitmap_pos;
longlong bits= info->scan.bits;
uint bit_pos= info->scan.bit_pos;
@@ -3520,7 +3520,7 @@ err:
*/
my_bool _ma_compare_block_record(MARIA_HA *info __attribute__ ((unused)),
- const byte *record __attribute__ ((unused)))
+ const uchar *record __attribute__ ((unused)))
{
return 0;
}
@@ -3528,11 +3528,11 @@ my_bool _ma_compare_block_record(MARIA_HA *info __attribute__ ((unused)),
#ifndef DBUG_OFF
-static void _ma_print_directory(byte *buff, uint block_size)
+static void _ma_print_directory(uchar *buff, uint block_size)
{
uint max_entry= (uint) ((uchar *) buff)[DIR_COUNT_OFFSET], row= 0;
uint end_of_prev_row= PAGE_HEADER_SIZE;
- byte *dir, *end;
+ uchar *dir, *end;
dir= buff + block_size - DIR_ENTRY_SIZE * max_entry - PAGE_SUFFIX_SIZE;
end= buff + block_size - DIR_ENTRY_SIZE - PAGE_SUFFIX_SIZE;
@@ -3649,7 +3649,7 @@ uint ma_calc_length_for_store_length(ulong nr)
log_parts_count contains number of used log_parts
*/
-static size_t fill_insert_undo_parts(MARIA_HA *info, const byte *record,
+static size_t fill_insert_undo_parts(MARIA_HA *info, const uchar *record,
LEX_STRING *log_parts,
uint *log_parts_count)
{
@@ -3755,7 +3755,7 @@ static size_t fill_insert_undo_parts(MARIA_HA *info, const byte *record,
/* Add blobs */
for (end_column+= share->base.blobs; column < end_column; column++)
{
- const byte *field_pos= record + column->offset;
+ const uchar *field_pos= record + column->offset;
uint size_length= column->length - portable_sizeof_char_ptr;
ulong blob_length= _ma_calc_blob_length(size_length, field_pos);
@@ -3766,7 +3766,7 @@ static size_t fill_insert_undo_parts(MARIA_HA *info, const byte *record,
if (blob_length)
{
char *blob_pos;
- memcpy_fixed((byte*) &blob_pos, record + column->offset + size_length,
+ memcpy_fixed((uchar*) &blob_pos, record + column->offset + size_length,
sizeof(blob_pos));
log_parts->str= blob_pos;
log_parts->length= blob_length;
@@ -3818,8 +3818,8 @@ static size_t fill_insert_undo_parts(MARIA_HA *info, const byte *record,
log_parts_count contains number of used log_parts
*/
-static size_t fill_update_undo_parts(MARIA_HA *info, const byte *oldrec,
- const byte *newrec,
+static size_t fill_update_undo_parts(MARIA_HA *info, const uchar *oldrec,
+ const uchar *newrec,
LEX_STRING *log_parts,
uint *log_parts_count)
{
@@ -3950,13 +3950,13 @@ static size_t fill_update_undo_parts(MARIA_HA *info, const byte *oldrec,
{
uint size_length= column->length - portable_sizeof_char_ptr;
old_column_length= _ma_calc_blob_length(size_length, old_column_pos);
- memcpy_fixed((byte*) &old_column_pos,
+ memcpy_fixed((uchar*) &old_column_pos,
oldrec + column->offset + size_length,
sizeof(old_column_pos));
if (!new_column_is_empty)
{
new_column_length= _ma_calc_blob_length(size_length, new_column_pos);
- memcpy_fixed((byte*) &new_column_pos,
+ memcpy_fixed((uchar*) &new_column_pos,
newrec + column->offset + size_length,
sizeof(old_column_pos));
}
diff --git a/storage/maria/ma_blockrec.h b/storage/maria/ma_blockrec.h
index 819d1c2e4d2..e9364f71069 100644
--- a/storage/maria/ma_blockrec.h
+++ b/storage/maria/ma_blockrec.h
@@ -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);
diff --git a/storage/maria/ma_cache.c b/storage/maria/ma_cache.c
index e8a4b20571b..44aa7a15058 100644
--- a/storage/maria/ma_cache.c
+++ b/storage/maria/ma_cache.c
@@ -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);
diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c
index 0fc2b77304d..98c686d724b 100644
--- a/storage/maria/ma_check.c
+++ b/storage/maria/ma_check.c
@@ -20,7 +20,7 @@
There are two types of checksums. Table checksum and row checksum.
- Row checksum is an additional byte at the end of dynamic length
+ Row checksum is an additional uchar at the end of dynamic length
records. It must be calculated if the table is configured for them.
Otherwise they must not be used. The variable
MYISAM_SHARE::calc_checksum determines if row checksums are used.
@@ -31,7 +31,7 @@
wrong. But since all threads read through a common read buffer, it is
sufficient if only one thread checks it.
- Table checksum is an eight byte value in the header of the index file.
+ Table checksum is an eight uchar value in the header of the index file.
It can be calculated even if row checksums are not used. The variable
MI_CHECK::glob_crc is calculated over all records.
MI_SORT_PARAM::calc_checksum determines if this should be done. This
@@ -59,7 +59,7 @@
static int check_k_link(HA_CHECK *param, MARIA_HA *info, my_off_t next_link);
static int chk_index(HA_CHECK *param, MARIA_HA *info,MARIA_KEYDEF *keyinfo,
- my_off_t page, byte *buff, ha_rows *keys,
+ my_off_t page, uchar *buff, ha_rows *keys,
ha_checksum *key_checksum, uint level);
static uint isam_key_length(MARIA_HA *info,MARIA_KEYDEF *keyinfo);
static ha_checksum calc_checksum(ha_rows count);
@@ -67,30 +67,30 @@ static int writekeys(MARIA_SORT_PARAM *sort_param);
static int sort_one_index(HA_CHECK *param, MARIA_HA *info,
MARIA_KEYDEF *keyinfo,
my_off_t pagepos, File new_file);
-static int sort_key_read(MARIA_SORT_PARAM *sort_param, byte *key);
-static int sort_maria_ft_key_read(MARIA_SORT_PARAM *sort_param, byte *key);
+static int sort_key_read(MARIA_SORT_PARAM *sort_param, uchar *key);
+static int sort_maria_ft_key_read(MARIA_SORT_PARAM *sort_param, uchar *key);
static int sort_get_next_record(MARIA_SORT_PARAM *sort_param);
static int sort_key_cmp(MARIA_SORT_PARAM *sort_param, const void *a,
const void *b);
static int sort_maria_ft_key_write(MARIA_SORT_PARAM *sort_param,
- const byte *a);
-static int sort_key_write(MARIA_SORT_PARAM *sort_param, const byte *a);
+ const uchar *a);
+static int sort_key_write(MARIA_SORT_PARAM *sort_param, const uchar *a);
static my_off_t get_record_for_key(MARIA_HA *info,MARIA_KEYDEF *keyinfo,
- const byte *key);
+ const uchar *key);
static int sort_insert_key(MARIA_SORT_PARAM *sort_param,
reg1 SORT_KEY_BLOCKS *key_block,
- const byte *key, my_off_t prev_block);
+ const uchar *key, my_off_t prev_block);
static int sort_delete_record(MARIA_SORT_PARAM *sort_param);
/*static int _ma_flush_pending_blocks(HA_CHECK *param);*/
static SORT_KEY_BLOCKS *alloc_key_blocks(HA_CHECK *param, uint blocks,
uint buffer_length);
-static ha_checksum maria_byte_checksum(const byte *buf, uint length);
+static ha_checksum maria_byte_checksum(const uchar *buf, uint length);
static void set_data_file_type(MARIA_SORT_INFO *sort_info, MARIA_SHARE *share);
static void restore_data_file_type(MARIA_SHARE *share);
void maria_chk_init(HA_CHECK *param)
{
- bzero((gptr) param,sizeof(*param));
+ bzero((uchar*) param,sizeof(*param));
param->opt_follow_links=1;
param->keys_in_use= ~(ulonglong) 0;
param->search_after_block=HA_OFFSET_ERROR;
@@ -297,7 +297,7 @@ static int check_k_link(HA_CHECK *param, register MARIA_HA *info,
if (!(buff= pagecache_read(info->s->pagecache,
&info->s->kfile, next_link/block_size,
DFLT_INIT_HITS,
- (byte*) info->buff,
+ (uchar*) info->buff,
PAGECACHE_PLAIN_PAGE,
PAGECACHE_LOCK_LEFT_UNLOCKED, 0)))
{
@@ -532,7 +532,7 @@ int maria_chk_key(HA_CHECK *param, register MARIA_HA *info)
/* Check that there isn't a row with auto_increment = 0 in the table */
maria_extra(info,HA_EXTRA_KEYREAD,0);
bzero(info->lastkey,keyinfo->seg->length);
- if (!maria_rkey(info, info->rec_buff, key, (const byte*) info->lastkey,
+ if (!maria_rkey(info, info->rec_buff, key, (const uchar*) info->lastkey,
keyinfo->seg->length, HA_READ_KEY_EXACT))
{
/* Don't count this as a real warning, as maria_chk can't correct it */
@@ -586,7 +586,7 @@ do_stat:
static int chk_index_down(HA_CHECK *param, MARIA_HA *info,
MARIA_KEYDEF *keyinfo,
- my_off_t page, byte *buff, ha_rows *keys,
+ my_off_t page, uchar *buff, ha_rows *keys,
ha_checksum *key_checksum, uint level)
{
char llbuff[22],llbuff2[22];
@@ -657,7 +657,7 @@ err:
static
void maria_collect_stats_nonulls_first(HA_KEYSEG *keyseg, ulonglong *notnull,
- const byte *key)
+ const uchar *key)
{
uint first_null, kp;
first_null= ha_find_null(keyseg, (uchar*) key) - keyseg;
@@ -697,8 +697,8 @@ void maria_collect_stats_nonulls_first(HA_KEYSEG *keyseg, ulonglong *notnull,
static
int maria_collect_stats_nonulls_next(HA_KEYSEG *keyseg, ulonglong *notnull,
- const byte *prev_key,
- const byte *last_key)
+ const uchar *prev_key,
+ const uchar *last_key)
{
uint diffs[2];
uint first_null_seg, kp;
@@ -733,23 +733,23 @@ int maria_collect_stats_nonulls_next(HA_KEYSEG *keyseg, ulonglong *notnull,
/* Check if index is ok */
static int chk_index(HA_CHECK *param, MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- my_off_t page, byte *buff, ha_rows *keys,
+ my_off_t page, uchar *buff, ha_rows *keys,
ha_checksum *key_checksum, uint level)
{
int flag;
uint used_length,comp_flag,nod_flag,key_length=0;
- byte key[HA_MAX_POSSIBLE_KEY_BUFF],*temp_buff,*keypos,*old_keypos,*endpos;
+ uchar key[HA_MAX_POSSIBLE_KEY_BUFF],*temp_buff,*keypos,*old_keypos,*endpos;
my_off_t next_page,record;
char llbuff[22];
uint diff_pos[2];
DBUG_ENTER("chk_index");
- DBUG_DUMP("buff",(byte*) buff,maria_data_on_page(buff));
+ DBUG_DUMP("buff",(uchar*) buff,maria_data_on_page(buff));
/* TODO: implement appropriate check for RTree keys */
if (keyinfo->flag & HA_SPATIAL)
DBUG_RETURN(0);
- if (!(temp_buff=(byte*) my_alloca((uint) keyinfo->block_length)))
+ if (!(temp_buff=(uchar*) my_alloca((uint) keyinfo->block_length)))
{
_ma_check_print_error(param,"Not enough memory for keyblock");
DBUG_RETURN(-1);
@@ -837,7 +837,7 @@ static int chk_index(HA_CHECK *param, MARIA_HA *info, MARIA_KEYDEF *keyinfo,
key);
}
}
- (*key_checksum)+= maria_byte_checksum((byte*) key,
+ (*key_checksum)+= maria_byte_checksum((uchar*) key,
key_length- info->s->rec_reflength);
record= _ma_dpos(info,0,key+key_length);
if (keyinfo->flag & HA_FULLTEXT) /* special handling for ft2 */
@@ -875,7 +875,7 @@ static int chk_index(HA_CHECK *param, MARIA_HA *info, MARIA_KEYDEF *keyinfo,
DBUG_PRINT("test",("page: %s record: %s filelength: %s",
llstr(page,llbuff),llstr(record,llbuff2),
llstr(info->state->data_file_length,llbuff3)));
- DBUG_DUMP("key",(byte*) key,key_length);
+ DBUG_DUMP("key",(uchar*) key,key_length);
DBUG_DUMP("new_in_page",(char*) old_keypos,(uint) (keypos-old_keypos));
goto err;
}
@@ -887,10 +887,10 @@ static int chk_index(HA_CHECK *param, MARIA_HA *info, MARIA_KEYDEF *keyinfo,
llstr(page,llbuff), used_length, (keypos - buff));
goto err;
}
- my_afree((byte*) temp_buff);
+ my_afree((uchar*) temp_buff);
DBUG_RETURN(0);
err:
- my_afree((byte*) temp_buff);
+ my_afree((uchar*) temp_buff);
DBUG_RETURN(1);
} /* chk_index */
@@ -969,7 +969,7 @@ static void record_pos_to_txt(MARIA_HA *info, my_off_t recpos,
*/
static int check_keys_in_record(HA_CHECK *param, MARIA_HA *info, int extend,
- my_off_t start_recpos, byte *record)
+ my_off_t start_recpos, uchar *record)
{
MARIA_KEYDEF *keyinfo;
char llbuff[22+4];
@@ -1019,7 +1019,7 @@ static int check_keys_in_record(HA_CHECK *param, MARIA_HA *info, int extend,
}
else
param->tmp_key_crc[key]+=
- maria_byte_checksum((byte*) info->lastkey, key_length);
+ maria_byte_checksum((uchar*) info->lastkey, key_length);
}
}
}
@@ -1040,7 +1040,7 @@ static int check_keys_in_record(HA_CHECK *param, MARIA_HA *info, int extend,
*/
static int check_static_record(HA_CHECK *param, MARIA_HA *info, int extend,
- byte *record)
+ uchar *record)
{
my_off_t start_recpos, pos;
char llbuff[22];
@@ -1050,7 +1050,7 @@ static int check_static_record(HA_CHECK *param, MARIA_HA *info, int extend,
{
if (*_ma_killed_ptr(param))
return -1;
- if (my_b_read(&param->read_cache,(byte*) record,
+ if (my_b_read(&param->read_cache,(uchar*) record,
info->s->base.pack_reclength))
{
_ma_check_print_error(param,
@@ -1077,11 +1077,11 @@ static int check_static_record(HA_CHECK *param, MARIA_HA *info, int extend,
static int check_dynamic_record(HA_CHECK *param, MARIA_HA *info, int extend,
- byte *record)
+ uchar *record)
{
MARIA_BLOCK_INFO block_info;
my_off_t start_recpos, start_block, pos;
- byte *to;
+ uchar *to;
ulong left_length;
uint b_type;
char llbuff[22],llbuff2[22],llbuff3[22];
@@ -1103,7 +1103,7 @@ static int check_dynamic_record(HA_CHECK *param, MARIA_HA *info, int extend,
block_info.next_filepos=pos;
do
{
- if (_ma_read_cache(&param->read_cache,(byte*) block_info.header,
+ if (_ma_read_cache(&param->read_cache,(uchar*) block_info.header,
(start_block=block_info.next_filepos),
sizeof(block_info.header),
(flag ? 0 : READING_NEXT) | READING_HEADER))
@@ -1215,7 +1215,7 @@ static int check_dynamic_record(HA_CHECK *param, MARIA_HA *info, int extend,
got_error=1;
break;
}
- if (_ma_read_cache(&param->read_cache,(byte*) to,block_info.filepos,
+ if (_ma_read_cache(&param->read_cache,(uchar*) to,block_info.filepos,
(uint) block_info.data_len,
flag == 1 ? READING_NEXT : 0))
{
@@ -1297,7 +1297,7 @@ next:;
static int check_compressed_record(HA_CHECK *param, MARIA_HA *info, int extend,
- byte *record)
+ uchar *record)
{
my_off_t start_recpos, pos;
char llbuff[22];
@@ -1311,7 +1311,7 @@ static int check_compressed_record(HA_CHECK *param, MARIA_HA *info, int extend,
if (*_ma_killed_ptr(param))
DBUG_RETURN(-1);
- if (_ma_read_cache(&param->read_cache,(byte*) block_info.header, pos,
+ if (_ma_read_cache(&param->read_cache,(uchar*) block_info.header, pos,
info->s->pack.ref_length, READING_NEXT))
{
_ma_check_print_error(param,
@@ -1335,7 +1335,7 @@ static int check_compressed_record(HA_CHECK *param, MARIA_HA *info, int extend,
got_error=1;
goto end;
}
- if (_ma_read_cache(&param->read_cache,(byte*) info->rec_buff,
+ if (_ma_read_cache(&param->read_cache,(uchar*) info->rec_buff,
block_info.filepos, block_info.rec_len, READING_NEXT))
{
_ma_check_print_error(param,
@@ -1380,12 +1380,12 @@ end:
*/
static int check_page_layout(HA_CHECK *param, MARIA_HA *info,
- my_off_t page_pos, byte *page,
+ my_off_t page_pos, uchar *page,
uint row_count, uint head_empty,
uint *real_rows_found)
{
uint empty, last_row_end, row, first_dir_entry;
- byte *dir_entry;
+ uchar *dir_entry;
char llbuff[22];
DBUG_ENTER("check_page_layout");
@@ -1460,11 +1460,11 @@ static int check_page_layout(HA_CHECK *param, MARIA_HA *info,
*/
-static my_bool check_head_page(HA_CHECK *param, MARIA_HA *info, byte *record,
- int extend, my_off_t page_pos, byte *page_buff,
+static my_bool check_head_page(HA_CHECK *param, MARIA_HA *info, uchar *record,
+ int extend, my_off_t page_pos, uchar *page_buff,
uint row_count)
{
- byte *dir_entry;
+ uchar *dir_entry;
uint row;
char llbuff[22], llbuff2[22];
DBUG_ENTER("check_head_page");
@@ -1512,7 +1512,7 @@ static my_bool check_head_page(HA_CHECK *param, MARIA_HA *info, byte *record,
}
if (info->cur_row.extents_count)
{
- byte *extents= info->cur_row.extents;
+ uchar *extents= info->cur_row.extents;
uint i;
/* Check that bitmap has the right marker for the found extents */
for (i= 0 ; i < info->cur_row.extents_count ; i++)
@@ -1562,10 +1562,10 @@ static my_bool check_head_page(HA_CHECK *param, MARIA_HA *info, byte *record,
*/
static int check_block_record(HA_CHECK *param, MARIA_HA *info, int extend,
- byte *record)
+ uchar *record)
{
my_off_t pos;
- byte *page_buff, *bitmap_buff, *data;
+ uchar *page_buff, *bitmap_buff, *data;
char llbuff[22], llbuff2[22];
uint block_size= info->s->block_size;
ha_rows full_page_count, tail_count;
@@ -1737,7 +1737,7 @@ err:
int maria_chk_data_link(HA_CHECK *param, MARIA_HA *info,int extend)
{
int error;
- byte *record;
+ uchar *record;
char llbuff[22],llbuff2[22],llbuff3[22];
DBUG_ENTER("maria_chk_data_link");
@@ -1749,7 +1749,7 @@ int maria_chk_data_link(HA_CHECK *param, MARIA_HA *info,int extend)
puts("- check record links");
}
- if (!(record= (byte*) my_malloc(info->s->base.pack_reclength,MYF(0))))
+ if (!(record= (uchar*) my_malloc(info->s->base.pack_reclength,MYF(0))))
{
_ma_check_print_error(param,"Not enough memory for record");
DBUG_RETURN(-1);
@@ -1898,11 +1898,11 @@ int maria_chk_data_link(HA_CHECK *param, MARIA_HA *info,int extend)
printf("Lost space: %12s Linkdata: %10s\n",
llstr(param->empty, llbuff),llstr(param->link_used, llbuff2));
}
- my_free((gptr) record,MYF(0));
+ my_free((uchar*) record,MYF(0));
DBUG_RETURN (error);
err:
- my_free((gptr) record,MYF(0));
+ my_free((uchar*) record,MYF(0));
param->testflag|=T_RETRY_WITHOUT_QUICK;
DBUG_RETURN(1);
} /* maria_chk_data_link */
@@ -1912,7 +1912,7 @@ int maria_chk_data_link(HA_CHECK *param, MARIA_HA *info,int extend)
/* Save new datafile-name in temp_filename */
int maria_repair(HA_CHECK *param, register MARIA_HA *info,
- my_string name, int rep_quick)
+ char *name, int rep_quick)
{
int error,got_error;
uint i;
@@ -1957,7 +1957,7 @@ int maria_repair(HA_CHECK *param, register MARIA_HA *info,
MYF(MY_WME | MY_WAIT_IF_FULL)))
goto err;
info->opt_flag|=WRITE_CACHE_USED;
- if (!(sort_param.record=(byte*) my_malloc((uint) share->base.pack_reclength,
+ if (!(sort_param.record=(uchar*) my_malloc((uint) share->base.pack_reclength,
MYF(0))) ||
_ma_alloc_buffer(&sort_param.rec_buff, &sort_param.rec_buff_size,
info->s->base.default_rec_buff_size))
@@ -2038,7 +2038,7 @@ int maria_repair(HA_CHECK *param, register MARIA_HA *info,
{
if (my_errno != HA_ERR_FOUND_DUPP_KEY)
goto err;
- DBUG_DUMP("record",(byte*) sort_param.record,share->base.pack_reclength);
+ DBUG_DUMP("record",(uchar*) sort_param.record,share->base.pack_reclength);
_ma_check_print_info(param,"Duplicate key %2d for record at %10s against new record at %10s",
info->errkey+1,
llstr(sort_param.start_recpos,llbuff),
@@ -2180,9 +2180,9 @@ err:
static int writekeys(MARIA_SORT_PARAM *sort_param)
{
register uint i;
- byte *key;
+ uchar *key;
MARIA_HA *info= sort_param->sort_info->info;
- byte *buff= sort_param->record;
+ uchar *buff= sort_param->record;
my_off_t filepos= sort_param->filepos;
DBUG_ENTER("writekeys");
@@ -2246,12 +2246,12 @@ static int writekeys(MARIA_SORT_PARAM *sort_param)
/* Change all key-pointers that points to a records */
-int maria_movepoint(register MARIA_HA *info, byte *record,
+int maria_movepoint(register MARIA_HA *info, uchar *record,
MARIA_RECORD_POS oldpos, MARIA_RECORD_POS newpos,
uint prot_key)
{
register uint i;
- byte *key;
+ uchar *key;
uint key_length;
DBUG_ENTER("maria_movepoint");
@@ -2323,7 +2323,7 @@ int _ma_flush_blocks(HA_CHECK *param, PAGECACHE *pagecache,
/* Sort index for more efficent reads */
-int maria_sort_index(HA_CHECK *param, register MARIA_HA *info, my_string name)
+int maria_sort_index(HA_CHECK *param, register MARIA_HA *info, char *name)
{
reg2 uint key;
reg1 MARIA_KEYDEF *keyinfo;
@@ -2430,8 +2430,8 @@ static int sort_one_index(HA_CHECK *param, MARIA_HA *info,
my_off_t pagepos, File new_file)
{
uint length,nod_flag,used_length, key_length;
- byte *buff,*keypos,*endpos;
- byte key[HA_MAX_POSSIBLE_KEY_BUFF];
+ uchar *buff,*keypos,*endpos;
+ uchar key[HA_MAX_POSSIBLE_KEY_BUFF];
my_off_t new_page_pos,next_page;
char llbuff[22];
DBUG_ENTER("sort_one_index");
@@ -2441,7 +2441,7 @@ static int sort_one_index(HA_CHECK *param, MARIA_HA *info,
new_page_pos=param->new_file_pos;
param->new_file_pos+=keyinfo->block_length;
- if (!(buff= (byte*) my_alloca((uint) keyinfo->block_length)))
+ if (!(buff= (uchar*) my_alloca((uint) keyinfo->block_length)))
{
_ma_check_print_error(param,"Not enough memory for key block");
DBUG_RETURN(-1);
@@ -2470,7 +2470,7 @@ static int sort_one_index(HA_CHECK *param, MARIA_HA *info,
("From page: %ld, keyoffset: %lu used_length: %d",
(ulong) pagepos, (ulong) (keypos - buff),
(int) used_length));
- DBUG_DUMP("buff",(byte*) buff,used_length);
+ DBUG_DUMP("buff",(uchar*) buff,used_length);
goto err;
}
}
@@ -2499,17 +2499,17 @@ static int sort_one_index(HA_CHECK *param, MARIA_HA *info,
/* Fill block with zero and write it to the new index file */
length= maria_data_on_page(buff);
- bzero((byte*) buff+length,keyinfo->block_length-length);
- if (my_pwrite(new_file,(byte*) buff,(uint) keyinfo->block_length,
+ bzero((uchar*) buff+length,keyinfo->block_length-length);
+ if (my_pwrite(new_file,(uchar*) buff,(uint) keyinfo->block_length,
new_page_pos,MYF(MY_NABP | MY_WAIT_IF_FULL)))
{
_ma_check_print_error(param,"Can't write indexblock, error: %d",my_errno);
goto err;
}
- my_afree((gptr) buff);
+ my_afree((uchar*) buff);
DBUG_RETURN(0);
err:
- my_afree((gptr) buff);
+ my_afree((uchar*) buff);
DBUG_RETURN(1);
} /* sort_one_index */
@@ -2560,13 +2560,13 @@ int maria_filecopy(HA_CHECK *param, File to,File from,my_off_t start,
VOID(my_seek(from,start,MY_SEEK_SET,MYF(0)));
while (length > buff_length)
{
- if (my_read(from,(byte*) buff,buff_length,MYF(MY_NABP)) ||
- my_write(to,(byte*) buff,buff_length,param->myf_rw))
+ if (my_read(from,(uchar*) buff,buff_length,MYF(MY_NABP)) ||
+ my_write(to,(uchar*) buff,buff_length,param->myf_rw))
goto err;
length-= buff_length;
}
- if (my_read(from,(byte*) buff,(uint) length,MYF(MY_NABP)) ||
- my_write(to,(byte*) buff,(uint) length,param->myf_rw))
+ if (my_read(from,(uchar*) buff,(uint) length,MYF(MY_NABP)) ||
+ my_write(to,(uchar*) buff,(uint) length,param->myf_rw))
goto err;
if (buff != tmp_buff)
my_free(buff,MYF(0));
@@ -2649,7 +2649,7 @@ int maria_repair_by_sort(HA_CHECK *param, register MARIA_HA *info,
info->opt_flag|=WRITE_CACHE_USED;
info->rec_cache.file= info->dfile.file; /* for sort_delete_record */
- if (!(sort_param.record=(byte*) my_malloc((uint) share->base.pack_reclength,
+ if (!(sort_param.record=(uchar*) my_malloc((uint) share->base.pack_reclength,
MYF(0))) ||
_ma_alloc_buffer(&sort_param.rec_buff, &sort_param.rec_buff_size,
info->s->base.default_rec_buff_size))
@@ -2958,8 +2958,8 @@ err:
my_free(sort_param.rec_buff, MYF(MY_ALLOW_ZERO_PTR));
my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR));
- my_free((gptr) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR));
- my_free((gptr) sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR));
my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
VOID(end_io_cache(&param->read_cache));
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
@@ -3485,9 +3485,9 @@ err:
pthread_cond_destroy (&sort_info.cond);
pthread_mutex_destroy(&sort_info.mutex);
- my_free((gptr) sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR));
- my_free((gptr) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR));
- my_free((gptr) sort_param,MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) sort_param,MYF(MY_ALLOW_ZERO_PTR));
my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
VOID(end_io_cache(&param->read_cache));
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
@@ -3499,7 +3499,7 @@ err:
/* Read next record and return next key */
-static int sort_key_read(MARIA_SORT_PARAM *sort_param, byte *key)
+static int sort_key_read(MARIA_SORT_PARAM *sort_param, uchar *key)
{
int error;
MARIA_SORT_INFO *sort_info= sort_param->sort_info;
@@ -3527,7 +3527,7 @@ static int sort_key_read(MARIA_SORT_PARAM *sort_param, byte *key)
} /* sort_key_read */
-static int sort_maria_ft_key_read(MARIA_SORT_PARAM *sort_param, byte *key)
+static int sort_maria_ft_key_read(MARIA_SORT_PARAM *sort_param, uchar *key)
{
int error;
MARIA_SORT_INFO *sort_info=sort_param->sort_info;
@@ -3667,7 +3667,7 @@ static int sort_get_next_record(MARIA_SORT_PARAM *sort_param)
}
case DYNAMIC_RECORD:
{
- byte *to;
+ uchar *to;
LINT_INIT(to);
pos=sort_param->pos;
searching=(sort_param->fix_datafile && (param->testflag & T_EXTEND));
@@ -3699,7 +3699,7 @@ static int sort_get_next_record(MARIA_SORT_PARAM *sort_param)
llstr(param->search_after_block,llbuff),
llstr(sort_param->start_recpos,llbuff2));
if (_ma_read_cache(&sort_param->read_cache,
- (byte*) block_info.header,pos,
+ (uchar*) block_info.header,pos,
MARIA_BLOCK_INFO_HEADER_LENGTH,
(! found_record ? READING_NEXT : 0) |
parallel_flag | READING_HEADER))
@@ -3968,7 +3968,7 @@ static int sort_get_next_record(MARIA_SORT_PARAM *sort_param)
case COMPRESSED_RECORD:
for (searching=0 ;; searching=1, sort_param->pos++)
{
- if (_ma_read_cache(&sort_param->read_cache,(byte*) block_info.header,
+ if (_ma_read_cache(&sort_param->read_cache,(uchar*) block_info.header,
sort_param->pos,
share->pack.ref_length,READING_NEXT))
DBUG_RETURN(-1);
@@ -3998,7 +3998,7 @@ static int sort_get_next_record(MARIA_SORT_PARAM *sort_param)
llstr(sort_param->pos,llbuff));
continue;
}
- if (_ma_read_cache(&sort_param->read_cache,(byte*) sort_param->rec_buff,
+ if (_ma_read_cache(&sort_param->read_cache,(uchar*) sort_param->rec_buff,
block_info.filepos, block_info.rec_len,
READING_NEXT))
{
@@ -4058,8 +4058,8 @@ int _ma_sort_write_record(MARIA_SORT_PARAM *sort_param)
int flag;
uint length;
ulong block_length,reclength;
- byte *from;
- byte block_buff[8];
+ uchar *from;
+ uchar block_buff[8];
MARIA_SORT_INFO *sort_info=sort_param->sort_info;
HA_CHECK *param=sort_info->param;
MARIA_HA *info=sort_info->info;
@@ -4135,7 +4135,7 @@ int _ma_sort_write_record(MARIA_SORT_PARAM *sort_param)
length+= _ma_save_pack_length((uint) share->pack.version,
block_buff + length, info->blob_length);
if (my_b_write(&info->rec_cache,block_buff,length) ||
- my_b_write(&info->rec_cache,(byte*) sort_param->rec_buff,reclength))
+ my_b_write(&info->rec_cache,(uchar*) sort_param->rec_buff,reclength))
{
_ma_check_print_error(param,"%d when writing to datafile",my_errno);
DBUG_RETURN(1);
@@ -4171,7 +4171,7 @@ static int sort_key_cmp(MARIA_SORT_PARAM *sort_param, const void *a,
} /* sort_key_cmp */
-static int sort_key_write(MARIA_SORT_PARAM *sort_param, const byte *a)
+static int sort_key_write(MARIA_SORT_PARAM *sort_param, const uchar *a)
{
uint diff_pos[2];
char llbuff[22],llbuff2[22];
@@ -4244,7 +4244,7 @@ int _ma_sort_ft_buf_flush(MARIA_SORT_PARAM *sort_param)
uint val_off, val_len;
int error;
SORT_FT_BUF *maria_ft_buf=sort_info->ft_buf;
- byte *from, *to;
+ uchar *from, *to;
val_len=share->ft2_keyinfo.keylength;
get_key_full_length_rdonly(val_off, maria_ft_buf->lastkey);
@@ -4283,7 +4283,7 @@ int _ma_sort_ft_buf_flush(MARIA_SORT_PARAM *sort_param)
static int sort_maria_ft_key_write(MARIA_SORT_PARAM *sort_param,
- const byte *a)
+ const uchar *a)
{
uint a_len, val_off, val_len, error;
MARIA_SORT_INFO *sort_info= sort_param->sort_info;
@@ -4320,7 +4320,7 @@ static int sort_maria_ft_key_write(MARIA_SORT_PARAM *sort_param,
((uchar *)a)+1,a_len-1,
(uchar*) ft_buf->lastkey+1,val_off-1, 0, 0)==0)
{
- byte *p;
+ uchar *p;
if (!ft_buf->buf) /* store in second-level tree */
{
ft_buf->count++;
@@ -4374,7 +4374,7 @@ word_init_ft_buf:
/* get pointer to record from a key */
static my_off_t get_record_for_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- const byte *key)
+ const uchar *key)
{
return _ma_dpos(info,0, key + _ma_keylength(keyinfo, key));
} /* get_record_for_key */
@@ -4384,12 +4384,12 @@ static my_off_t get_record_for_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
static int sort_insert_key(MARIA_SORT_PARAM *sort_param,
register SORT_KEY_BLOCKS *key_block,
- const byte *key,
+ const uchar *key,
my_off_t prev_block)
{
uint a_length,t_length,nod_flag;
my_off_t filepos,key_file_length;
- byte *anc_buff,*lastkey;
+ uchar *anc_buff,*lastkey;
MARIA_KEY_PARAM s_temp;
MARIA_HA *info;
MARIA_KEYDEF *keyinfo=sort_param->keyinfo;
@@ -4423,7 +4423,7 @@ static int sort_insert_key(MARIA_SORT_PARAM *sort_param,
_ma_kpointer(info,key_block->end_pos,prev_block);
t_length=(*keyinfo->pack_key)(keyinfo,nod_flag,
- (byte*) 0,lastkey,lastkey,key,
+ (uchar*) 0,lastkey,lastkey,key,
&s_temp);
(*keyinfo->store_key)(keyinfo, key_block->end_pos+nod_flag,&s_temp);
a_length+=t_length;
@@ -4471,7 +4471,7 @@ static int sort_delete_record(MARIA_SORT_PARAM *sort_param)
{
uint i;
int old_file,error;
- byte *key;
+ uchar *key;
MARIA_SORT_INFO *sort_info=sort_param->sort_info;
HA_CHECK *param=sort_info->param;
MARIA_HA *info=sort_info->info;
@@ -4589,7 +4589,7 @@ static SORT_KEY_BLOCKS *alloc_key_blocks(HA_CHECK *param, uint blocks,
for (i=0 ; i < blocks ; i++)
{
block[i].inited=0;
- block[i].buff= (byte*) (block+blocks)+(buffer_length+IO_SIZE)*i;
+ block[i].buff= (uchar*) (block+blocks)+(buffer_length+IO_SIZE)*i;
}
DBUG_RETURN(block);
} /* alloc_key_blocks */
@@ -4635,34 +4635,34 @@ int maria_recreate_table(HA_CHECK *param, MARIA_HA **org_info, char *filename)
if (!(keyinfo=(MARIA_KEYDEF*) my_alloca(sizeof(MARIA_KEYDEF) *
share.base.keys)))
DBUG_RETURN(0);
- memcpy((byte*) keyinfo,(byte*) share.keyinfo,
+ memcpy((uchar*) keyinfo,(uchar*) share.keyinfo,
(size_t) (sizeof(MARIA_KEYDEF)*share.base.keys));
key_parts= share.base.all_key_parts;
if (!(keysegs=(HA_KEYSEG*) my_alloca(sizeof(HA_KEYSEG)*
(key_parts+share.base.keys))))
{
- my_afree((gptr) keyinfo);
+ my_afree((uchar*) keyinfo);
DBUG_RETURN(1);
}
if (!(columndef=(MARIA_COLUMNDEF*)
my_alloca(sizeof(MARIA_COLUMNDEF)*(share.base.fields+1))))
{
- my_afree((gptr) keyinfo);
- my_afree((gptr) keysegs);
+ my_afree((uchar*) keyinfo);
+ my_afree((uchar*) keysegs);
DBUG_RETURN(1);
}
if (!(uniquedef=(MARIA_UNIQUEDEF*)
my_alloca(sizeof(MARIA_UNIQUEDEF)*(share.state.header.uniques+1))))
{
- my_afree((gptr) columndef);
- my_afree((gptr) keyinfo);
- my_afree((gptr) keysegs);
+ my_afree((uchar*) columndef);
+ my_afree((uchar*) keyinfo);
+ my_afree((uchar*) keysegs);
DBUG_RETURN(1);
}
/* Copy the column definitions */
- memcpy((byte*) columndef,(byte*) share.columndef,
+ memcpy((uchar*) columndef,(uchar*) share.columndef,
(size_t) (sizeof(MARIA_COLUMNDEF)*(share.base.fields+1)));
for (column=columndef, end= columndef+share.base.fields;
column != end ;
@@ -4676,7 +4676,7 @@ int maria_recreate_table(HA_CHECK *param, MARIA_HA **org_info, char *filename)
}
/* Change the new key to point at the saved key segments */
- memcpy((byte*) keysegs,(byte*) share.keyparts,
+ memcpy((uchar*) keysegs,(uchar*) share.keyparts,
(size_t) (sizeof(HA_KEYSEG)*(key_parts+share.base.keys+
share.state.header.uniques)));
keyseg=keysegs;
@@ -4695,7 +4695,7 @@ int maria_recreate_table(HA_CHECK *param, MARIA_HA **org_info, char *filename)
Copy the unique definitions and change them to point at the new key
segments
*/
- memcpy((byte*) uniquedef,(byte*) share.uniqueinfo,
+ memcpy((uchar*) uniquedef,(uchar*) share.uniqueinfo,
(size_t) (sizeof(MARIA_UNIQUEDEF)*(share.state.header.uniques)));
for (u_ptr=uniquedef,u_end=uniquedef+share.state.header.uniques;
u_ptr != u_end ; u_ptr++)
@@ -4787,10 +4787,10 @@ int maria_recreate_table(HA_CHECK *param, MARIA_HA **org_info, char *filename)
goto end;
error=0;
end:
- my_afree((gptr) uniquedef);
- my_afree((gptr) keyinfo);
- my_afree((gptr) columndef);
- my_afree((gptr) keysegs);
+ my_afree((uchar*) uniquedef);
+ my_afree((uchar*) keyinfo);
+ my_afree((uchar*) columndef);
+ my_afree((uchar*) keysegs);
DBUG_RETURN(error);
}
@@ -4894,7 +4894,7 @@ err:
void _ma_update_auto_increment_key(HA_CHECK *param, MARIA_HA *info,
my_bool repair_only)
{
- byte *record;
+ uchar *record;
DBUG_ENTER("update_auto_increment_key");
if (!info->s->base.auto_key ||
@@ -4913,7 +4913,7 @@ void _ma_update_auto_increment_key(HA_CHECK *param, MARIA_HA *info,
We have to use an allocated buffer instead of info->rec_buff as
_ma_put_key_in_record() may use info->rec_buff
*/
- if (!(record= (byte*) my_malloc((uint) info->s->base.pack_reclength,
+ if (!(record= (uchar*) my_malloc((uint) info->s->base.pack_reclength,
MYF(0))))
{
_ma_check_print_error(param,"Not enough memory for extra record");
@@ -5041,10 +5041,10 @@ void maria_update_key_parts(MARIA_KEYDEF *keyinfo, ulong *rec_per_key_part,
}
-static ha_checksum maria_byte_checksum(const byte *buf, uint length)
+static ha_checksum maria_byte_checksum(const uchar *buf, uint length)
{
ha_checksum crc;
- const byte *end=buf+length;
+ const uchar *end=buf+length;
for (crc=0; buf != end; buf++)
crc=((crc << 1) + *((uchar*) buf)) +
test(crc & (((ha_checksum) 1) << (8*sizeof(ha_checksum)-1)));
diff --git a/storage/maria/ma_checkpoint.c b/storage/maria/ma_checkpoint.c
index ed5520f66bf..b23d077897f 100644
--- a/storage/maria/ma_checkpoint.c
+++ b/storage/maria/ma_checkpoint.c
@@ -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);
diff --git a/storage/maria/ma_checksum.c b/storage/maria/ma_checksum.c
index 95555aa3129..30921ad8213 100644
--- a/storage/maria/ma_checksum.c
+++ b/storage/maria/ma_checksum.c
@@ -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);
}
diff --git a/storage/maria/ma_close.c b/storage/maria/ma_close.c
index 34c1bfb4d6d..b760d537670 100644
--- a/storage/maria/ma_close.c
+++ b/storage/maria/ma_close.c
@@ -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)
{
diff --git a/storage/maria/ma_create.c b/storage/maria/ma_create.c
index 53e15deb74b..e26b49a1d37 100644
--- a/storage/maria/ma_create.c
+++ b/storage/maria/ma_create.c
@@ -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
{
diff --git a/storage/maria/ma_dbug.c b/storage/maria/ma_dbug.c
index 150385607b6..a23e7248029 100644
--- a/storage/maria/ma_dbug.c
+++ b/storage/maria/ma_dbug.c
@@ -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;
diff --git a/storage/maria/ma_delete.c b/storage/maria/ma_delete.c
index 54c6b7aaefc..8dafd1c4f17 100644
--- a/storage/maria/ma_delete.c
+++ b/storage/maria/ma_delete.c
@@ -19,23 +19,23 @@
#include "ma_rt_index.h"
static int d_search(MARIA_HA *info,MARIA_KEYDEF *keyinfo,uint comp_flag,
- byte *key,uint key_length,my_off_t page,byte *anc_buff);
-static int del(MARIA_HA *info,MARIA_KEYDEF *keyinfo,byte *key,byte *anc_buff,
- my_off_t leaf_page,byte *leaf_buff,byte *keypos,
- my_off_t next_block,byte *ret_key);
-static int underflow(MARIA_HA *info,MARIA_KEYDEF *keyinfo,byte *anc_buff,
- my_off_t leaf_page,byte *leaf_buff,byte *keypos);
-static uint remove_key(MARIA_KEYDEF *keyinfo,uint nod_flag,byte *keypos,
- byte *lastkey,byte *page_end,
+ uchar *key,uint key_length,my_off_t page,uchar *anc_buff);
+static int del(MARIA_HA *info,MARIA_KEYDEF *keyinfo,uchar *key,uchar *anc_buff,
+ my_off_t leaf_page,uchar *leaf_buff,uchar *keypos,
+ my_off_t next_block,uchar *ret_key);
+static int underflow(MARIA_HA *info,MARIA_KEYDEF *keyinfo,uchar *anc_buff,
+ my_off_t leaf_page,uchar *leaf_buff,uchar *keypos);
+static uint remove_key(MARIA_KEYDEF *keyinfo,uint nod_flag,uchar *keypos,
+ uchar *lastkey,uchar *page_end,
my_off_t *next_block);
static int _ma_ck_real_delete(register MARIA_HA *info,MARIA_KEYDEF *keyinfo,
- byte *key, uint key_length, my_off_t *root);
+ uchar *key, uint key_length, my_off_t *root);
-int maria_delete(MARIA_HA *info,const byte *record)
+int maria_delete(MARIA_HA *info,const uchar *record)
{
uint i;
- byte *old_key;
+ uchar *old_key;
int save_errno;
char lastpos[8];
MARIA_SHARE *share=info->s;
@@ -141,7 +141,7 @@ err:
/* Remove a key from the btree index */
-int _ma_ck_delete(register MARIA_HA *info, uint keynr, byte *key,
+int _ma_ck_delete(register MARIA_HA *info, uint keynr, uchar *key,
uint key_length)
{
return _ma_ck_real_delete(info, info->s->keyinfo+keynr, key, key_length,
@@ -150,12 +150,12 @@ int _ma_ck_delete(register MARIA_HA *info, uint keynr, byte *key,
static int _ma_ck_real_delete(register MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- byte *key, uint key_length, my_off_t *root)
+ uchar *key, uint key_length, my_off_t *root)
{
int error;
uint nod_flag;
my_off_t old_root;
- byte *root_buff;
+ uchar *root_buff;
DBUG_ENTER("_ma_ck_real_delete");
if ((old_root=*root) == HA_OFFSET_ERROR)
@@ -163,7 +163,7 @@ static int _ma_ck_real_delete(register MARIA_HA *info, MARIA_KEYDEF *keyinfo,
maria_print_error(info->s, HA_ERR_CRASHED);
DBUG_RETURN(my_errno=HA_ERR_CRASHED);
}
- if (!(root_buff= (byte*) my_alloca((uint) keyinfo->block_length+
+ if (!(root_buff= (uchar*) my_alloca((uint) keyinfo->block_length+
HA_MAX_KEY_BUFF*2)))
{
DBUG_PRINT("error",("Couldn't allocate memory"));
@@ -203,7 +203,7 @@ static int _ma_ck_real_delete(register MARIA_HA *info, MARIA_KEYDEF *keyinfo,
}
}
err:
- my_afree((gptr) root_buff);
+ my_afree((uchar*) root_buff);
DBUG_PRINT("exit",("Return: %d",error));
DBUG_RETURN(error);
} /* _ma_ck_real_delete */
@@ -218,15 +218,15 @@ err:
*/
static int d_search(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
- uint comp_flag, byte *key, uint key_length,
- my_off_t page, byte *anc_buff)
+ uint comp_flag, uchar *key, uint key_length,
+ my_off_t page, uchar *anc_buff)
{
int flag,ret_value,save_flag;
uint length,nod_flag,search_key_length;
my_bool last_key;
- byte *leaf_buff,*keypos;
+ uchar *leaf_buff,*keypos;
my_off_t leaf_page,next_block;
- byte lastkey[HA_MAX_KEY_BUFF];
+ uchar lastkey[HA_MAX_KEY_BUFF];
DBUG_ENTER("d_search");
DBUG_DUMP("page",anc_buff,maria_data_on_page(anc_buff));
@@ -270,7 +270,7 @@ static int d_search(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
/* popular word. two-level tree. going down */
uint tmp_key_length;
my_off_t root;
- byte *kpos=keypos;
+ uchar *kpos=keypos;
if (!(tmp_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&kpos,lastkey)))
{
@@ -310,7 +310,7 @@ static int d_search(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
if (nod_flag)
{
leaf_page= _ma_kpos(nod_flag,keypos);
- if (!(leaf_buff= (byte*) my_alloca((uint) keyinfo->block_length+
+ if (!(leaf_buff= (uchar*) my_alloca((uint) keyinfo->block_length+
HA_MAX_KEY_BUFF*2)))
{
DBUG_PRINT("error",("Couldn't allocate memory"));
@@ -372,7 +372,7 @@ static int d_search(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
if (!_ma_get_last_key(info,keyinfo,anc_buff,lastkey,keypos,&length))
goto err;
ret_value= _ma_insert(info,keyinfo,key,anc_buff,keypos,lastkey,
- (byte*) 0,(byte*) 0,(my_off_t) 0,(my_bool) 0);
+ (uchar*) 0,(uchar*) 0,(my_off_t) 0,(my_bool) 0);
}
}
if (ret_value == 0 && maria_data_on_page(anc_buff) > keyinfo->block_length)
@@ -400,16 +400,16 @@ err:
/* Remove a key that has a page-reference */
static int del(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
- byte *key, byte *anc_buff, my_off_t leaf_page,
- byte *leaf_buff,
- byte *keypos, /* Pos to where deleted key was */
+ uchar *key, uchar *anc_buff, my_off_t leaf_page,
+ uchar *leaf_buff,
+ uchar *keypos, /* Pos to where deleted key was */
my_off_t next_block,
- byte *ret_key) /* key before keypos in anc_buff */
+ uchar *ret_key) /* key before keypos in anc_buff */
{
int ret_value,length;
uint a_length,nod_flag,tmp;
my_off_t next_page;
- byte keybuff[HA_MAX_KEY_BUFF],*endpos,*next_buff,*key_start, *prev_key;
+ uchar keybuff[HA_MAX_KEY_BUFF],*endpos,*next_buff,*key_start, *prev_key;
MARIA_SHARE *share=info->s;
MARIA_KEY_PARAM s_temp;
DBUG_ENTER("del");
@@ -425,7 +425,7 @@ static int del(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
if ((nod_flag=_ma_test_if_nod(leaf_buff)))
{
next_page= _ma_kpos(nod_flag,endpos);
- if (!(next_buff= (byte*) my_alloca((uint) keyinfo->block_length+
+ if (!(next_buff= (uchar*) my_alloca((uint) keyinfo->block_length+
HA_MAX_KEY_BUFF*2)))
DBUG_RETURN(-1);
if (!_ma_fetch_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,next_buff,0))
@@ -453,7 +453,7 @@ static int del(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
&tmp))
goto err;
ret_value= _ma_insert(info,keyinfo,key,leaf_buff,endpos,keybuff,
- (byte*) 0,(byte*) 0,(my_off_t) 0,0);
+ (uchar*) 0,(uchar*) 0,(my_off_t) 0,0);
}
}
if (_ma_write_keypage(info,keyinfo,leaf_page,DFLT_INIT_HITS,leaf_buff))
@@ -479,7 +479,7 @@ static int del(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
prev_key=(keypos == anc_buff+2+share->base.key_reflength ?
0 : ret_key);
length=(*keyinfo->pack_key)(keyinfo,share->base.key_reflength,
- keypos == endpos ? (byte*) 0 : keypos,
+ keypos == endpos ? (uchar*) 0 : keypos,
prev_key, prev_key,
keybuff,&s_temp);
if (length > 0)
@@ -504,18 +504,18 @@ err:
/* Balances adjacent pages if underflow occours */
static int underflow(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
- byte *anc_buff,
+ uchar *anc_buff,
my_off_t leaf_page,/* Ancestor page and underflow page */
- byte *leaf_buff,
- byte *keypos) /* Position to pos after key */
+ uchar *leaf_buff,
+ uchar *keypos) /* Position to pos after key */
{
int t_length;
uint length,anc_length,buff_length,leaf_length,p_length,s_length,nod_flag,
key_reflength,key_length;
my_off_t next_page;
- byte anc_key[HA_MAX_KEY_BUFF],leaf_key[HA_MAX_KEY_BUFF];
- byte *buff,*endpos,*next_keypos,*anc_pos,*half_pos,*temp_pos,*prev_key;
- byte *after_key;
+ uchar anc_key[HA_MAX_KEY_BUFF],leaf_key[HA_MAX_KEY_BUFF];
+ uchar *buff,*endpos,*next_keypos,*anc_pos,*half_pos,*temp_pos,*prev_key;
+ uchar *after_key;
MARIA_KEY_PARAM s_temp;
MARIA_SHARE *share=info->s;
DBUG_ENTER("underflow");
@@ -568,7 +568,7 @@ static int underflow(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
goto err;
/* merge pages and put parting key from anc_buff between */
- prev_key=(leaf_length == p_length ? (byte*) 0 : leaf_key);
+ prev_key=(leaf_length == p_length ? (uchar*) 0 : leaf_key);
t_length=(*keyinfo->pack_key)(keyinfo,nod_flag,buff+p_length,
prev_key, prev_key,
anc_key, &s_temp);
@@ -615,9 +615,9 @@ static int underflow(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
half_pos=after_key;
_ma_kpointer(info,leaf_key+key_length,next_page);
/* Save key in anc_buff */
- prev_key=(keypos == anc_buff+2+key_reflength ? (byte*) 0 : anc_key),
+ prev_key=(keypos == anc_buff+2+key_reflength ? (uchar*) 0 : anc_key),
t_length=(*keyinfo->pack_key)(keyinfo,key_reflength,
- (keypos == endpos ? (byte*) 0 :
+ (keypos == endpos ? (uchar*) 0 :
keypos),
prev_key, prev_key,
leaf_key, &s_temp);
@@ -633,8 +633,8 @@ static int underflow(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
bmove(buff+2,half_pos-nod_flag,(size_t) nod_flag);
if (!(*keyinfo->get_key)(keyinfo,nod_flag,&half_pos,leaf_key))
goto err;
- t_length=(int) (*keyinfo->pack_key)(keyinfo, nod_flag, (byte*) 0,
- (byte*) 0, (byte*) 0,
+ t_length=(int) (*keyinfo->pack_key)(keyinfo, nod_flag, (uchar*) 0,
+ (uchar*) 0, (uchar*) 0,
leaf_key, &s_temp);
/* t_length will always be > 0 for a new page !*/
length=(uint) ((buff+maria_data_on_page(buff))-half_pos);
@@ -673,10 +673,10 @@ static int underflow(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
goto err;
/* merge pages and put parting key from anc_buff between */
- prev_key=(leaf_length == p_length ? (byte*) 0 : leaf_key);
+ prev_key=(leaf_length == p_length ? (uchar*) 0 : leaf_key);
t_length=(*keyinfo->pack_key)(keyinfo,nod_flag,
(leaf_length == p_length ?
- (byte*) 0 : leaf_buff+p_length),
+ (uchar*) 0 : leaf_buff+p_length),
prev_key, prev_key,
anc_key, &s_temp);
if (t_length >= 0)
@@ -721,7 +721,7 @@ static int underflow(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
temp_pos=anc_buff+anc_length;
t_length=(*keyinfo->pack_key)(keyinfo,key_reflength,
- keypos == temp_pos ? (byte*) 0
+ keypos == temp_pos ? (uchar*) 0
: keypos,
anc_pos, anc_pos,
leaf_key,&s_temp);
@@ -738,8 +738,8 @@ static int underflow(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
if (!(length=(*keyinfo->get_key)(keyinfo,nod_flag,&half_pos,leaf_key)))
goto err;
DBUG_DUMP("key_to_leaf",leaf_key,length);
- t_length=(*keyinfo->pack_key)(keyinfo,nod_flag, (byte*) 0,
- (byte*) 0, (byte*) 0, leaf_key, &s_temp);
+ t_length=(*keyinfo->pack_key)(keyinfo,nod_flag, (uchar*) 0,
+ (uchar*) 0, (uchar*) 0, leaf_key, &s_temp);
length=(uint) ((buff+buff_length)-half_pos);
DBUG_PRINT("info",("t_length: %d length: %d",t_length,(int) length));
bmove(leaf_buff+p_length+t_length,half_pos,
@@ -767,13 +767,13 @@ err:
*/
static uint remove_key(MARIA_KEYDEF *keyinfo, uint nod_flag,
- byte *keypos, /* Where key starts */
- byte *lastkey, /* key to be removed */
- byte *page_end, /* End of page */
+ uchar *keypos, /* Where key starts */
+ uchar *lastkey, /* key to be removed */
+ uchar *page_end, /* End of page */
my_off_t *next_block) /* ptr to next block */
{
int s_length;
- byte *start;
+ uchar *start;
DBUG_ENTER("remove_key");
DBUG_PRINT("enter",("keypos: 0x%lx page_end: 0x%lx",(long) keypos, (long) page_end));
@@ -799,7 +799,7 @@ static uint remove_key(MARIA_KEYDEF *keyinfo, uint nod_flag,
{
if (keyinfo->flag & HA_BINARY_PACK_KEY)
{
- byte *old_key=start;
+ uchar *old_key=start;
uint next_length,prev_length,prev_pack_length;
get_key_length(next_length,keypos);
get_key_pack_length(prev_length,prev_pack_length,old_key);
diff --git a/storage/maria/ma_dynrec.c b/storage/maria/ma_dynrec.c
index ebf84032106..e1968811ba2 100644
--- a/storage/maria/ma_dynrec.c
+++ b/storage/maria/ma_dynrec.c
@@ -25,15 +25,15 @@
#include "maria_def.h"
-static my_bool write_dynamic_record(MARIA_HA *info,const byte *record,
+static my_bool write_dynamic_record(MARIA_HA *info,const uchar *record,
ulong reclength);
static int _ma_find_writepos(MARIA_HA *info,ulong reclength,my_off_t *filepos,
ulong *length);
static my_bool update_dynamic_record(MARIA_HA *info, MARIA_RECORD_POS filepos,
- byte *record, ulong reclength);
+ uchar *record, ulong reclength);
static my_bool delete_dynamic_record(MARIA_HA *info,MARIA_RECORD_POS filepos,
uint second_read);
-static my_bool _ma_cmp_buffer(File file, const byte *buff, my_off_t filepos,
+static my_bool _ma_cmp_buffer(File file, const uchar *buff, my_off_t filepos,
uint length);
#ifdef THREAD
@@ -76,13 +76,13 @@ my_bool _ma_dynmap_file(MARIA_HA *info, my_off_t size)
mapping. When swap space is not reserved one might get SIGSEGV
upon a write if no physical memory is available.
*/
- info->s->file_map= (byte*)
+ info->s->file_map= (uchar*)
my_mmap(0, (size_t)(size + MEMMAP_EXTRA_MARGIN),
info->s->mode==O_RDONLY ? PROT_READ :
PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_NORESERVE,
info->dfile.file, 0L);
- if (info->s->file_map == (byte*) MAP_FAILED)
+ if (info->s->file_map == (uchar*) MAP_FAILED)
{
info->s->file_map= NULL;
DBUG_RETURN(1);
@@ -132,7 +132,7 @@ void _ma_remap_file(MARIA_HA *info, my_off_t size)
0 ok
*/
-uint _ma_mmap_pread(MARIA_HA *info, byte *Buffer,
+uint _ma_mmap_pread(MARIA_HA *info, uchar *Buffer,
uint Count, my_off_t offset, myf MyFlags)
{
DBUG_PRINT("info", ("maria_read with mmap %d\n", info->dfile.file));
@@ -164,7 +164,7 @@ uint _ma_mmap_pread(MARIA_HA *info, byte *Buffer,
/* wrapper for my_pread in case if mmap isn't used */
-uint _ma_nommap_pread(MARIA_HA *info, byte *Buffer,
+uint _ma_nommap_pread(MARIA_HA *info, uchar *Buffer,
uint Count, my_off_t offset, myf MyFlags)
{
return my_pread(info->dfile.file, Buffer, Count, offset, MyFlags);
@@ -187,7 +187,7 @@ uint _ma_nommap_pread(MARIA_HA *info, byte *Buffer,
!=0 error. In this case return error from pwrite
*/
-uint _ma_mmap_pwrite(MARIA_HA *info, byte *Buffer,
+uint _ma_mmap_pwrite(MARIA_HA *info, uchar *Buffer,
uint Count, my_off_t offset, myf MyFlags)
{
DBUG_PRINT("info", ("maria_write with mmap %d\n", info->dfile.file));
@@ -221,14 +221,14 @@ uint _ma_mmap_pwrite(MARIA_HA *info, byte *Buffer,
/* wrapper for my_pwrite in case if mmap isn't used */
-uint _ma_nommap_pwrite(MARIA_HA *info, byte *Buffer,
+uint _ma_nommap_pwrite(MARIA_HA *info, uchar *Buffer,
uint Count, my_off_t offset, myf MyFlags)
{
return my_pwrite(info->dfile.file, Buffer, Count, offset, MyFlags);
}
-my_bool _ma_write_dynamic_record(MARIA_HA *info, const byte *record)
+my_bool _ma_write_dynamic_record(MARIA_HA *info, const uchar *record)
{
ulong reclength= _ma_rec_pack(info,info->rec_buff + MARIA_REC_BUFF_OFFSET,
record);
@@ -237,8 +237,8 @@ my_bool _ma_write_dynamic_record(MARIA_HA *info, const byte *record)
}
my_bool _ma_update_dynamic_record(MARIA_HA *info, MARIA_RECORD_POS pos,
- const byte *oldrec __attribute__ ((unused)),
- const byte *record)
+ const uchar *oldrec __attribute__ ((unused)),
+ const uchar *record)
{
uint length= _ma_rec_pack(info, info->rec_buff + MARIA_REC_BUFF_OFFSET,
record);
@@ -248,9 +248,9 @@ my_bool _ma_update_dynamic_record(MARIA_HA *info, MARIA_RECORD_POS pos,
}
-my_bool _ma_write_blob_record(MARIA_HA *info, const byte *record)
+my_bool _ma_write_blob_record(MARIA_HA *info, const uchar *record)
{
- byte *rec_buff;
+ uchar *rec_buff;
int error;
ulong reclength,reclength2,extra;
@@ -258,7 +258,7 @@ my_bool _ma_write_blob_record(MARIA_HA *info, const byte *record)
MARIA_DYN_DELETE_BLOCK_HEADER+1);
reclength= (info->s->base.pack_reclength +
_ma_calc_total_blob_length(info,record)+ extra);
- if (!(rec_buff=(byte*) my_alloca(reclength)))
+ if (!(rec_buff=(uchar*) my_alloca(reclength)))
{
my_errno= HA_ERR_OUT_OF_MEM; /* purecov: inspected */
return(1);
@@ -278,10 +278,10 @@ my_bool _ma_write_blob_record(MARIA_HA *info, const byte *record)
my_bool _ma_update_blob_record(MARIA_HA *info, MARIA_RECORD_POS pos,
- const byte *oldrec __attribute__ ((unused)),
- const byte *record)
+ const uchar *oldrec __attribute__ ((unused)),
+ const uchar *record)
{
- byte *rec_buff;
+ uchar *rec_buff;
int error;
ulong reclength,extra;
@@ -296,7 +296,7 @@ my_bool _ma_update_blob_record(MARIA_HA *info, MARIA_RECORD_POS pos,
return 1;
}
#endif
- if (!(rec_buff=(byte*) my_alloca(reclength)))
+ if (!(rec_buff=(uchar*) my_alloca(reclength)))
{
my_errno= HA_ERR_OUT_OF_MEM; /* purecov: inspected */
return(1);
@@ -312,7 +312,7 @@ my_bool _ma_update_blob_record(MARIA_HA *info, MARIA_RECORD_POS pos,
my_bool _ma_delete_dynamic_record(MARIA_HA *info,
- const byte *record __attribute__ ((unused)))
+ const uchar *record __attribute__ ((unused)))
{
return delete_dynamic_record(info, info->cur_row.lastpos, 0);
}
@@ -320,7 +320,7 @@ my_bool _ma_delete_dynamic_record(MARIA_HA *info,
/* Write record to data-file */
-static my_bool write_dynamic_record(MARIA_HA *info, const byte *record,
+static my_bool write_dynamic_record(MARIA_HA *info, const uchar *record,
ulong reclength)
{
int flag;
@@ -336,7 +336,7 @@ static my_bool write_dynamic_record(MARIA_HA *info, const byte *record,
if (_ma_write_part_record(info,filepos,length,
(info->append_insert_at_end ?
HA_OFFSET_ERROR : info->s->state.dellink),
- (byte**) &record,&reclength,&flag))
+ (uchar**) &record,&reclength,&flag))
goto err;
} while (reclength);
@@ -550,7 +550,7 @@ static my_bool delete_dynamic_record(MARIA_HA *info, MARIA_RECORD_POS filepos,
bfill(block_info.header+12,8,255);
else
mi_sizestore(block_info.header+12,block_info.next_filepos);
- if (info->s->file_write(info,(byte*) block_info.header,20,filepos,
+ if (info->s->file_write(info,(uchar*) block_info.header,20,filepos,
MYF(MY_NABP)))
DBUG_RETURN(1);
info->s->state.dellink = filepos;
@@ -573,12 +573,12 @@ int _ma_write_part_record(MARIA_HA *info,
my_off_t filepos, /* points at empty block */
ulong length, /* length of block */
my_off_t next_filepos,/* Next empty block */
- byte **record, /* pointer to record ptr */
+ uchar **record, /* pointer to record ptr */
ulong *reclength, /* length of *record */
int *flag) /* *flag == 0 if header */
{
ulong head_length,res_length,extra_length,long_block,del_length;
- byte *pos,*record_end;
+ uchar *pos,*record_end;
my_off_t next_delete_block;
uchar temp[MARIA_SPLIT_LENGTH+MARIA_DYN_DELETE_BLOCK_HEADER];
DBUG_ENTER("_ma_write_part_record");
@@ -622,7 +622,7 @@ int _ma_write_part_record(MARIA_HA *info,
temp[0]=13;
mi_int4store(temp+1,*reclength);
mi_int3store(temp+5,length-head_length);
- mi_sizestore((byte*) temp+8,next_filepos);
+ mi_sizestore((uchar*) temp+8,next_filepos);
}
else
{
@@ -632,13 +632,13 @@ int _ma_write_part_record(MARIA_HA *info,
{
mi_int3store(temp+1,*reclength);
mi_int3store(temp+4,length-head_length);
- mi_sizestore((byte*) temp+7,next_filepos);
+ mi_sizestore((uchar*) temp+7,next_filepos);
}
else
{
mi_int2store(temp+1,*reclength);
mi_int2store(temp+3,length-head_length);
- mi_sizestore((byte*) temp+5,next_filepos);
+ mi_sizestore((uchar*) temp+5,next_filepos);
}
}
}
@@ -649,12 +649,12 @@ int _ma_write_part_record(MARIA_HA *info,
if (long_block)
{
mi_int3store(temp+1,length-head_length);
- mi_sizestore((byte*) temp+4,next_filepos);
+ mi_sizestore((uchar*) temp+4,next_filepos);
}
else
{
mi_int2store(temp+1,length-head_length);
- mi_sizestore((byte*) temp+3,next_filepos);
+ mi_sizestore((uchar*) temp+3,next_filepos);
}
}
}
@@ -675,14 +675,14 @@ int _ma_write_part_record(MARIA_HA *info,
}
length= *reclength+head_length; /* Write only what is needed */
}
- DBUG_DUMP("header",(byte*) temp,head_length);
+ DBUG_DUMP("header",(uchar*) temp,head_length);
/* Make a long block for one write */
record_end= *record+length-head_length;
del_length=(res_length ? MARIA_DYN_DELETE_BLOCK_HEADER : 0);
- bmove((byte*) (*record-head_length),(byte*) temp,head_length);
+ bmove((uchar*) (*record-head_length),(uchar*) temp,head_length);
memcpy(temp,record_end,(size_t) (extra_length+del_length));
- bzero((byte*) record_end,extra_length);
+ bzero((uchar*) record_end,extra_length);
if (res_length)
{
@@ -722,18 +722,18 @@ int _ma_write_part_record(MARIA_HA *info,
if (info->update & HA_STATE_EXTEND_BLOCK)
{
info->update&= ~HA_STATE_EXTEND_BLOCK;
- if (my_block_write(&info->rec_cache,(byte*) *record-head_length,
+ if (my_block_write(&info->rec_cache,(uchar*) *record-head_length,
length+extra_length+del_length,filepos))
goto err;
}
- else if (my_b_write(&info->rec_cache,(byte*) *record-head_length,
+ else if (my_b_write(&info->rec_cache,(uchar*) *record-head_length,
length+extra_length+del_length))
goto err;
}
else
{
info->rec_cache.seek_not_done=1;
- if (info->s->file_write(info,(byte*) *record-head_length,
+ if (info->s->file_write(info,(uchar*) *record-head_length,
length+extra_length+
del_length,filepos,info->s->write_flag))
goto err;
@@ -761,7 +761,7 @@ err:
/* update record from datafile */
static my_bool update_dynamic_record(MARIA_HA *info, MARIA_RECORD_POS filepos,
- byte *record, ulong reclength)
+ uchar *record, ulong reclength)
{
int flag;
uint error;
@@ -844,7 +844,7 @@ static my_bool update_dynamic_record(MARIA_HA *info, MARIA_RECORD_POS filepos,
mi_int3store(del_block.header+1, rest_length);
mi_sizestore(del_block.header+4,info->s->state.dellink);
bfill(del_block.header+12,8,255);
- if (info->s->file_write(info,(byte*) del_block.header, 20,
+ if (info->s->file_write(info,(uchar*) del_block.header, 20,
next_pos, MYF(MY_NABP)))
DBUG_RETURN(1);
info->s->state.dellink= next_pos;
@@ -883,7 +883,8 @@ err:
/* Pack a record. Return new reclength */
-uint _ma_rec_pack(MARIA_HA *info, register byte *to, register const byte *from)
+uint _ma_rec_pack(MARIA_HA *info, register uchar *to,
+ register const uchar *from)
{
uint length,new_length,flag,bit,i;
char *pos,*end,*startpos,*packpos;
@@ -918,7 +919,7 @@ uint _ma_rec_pack(MARIA_HA *info, register byte *to, register const byte *from)
{
char *temp_pos;
size_t tmp_length=length-portable_sizeof_char_ptr;
- memcpy((byte*) to,from,tmp_length);
+ memcpy((uchar*) to,from,tmp_length);
memcpy_fixed(&temp_pos,from+tmp_length,sizeof(char*));
memcpy(to+tmp_length,temp_pos,(size_t) blob->length);
to+=tmp_length+blob->length;
@@ -927,20 +928,20 @@ uint _ma_rec_pack(MARIA_HA *info, register byte *to, register const byte *from)
}
else if (type == FIELD_SKIP_ZERO)
{
- if (memcmp((byte*) from, maria_zero_string, length) == 0)
+ if (memcmp((uchar*) from, maria_zero_string, length) == 0)
flag|=bit;
else
{
- memcpy((byte*) to,from,(size_t) length); to+=length;
+ memcpy((uchar*) to,from,(size_t) length); to+=length;
}
}
else if (type == FIELD_SKIP_ENDSPACE ||
type == FIELD_SKIP_PRESPACE)
{
- pos= (byte*) from; end= (byte*) from + length;
+ pos= (uchar*) from; end= (uchar*) from + length;
if (type == FIELD_SKIP_ENDSPACE)
{ /* Pack trailing spaces */
- while (end > from && *(end-1) == ' ')
+ while (end > (char*) from && *(end-1) == ' ')
end--;
}
else
@@ -960,7 +961,7 @@ uint _ma_rec_pack(MARIA_HA *info, register byte *to, register const byte *from)
}
else
*to++= (char) new_length;
- memcpy((byte*) to,pos,(size_t) new_length); to+=new_length;
+ memcpy((uchar*) to,pos,(size_t) new_length); to+=new_length;
flag|=bit;
}
else
@@ -1005,9 +1006,9 @@ uint _ma_rec_pack(MARIA_HA *info, register byte *to, register const byte *from)
if (bit != 1)
*packpos= (char) (uchar) flag;
if (info->s->calc_checksum)
- *to++= (byte) info->cur_row.checksum;
- DBUG_PRINT("exit",("packed length: %d",(int) (to-startpos)));
- DBUG_RETURN((uint) (to-startpos));
+ *to++= (uchar) info->cur_row.checksum;
+ DBUG_PRINT("exit",("packed length: %d",(int) ((char*)to-startpos)));
+ DBUG_RETURN((uint) ((char*)to-startpos));
} /* _ma_rec_pack */
@@ -1017,7 +1018,7 @@ uint _ma_rec_pack(MARIA_HA *info, register byte *to, register const byte *from)
Returns 0 if record is ok.
*/
-my_bool _ma_rec_check(MARIA_HA *info,const char *record, byte *rec_buff,
+my_bool _ma_rec_check(MARIA_HA *info,const char *record, uchar *rec_buff,
ulong packed_length, my_bool with_checksum)
{
uint length,new_length,flag,bit,i;
@@ -1048,7 +1049,7 @@ my_bool _ma_rec_check(MARIA_HA *info,const char *record, byte *rec_buff,
}
else if (type == FIELD_SKIP_ZERO)
{
- if (memcmp((byte*) record, maria_zero_string, length) == 0)
+ if (memcmp((uchar*) record, maria_zero_string, length) == 0)
{
if (!(flag & bit))
goto err;
@@ -1059,7 +1060,7 @@ my_bool _ma_rec_check(MARIA_HA *info,const char *record, byte *rec_buff,
else if (type == FIELD_SKIP_ENDSPACE ||
type == FIELD_SKIP_PRESPACE)
{
- pos= (byte*) record; end= (byte*) record + length;
+ pos= (uchar*) record; end= (uchar*) record + length;
if (type == FIELD_SKIP_ENDSPACE)
{ /* Pack trailing spaces */
while (end > record && *(end-1) == ' ')
@@ -1121,8 +1122,8 @@ my_bool _ma_rec_check(MARIA_HA *info,const char *record, byte *rec_buff,
else
to+= length;
}
- if (packed_length != (uint) (to - rec_buff) + test(info->s->calc_checksum) ||
- (bit != 1 && (flag & ~(bit - 1))))
+ if (packed_length != (uint) (to - (char*) rec_buff) +
+ test(info->s->calc_checksum) || (bit != 1 && (flag & ~(bit - 1))))
goto err;
if (with_checksum && ((uchar) info->cur_row.checksum != (uchar) *to))
{
@@ -1141,12 +1142,12 @@ err:
/* Returns -1 and my_errno =HA_ERR_RECORD_DELETED if reclength isn't */
/* right. Returns reclength (>0) if ok */
-ulong _ma_rec_unpack(register MARIA_HA *info, register byte *to, byte *from,
+ulong _ma_rec_unpack(register MARIA_HA *info, register uchar *to, uchar *from,
ulong found_length)
{
uint flag,bit,length,min_pack_length, column_length;
enum en_fieldtype type;
- byte *from_end,*to_end,*packpos;
+ uchar *from_end,*to_end,*packpos;
reg3 MARIA_COLUMNDEF *column, *end_column;
DBUG_ENTER("_ma_rec_unpack");
@@ -1200,7 +1201,7 @@ ulong _ma_rec_unpack(register MARIA_HA *info, register byte *to, byte *from,
if (flag & bit)
{
if (type == FIELD_BLOB || type == FIELD_SKIP_ZERO)
- bzero((byte*) to,column_length);
+ bzero((uchar*) to,column_length);
else if (type == FIELD_SKIP_ENDSPACE ||
type == FIELD_SKIP_PRESPACE)
{
@@ -1222,13 +1223,13 @@ ulong _ma_rec_unpack(register MARIA_HA *info, register byte *to, byte *from,
goto err;
if (type == FIELD_SKIP_ENDSPACE)
{
- memcpy(to,(byte*) from,(size_t) length);
- bfill((byte*) to+length,column_length-length,' ');
+ memcpy(to,(uchar*) from,(size_t) length);
+ bfill((uchar*) to+length,column_length-length,' ');
}
else
{
- bfill((byte*) to,column_length-length,' ');
- memcpy(to+column_length-length,(byte*) from,(size_t) length);
+ bfill((uchar*) to,column_length-length,' ');
+ memcpy(to+column_length-length,(uchar*) from,(size_t) length);
}
from+=length;
}
@@ -1242,9 +1243,9 @@ ulong _ma_rec_unpack(register MARIA_HA *info, register byte *to, byte *from,
from_left - size_length < blob_length ||
from_left - size_length - blob_length < min_pack_length)
goto err;
- memcpy((byte*) to,(byte*) from,(size_t) size_length);
+ memcpy((uchar*) to,(uchar*) from,(size_t) size_length);
from+=size_length;
- memcpy_fixed((byte*) to+size_length,(byte*) &from,sizeof(char*));
+ memcpy_fixed((uchar*) to+size_length,(uchar*) &from,sizeof(char*));
from+=blob_length;
}
else
@@ -1253,7 +1254,7 @@ ulong _ma_rec_unpack(register MARIA_HA *info, register byte *to, byte *from,
min_pack_length--;
if (min_pack_length + column_length > (uint) (from_end - from))
goto err;
- memcpy(to,(byte*) from,(size_t) column_length); from+=column_length;
+ memcpy(to,(uchar*) from,(size_t) column_length); from+=column_length;
}
if ((bit= bit << 1) >= 256)
{
@@ -1265,7 +1266,7 @@ ulong _ma_rec_unpack(register MARIA_HA *info, register byte *to, byte *from,
if (min_pack_length > (uint) (from_end - from))
goto err;
min_pack_length-=column_length;
- memcpy(to, (byte*) from, (size_t) column_length);
+ memcpy(to, (uchar*) from, (size_t) column_length);
from+=column_length;
}
}
@@ -1278,14 +1279,14 @@ err:
my_errno= HA_ERR_WRONG_IN_RECORD;
DBUG_PRINT("error",("to_end: 0x%lx -> 0x%lx from_end: 0x%lx -> 0x%lx",
(long) to, (long) to_end, (long) from, (long) from_end));
- DBUG_DUMP("from",(byte*) info->rec_buff,info->s->base.min_pack_length);
+ DBUG_DUMP("from",(uchar*) info->rec_buff,info->s->base.min_pack_length);
DBUG_RETURN(MY_FILE_ERROR);
} /* _ma_rec_unpack */
/* Calc length of blob. Update info in blobs->length */
-ulong _ma_calc_total_blob_length(MARIA_HA *info, const byte *record)
+ulong _ma_calc_total_blob_length(MARIA_HA *info, const uchar *record)
{
ulong length;
MARIA_BLOB *blob,*end;
@@ -1301,7 +1302,7 @@ ulong _ma_calc_total_blob_length(MARIA_HA *info, const byte *record)
}
-ulong _ma_calc_blob_length(uint length, const byte *pos)
+ulong _ma_calc_blob_length(uint length, const uchar *pos)
{
switch (length) {
case 1:
@@ -1319,7 +1320,7 @@ ulong _ma_calc_blob_length(uint length, const byte *pos)
}
-void _ma_store_blob_length(byte *pos,uint pack_length,uint length)
+void _ma_store_blob_length(uchar *pos,uint pack_length,uint length)
{
switch (pack_length) {
case 1:
@@ -1352,11 +1353,11 @@ void _ma_store_blob_length(byte *pos,uint pack_length,uint length)
NOTE
If a write buffer is active, it needs to be flushed if its contents
intersects with the record to read. We always check if the position
- of the first byte of the write buffer is lower than the position
- past the last byte to read. In theory this is also true if the write
+ of the first uchar of the write buffer is lower than the position
+ past the last uchar to read. In theory this is also true if the write
buffer is completely below the read segment. That is, if there is no
intersection. But this case is unusual. We flush anyway. Only if the
- first byte in the write buffer is above the last byte to read, we do
+ first uchar in the write buffer is above the last uchar to read, we do
not flush.
A dynamic record may need several reads. So this check must be done
@@ -1370,7 +1371,7 @@ void _ma_store_blob_length(byte *pos,uint pack_length,uint length)
0 OK
1 Error
*/
-int _ma_read_dynamic_record(MARIA_HA *info, byte *buf,
+int _ma_read_dynamic_record(MARIA_HA *info, uchar *buf,
MARIA_RECORD_POS filepos)
{
int block_of_record;
@@ -1381,7 +1382,7 @@ int _ma_read_dynamic_record(MARIA_HA *info, byte *buf,
if (filepos != HA_OFFSET_ERROR)
{
- byte *to;
+ uchar *to;
uint left_length;
LINT_INIT(to);
@@ -1434,7 +1435,7 @@ int _ma_read_dynamic_record(MARIA_HA *info, byte *buf,
prefetch_len= block_info.data_len;
if (prefetch_len)
{
- memcpy((byte*) to, block_info.header + offset, prefetch_len);
+ memcpy((uchar*) to, block_info.header + offset, prefetch_len);
block_info.data_len-= prefetch_len;
left_length-= prefetch_len;
to+= prefetch_len;
@@ -1452,7 +1453,7 @@ int _ma_read_dynamic_record(MARIA_HA *info, byte *buf,
there is no equivalent without seeking. We are at the right
position already. :(
*/
- if (info->s->file_read(info, (byte*) to, block_info.data_len,
+ if (info->s->file_read(info, (uchar*) to, block_info.data_len,
filepos, MYF(MY_NABP)))
goto panic;
left_length-=block_info.data_len;
@@ -1479,9 +1480,9 @@ err:
/* compare unique constraint between stored rows */
my_bool _ma_cmp_dynamic_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def,
- const byte *record, MARIA_RECORD_POS pos)
+ const uchar *record, MARIA_RECORD_POS pos)
{
- byte *old_rec_buff,*old_record;
+ uchar *old_rec_buff,*old_record;
my_off_t old_rec_buff_size;
my_bool error;
DBUG_ENTER("_ma_cmp_dynamic_unique");
@@ -1512,11 +1513,11 @@ my_bool _ma_cmp_dynamic_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def,
/* Compare of record on disk with packed record in memory */
my_bool _ma_cmp_dynamic_record(register MARIA_HA *info,
- register const byte *record)
+ register const uchar *record)
{
uint flag, reclength, b_type,cmp_length;
my_off_t filepos;
- byte *buffer;
+ uchar *buffer;
MARIA_BLOCK_INFO block_info;
my_bool error= 1;
DBUG_ENTER("_ma_cmp_dynamic_record");
@@ -1539,7 +1540,7 @@ my_bool _ma_cmp_dynamic_record(register MARIA_HA *info,
{ /* If check isn't disabled */
if (info->s->base.blobs)
{
- if (!(buffer=(byte*) my_alloca(info->s->base.pack_reclength+
+ if (!(buffer=(uchar*) my_alloca(info->s->base.pack_reclength+
_ma_calc_total_blob_length(info,record))))
DBUG_RETURN(1);
}
@@ -1592,7 +1593,7 @@ my_bool _ma_cmp_dynamic_record(register MARIA_HA *info,
error= 0;
err:
if (buffer != info->rec_buff)
- my_afree((gptr) buffer);
+ my_afree((uchar*) buffer);
DBUG_PRINT("exit", ("result: %d", error));
DBUG_RETURN(error);
}
@@ -1600,7 +1601,7 @@ err:
/* Compare file to buffert */
-static my_bool _ma_cmp_buffer(File file, const byte *buff, my_off_t filepos,
+static my_bool _ma_cmp_buffer(File file, const uchar *buff, my_off_t filepos,
uint length)
{
uint next_length;
@@ -1612,7 +1613,7 @@ static my_bool _ma_cmp_buffer(File file, const byte *buff, my_off_t filepos,
while (length > IO_SIZE*2)
{
if (my_pread(file,temp_buff,next_length,filepos, MYF(MY_NABP)) ||
- memcmp((byte*) buff,temp_buff,next_length))
+ memcmp((uchar*) buff,temp_buff,next_length))
goto err;
filepos+=next_length;
buff+=next_length;
@@ -1621,7 +1622,7 @@ static my_bool _ma_cmp_buffer(File file, const byte *buff, my_off_t filepos,
}
if (my_pread(file,temp_buff,length,filepos,MYF(MY_NABP)))
goto err;
- DBUG_RETURN(memcmp((byte*) buff,temp_buff,length) != 0);
+ DBUG_RETURN(memcmp((uchar*) buff,temp_buff,length) != 0);
err:
DBUG_RETURN(1);
}
@@ -1657,13 +1658,13 @@ err:
*/
int _ma_read_rnd_dynamic_record(MARIA_HA *info,
- byte *buf,
+ uchar *buf,
MARIA_RECORD_POS filepos,
my_bool skip_deleted_blocks)
{
int block_of_record, info_read, save_errno;
uint left_len,b_type;
- byte *to;
+ uchar *to;
MARIA_BLOCK_INFO block_info;
MARIA_SHARE *share=info->s;
DBUG_ENTER("_ma_read_rnd_dynamic_record");
@@ -1703,7 +1704,7 @@ int _ma_read_rnd_dynamic_record(MARIA_HA *info,
}
if (info->opt_flag & READ_CACHE_USED)
{
- if (_ma_read_cache(&info->rec_cache,(byte*) block_info.header,filepos,
+ if (_ma_read_cache(&info->rec_cache,(uchar*) block_info.header,filepos,
sizeof(block_info.header),
(!block_of_record && skip_deleted_blocks ?
READING_NEXT : 0) | READING_HEADER))
@@ -1766,7 +1767,7 @@ int _ma_read_rnd_dynamic_record(MARIA_HA *info,
tmp_length= block_info.data_len;
if (tmp_length)
{
- memcpy((byte*) to, block_info.header+offset,tmp_length);
+ memcpy((uchar*) to, block_info.header+offset,tmp_length);
block_info.data_len-=tmp_length;
left_len-=tmp_length;
to+=tmp_length;
@@ -1778,7 +1779,7 @@ int _ma_read_rnd_dynamic_record(MARIA_HA *info,
{
if (info->opt_flag & READ_CACHE_USED)
{
- if (_ma_read_cache(&info->rec_cache,(byte*) to,filepos,
+ if (_ma_read_cache(&info->rec_cache,(uchar*) to,filepos,
block_info.data_len,
(!block_of_record && skip_deleted_blocks) ?
READING_NEXT : 0))
@@ -1792,7 +1793,7 @@ int _ma_read_rnd_dynamic_record(MARIA_HA *info,
flush_io_cache(&info->rec_cache))
goto err;
/* VOID(my_seek(info->dfile.file, filepos, MY_SEEK_SET, MYF(0))); */
- if (my_read(info->dfile.file, (byte*)to, block_info.data_len,
+ if (my_read(info->dfile.file, (uchar*)to, block_info.data_len,
MYF(MY_NABP)))
{
if (my_errno == -1)
@@ -1850,7 +1851,7 @@ uint _ma_get_block_info(MARIA_BLOCK_INFO *info, File file, my_off_t filepos)
sizeof(info->header))
goto err;
}
- DBUG_DUMP("header",(byte*) header,MARIA_BLOCK_INFO_HEADER_LENGTH);
+ DBUG_DUMP("header",(uchar*) header,MARIA_BLOCK_INFO_HEADER_LENGTH);
if (info->second_read)
{
if (info->header[0] <= 6 || info->header[0] == 13)
diff --git a/storage/maria/ma_extra.c b/storage/maria/ma_extra.c
index 61eba165412..2fc4873d535 100644
--- a/storage/maria/ma_extra.c
+++ b/storage/maria/ma_extra.c
@@ -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;
diff --git a/storage/maria/ma_ft_boolean_search.c b/storage/maria/ma_ft_boolean_search.c
index 6e95262fe84..41661d1c288 100644
--- a/storage/maria/ma_ft_boolean_search.c
+++ b/storage/maria/ma_ft_boolean_search.c
@@ -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));
}
diff --git a/storage/maria/ma_ft_nlq_search.c b/storage/maria/ma_ft_nlq_search.c
index 145b7891dd1..cad5238d4a5 100644
--- a/storage/maria/ma_ft_nlq_search.c
+++ b/storage/maria/ma_ft_nlq_search.c
@@ -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));
}
diff --git a/storage/maria/ma_ft_parser.c b/storage/maria/ma_ft_parser.c
index f41b53bf3f7..2cbbb2dc5f7 100644
--- a/storage/maria/ma_ft_parser.c
+++ b/storage/maria/ma_ft_parser.c
@@ -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 @@ ret:
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)
{
diff --git a/storage/maria/ma_ft_update.c b/storage/maria/ma_ft_update.c
index 97ebdb05b42..f36147ccde2 100644
--- a/storage/maria/ma_ft_update.c
+++ b/storage/maria/ma_ft_update.c
@@ -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 @@ err:
/* 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);
diff --git a/storage/maria/ma_ftdefs.h b/storage/maria/ma_ftdefs.h
index e25687d54b9..5a7357e451c 100644
--- a/storage/maria/ma_ftdefs.h
+++ b/storage/maria/ma_ftdefs.h
@@ -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 *);
diff --git a/storage/maria/ma_fulltext.h b/storage/maria/ma_fulltext.h
index 778ffd49196..dc6cf9d1204 100644
--- a/storage/maria/ma_fulltext.h
+++ b/storage/maria/ma_fulltext.h
@@ -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 *);
diff --git a/storage/maria/ma_key.c b/storage/maria/ma_key.c
index 941d5d0665e..83ba6853330 100644
--- a/storage/maria/ma_key.c
+++ b/storage/maria/ma_key.c
@@ -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 @@ err:
/* 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:
diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c
index 9ed1d4b9d93..9364fe6a5c8 100644
--- a/storage/maria/ma_loghandler.c
+++ b/storage/maria/ma_loghandler.c
@@ -102,14 +102,14 @@ struct st_translog_buffer
/* lock for the buffer. Current buffer also lock the handler */
pthread_mutex_t mutex;
/* IO cache for current log */
- byte buffer[TRANSLOG_WRITE_BUFFER];
+ uchar buffer[TRANSLOG_WRITE_BUFFER];
};
struct st_buffer_cursor
{
/* pointer on the buffer */
- byte *ptr;
+ uchar *ptr;
/* current buffer */
struct st_translog_buffer *buffer;
/* current page fill */
@@ -172,7 +172,7 @@ struct st_translog_descriptor
static struct st_translog_descriptor log_descriptor;
/* Marker for end of log */
-static byte end_of_log= 0;
+static uchar end_of_log= 0;
my_bool translog_inited= 0;
@@ -207,7 +207,7 @@ typedef my_bool(*inwrite_rec_hook) (enum translog_record_type type,
typedef uint16(*read_rec_hook) (enum translog_record_type type,
uint16 read_length, uchar *read_buff,
- byte *decoded_buff);
+ uchar *decoded_buff);
/*
Descriptor of log record type
@@ -603,7 +603,7 @@ uchar NEAR maria_trans_file_magic[]=
static my_bool translog_write_file_header()
{
ulonglong timestamp;
- byte page_buff[TRANSLOG_PAGE_SIZE], *page= page_buff;
+ uchar page_buff[TRANSLOG_PAGE_SIZE], *page= page_buff;
DBUG_ENTER("translog_write_file_header");
/* file tag */
@@ -816,7 +816,7 @@ static my_bool translog_buffer_unlock(struct st_translog_buffer *buffer)
static void translog_new_page_header(TRANSLOG_ADDRESS *horizon,
struct st_buffer_cursor *cursor)
{
- byte *ptr;
+ uchar *ptr;
DBUG_ENTER("translog_new_page_header");
DBUG_ASSERT(cursor->ptr);
@@ -830,7 +830,7 @@ static void translog_new_page_header(TRANSLOG_ADDRESS *horizon,
/* File number */
int3store(ptr, LSN_FILE_NO(*horizon));
ptr+= 3;
- *(ptr++)= (byte) log_descriptor.flags;
+ *(ptr++)= (uchar) log_descriptor.flags;
if (log_descriptor.flags & TRANSLOG_PAGE_CRC)
{
#ifndef DBUG_OFF
@@ -880,10 +880,10 @@ static void translog_new_page_header(TRANSLOG_ADDRESS *horizon,
except the first sector that is protected by page header.
*/
-static void translog_put_sector_protection(byte *page,
+static void translog_put_sector_protection(uchar *page,
struct st_buffer_cursor *cursor)
{
- byte *table= page + log_descriptor.page_overhead -
+ uchar *table= page + log_descriptor.page_overhead -
(TRANSLOG_PAGE_SIZE / DISK_DRIVE_SECTOR_SIZE) * 2;
uint16 value= uint2korr(table) + cursor->write_counter;
uint16 last_protected_sector= ((cursor->previous_offset - 1) /
@@ -942,7 +942,7 @@ static void translog_put_sector_protection(byte *page,
CRC32
*/
-static uint32 translog_crc(byte *area, uint length)
+static uint32 translog_crc(uchar *area, uint length)
{
return crc32(0L, (unsigned char*) area, length);
}
@@ -961,7 +961,7 @@ static void translog_finish_page(TRANSLOG_ADDRESS *horizon,
struct st_buffer_cursor *cursor)
{
uint16 left= TRANSLOG_PAGE_SIZE - cursor->current_page_fill;
- byte *page= cursor->ptr -cursor->current_page_fill;
+ uchar *page= cursor->ptr -cursor->current_page_fill;
DBUG_ENTER("translog_finish_page");
DBUG_PRINT("enter", ("Buffer: #%u 0x%lx "
"Buffer addr: (%lu,0x%lx) "
@@ -1285,7 +1285,7 @@ static void translog_get_sent_to_file(LSN *lsn)
first chunk offset
*/
-static my_bool translog_get_first_chunk_offset(byte *page)
+static my_bool translog_get_first_chunk_offset(uchar *page)
{
uint16 page_header= 7;
DBUG_ENTER("translog_get_first_chunk_offset");
@@ -1309,7 +1309,7 @@ static my_bool translog_get_first_chunk_offset(byte *page)
*/
static void
-translog_write_variable_record_1group_code_len(byte *dst,
+translog_write_variable_record_1group_code_len(uchar *dst,
translog_size_t length,
uint16 header_len)
{
@@ -1350,7 +1350,7 @@ translog_write_variable_record_1group_code_len(byte *dst,
decoded length
*/
-static translog_size_t translog_variable_record_1group_decode_len(byte **src)
+static translog_size_t translog_variable_record_1group_decode_len(uchar **src)
{
uint8 first= (uint8) (**src);
switch (first) {
@@ -1386,7 +1386,7 @@ static translog_size_t translog_variable_record_1group_decode_len(byte **src)
total length of the chunk
*/
-static uint16 translog_get_total_chunk_length(byte *page, uint16 offset)
+static uint16 translog_get_total_chunk_length(uchar *page, uint16 offset)
{
DBUG_ENTER("translog_get_total_chunk_length");
switch (page[offset] & TRANSLOG_CHUNK_TYPE) {
@@ -1394,8 +1394,8 @@ static uint16 translog_get_total_chunk_length(byte *page, uint16 offset)
{
/* 0 chunk referred as LSN (head or tail) */
translog_size_t rec_len;
- byte *start= page + offset;
- byte *ptr= start + 1 + 2;
+ uchar *start= page + offset;
+ uchar *ptr= start + 1 + 2;
uint16 chunk_len, header_len, page_rest;
DBUG_PRINT("info", ("TRANSLOG_CHUNK_LSN"));
rec_len= translog_variable_record_1group_decode_len(&ptr);
@@ -1418,7 +1418,7 @@ static uint16 translog_get_total_chunk_length(byte *page, uint16 offset)
}
case TRANSLOG_CHUNK_FIXED:
{
- byte *ptr;
+ uchar *ptr;
uint type= page[offset] & TRANSLOG_REC_TYPE;
uint length;
int i;
@@ -1564,7 +1564,7 @@ static my_bool translog_buffer_flush(struct st_translog_buffer *buffer)
1 Error
*/
-static my_bool translog_recover_page_up_to_sector(byte *page, uint16 offset)
+static my_bool translog_recover_page_up_to_sector(uchar *page, uint16 offset)
{
uint16 chunk_offset= translog_get_first_chunk_offset(page), valid_chunk_end;
DBUG_ENTER("translog_recover_page_up_to_sector");
@@ -1630,11 +1630,11 @@ static my_bool translog_recover_page_up_to_sector(byte *page, uint16 offset)
0 OK
1 Error
*/
-static my_bool translog_page_validator(byte *page_addr, gptr data_ptr)
+static my_bool translog_page_validator(uchar *page_addr, uchar* data_ptr)
{
uint this_page_page_overhead;
uint flags;
- byte *page= (byte*) page_addr, *page_pos;
+ uchar *page= (uchar*) page_addr, *page_pos;
TRANSLOG_VALIDATOR_DATA *data= (TRANSLOG_VALIDATOR_DATA *) data_ptr;
TRANSLOG_ADDRESS addr= *(data->addr);
DBUG_ENTER("translog_page_validator");
@@ -1683,7 +1683,7 @@ static my_bool translog_page_validator(byte *page_addr, gptr data_ptr)
if (flags & TRANSLOG_SECTOR_PROTECTION)
{
uint i, offset;
- byte *table= page_pos;
+ uchar *table= page_pos;
uint16 current= uint2korr(table);
for (i= 2, offset= DISK_DRIVE_SECTOR_SIZE;
i < (TRANSLOG_PAGE_SIZE / DISK_DRIVE_SECTOR_SIZE) * 2;
@@ -1739,7 +1739,7 @@ static my_bool translog_page_validator(byte *page_addr, gptr data_ptr)
# pointer to the page cache which should be used to read this page
*/
-static byte *translog_get_page(TRANSLOG_VALIDATOR_DATA *data, byte *buffer)
+static uchar *translog_get_page(TRANSLOG_VALIDATOR_DATA *data, uchar *buffer)
{
TRANSLOG_ADDRESS addr= *(data->addr);
uint cache_index;
@@ -1766,13 +1766,13 @@ static byte *translog_get_page(TRANSLOG_VALIDATOR_DATA *data, byte *buffer)
}
file.file= log_descriptor.log_file_num[cache_index];
- buffer= (byte*)
+ buffer= (uchar*)
pagecache_valid_read(log_descriptor.pagecache, &file,
LSN_OFFSET(addr) / TRANSLOG_PAGE_SIZE,
3, (char*) buffer,
PAGECACHE_PLAIN_PAGE,
PAGECACHE_LOCK_LEFT_UNLOCKED, 0,
- &translog_page_validator, (gptr) data);
+ &translog_page_validator, (uchar*) data);
}
else
{
@@ -1790,7 +1790,7 @@ static byte *translog_get_page(TRANSLOG_VALIDATOR_DATA *data, byte *buffer)
if (my_pread(file, (char*) buffer, TRANSLOG_PAGE_SIZE,
LSN_OFFSET(addr), MYF(MY_FNABP | MY_WME)))
buffer= NULL;
- else if (translog_page_validator((byte*) buffer, (gptr) data))
+ else if (translog_page_validator((uchar*) buffer, (uchar*) data))
buffer= NULL;
my_close(file, MYF(MY_WME));
}
@@ -1879,7 +1879,7 @@ static uint translog_variable_record_length_bytes(translog_size_t length)
0 Error
*/
-static uint16 translog_get_chunk_header_length(byte *page, uint16 offset)
+static uint16 translog_get_chunk_header_length(uchar *page, uint16 offset)
{
DBUG_ENTER("translog_get_chunk_header_length");
page+= offset;
@@ -1888,8 +1888,8 @@ static uint16 translog_get_chunk_header_length(byte *page, uint16 offset)
{
/* 0 chunk referred as LSN (head or tail) */
translog_size_t rec_len;
- byte *start= page;
- byte *ptr= start + 1 + 2;
+ uchar *start= page;
+ uchar *ptr= start + 1 + 2;
uint16 chunk_len, header_len;
DBUG_PRINT("info", ("TRANSLOG_CHUNK_LSN"));
rec_len= translog_variable_record_1group_decode_len(&ptr);
@@ -2107,7 +2107,7 @@ my_bool translog_init(const char *directory,
do
{
TRANSLOG_VALIDATOR_DATA data;
- byte buffer[TRANSLOG_PAGE_SIZE], *page;
+ uchar buffer[TRANSLOG_PAGE_SIZE], *page;
data.addr= &current_page;
if ((page= translog_get_page(&data, buffer)) == NULL)
DBUG_RETURN(1);
@@ -2155,7 +2155,7 @@ my_bool translog_init(const char *directory,
if (logs_found && !old_log_was_recovered && old_flags == flags)
{
TRANSLOG_VALIDATOR_DATA data;
- byte buffer[TRANSLOG_PAGE_SIZE], *page;
+ uchar buffer[TRANSLOG_PAGE_SIZE], *page;
uint16 chunk_offset;
data.addr= &last_valid_page;
/* continue old log */
@@ -2169,7 +2169,7 @@ my_bool translog_init(const char *directory,
log_descriptor.horizon= last_valid_page;
translog_start_buffer(log_descriptor.buffers, &log_descriptor.bc, 0);
/*
- Free space if filled with 0 and first byte of
+ Free space if filled with 0 and first uchar of
real chunk can't be 0
*/
while (chunk_offset < TRANSLOG_PAGE_SIZE && page[chunk_offset] != '\0')
@@ -2329,7 +2329,7 @@ void translog_destroy()
pthread_mutex_destroy(&log_descriptor.sent_to_file_lock);
my_close(log_descriptor.directory_fd, MYF(MY_WME));
my_atomic_rwlock_destroy(&LOCK_id_to_share);
- my_free((gptr)(id_to_share + 1), MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*)(id_to_share + 1), MYF(MY_ALLOW_ZERO_PTR));
translog_inited= 0;
}
DBUG_VOID_RETURN;
@@ -2481,7 +2481,7 @@ static my_bool translog_page_next(TRANSLOG_ADDRESS *horizon,
static my_bool translog_write_data_on_page(TRANSLOG_ADDRESS *horizon,
struct st_buffer_cursor *cursor,
translog_size_t length,
- byte *buffer)
+ uchar *buffer)
{
DBUG_ENTER("translog_write_data_on_page");
DBUG_PRINT("enter", ("Chunk length: %lu Page size %u",
@@ -2547,11 +2547,11 @@ static my_bool translog_write_parts_on_page(TRANSLOG_ADDRESS *horizon,
{
translog_size_t len;
LEX_STRING *part;
- byte *buff;
+ uchar *buff;
DBUG_ASSERT(cur < parts->elements);
part= parts->parts + cur;
- buff= (byte*) part->str;
+ buff= (uchar*) part->str;
DBUG_PRINT("info", ("Part: %u Length: %lu left: %lu buff: 0x%lx",
(uint) (cur + 1), (ulong) part->length, (ulong) left,
(ulong) buff));
@@ -2623,7 +2623,7 @@ translog_write_variable_record_1group_header(struct st_translog_parts *parts,
enum translog_record_type type,
SHORT_TRANSACTION_ID short_trid,
uint16 header_length,
- byte *chunk0_header)
+ uchar *chunk0_header)
{
LEX_STRING *part;
DBUG_ASSERT(parts->current != 0); /* first part is left for header */
@@ -2631,7 +2631,7 @@ translog_write_variable_record_1group_header(struct st_translog_parts *parts,
parts->total_record_length+= (part->length= header_length);
part->str= (char*)chunk0_header;
/* puts chunk type */
- *chunk0_header= (byte) (type | TRANSLOG_CHUNK_LSN);
+ *chunk0_header= (uchar) (type | TRANSLOG_CHUNK_LSN);
int2store(chunk0_header + 1, short_trid);
/* puts record length */
translog_write_variable_record_1group_code_len(chunk0_header + 3,
@@ -2706,7 +2706,7 @@ translog_write_variable_record_chunk2_page(struct st_translog_parts *parts,
{
struct st_translog_buffer *buffer_to_flush;
int rc;
- byte chunk2_header[1];
+ uchar chunk2_header[1];
DBUG_ENTER("translog_write_variable_record_chunk2_page");
chunk2_header[0]= TRANSLOG_CHUNK_NOHDR;
@@ -2756,7 +2756,7 @@ translog_write_variable_record_chunk3_page(struct st_translog_parts *parts,
struct st_translog_buffer *buffer_to_flush;
LEX_STRING *part;
int rc;
- byte chunk3_header[1 + 2];
+ uchar chunk3_header[1 + 2];
DBUG_ENTER("translog_write_variable_record_chunk3_page");
LINT_INIT(buffer_to_flush);
@@ -2783,7 +2783,7 @@ translog_write_variable_record_chunk3_page(struct st_translog_parts *parts,
parts->total_record_length+= (part->length= 1 + 2);
part->str= (char*)chunk3_header;
/* Puts chunk type */
- *chunk3_header= (byte) (TRANSLOG_CHUNK_LNGTH);
+ *chunk3_header= (uchar) (TRANSLOG_CHUNK_LNGTH);
/* Puts chunk length */
int2store(chunk3_header + 1, length);
@@ -3027,7 +3027,7 @@ translog_write_variable_record_1group(LSN *lsn,
uint i;
translog_size_t record_rest, full_pages, first_page;
uint additional_chunk3_page= 0;
- byte chunk0_header[1 + 2 + 5 + 2];
+ uchar chunk0_header[1 + 2 + 5 + 2];
DBUG_ENTER("translog_write_variable_record_1group");
*lsn= horizon= log_descriptor.horizon;
@@ -3176,7 +3176,7 @@ translog_write_variable_record_1chunk(LSN *lsn,
TRN *trn)
{
int rc;
- byte chunk0_header[1 + 2 + 5 + 2];
+ uchar chunk0_header[1 + 2 + 5 + 2];
DBUG_ENTER("translog_write_variable_record_1chunk");
translog_write_variable_record_1group_header(parts, type, short_trid,
@@ -3239,7 +3239,7 @@ translog_write_variable_record_1chunk(LSN *lsn,
NULL Error
*/
-static byte *translog_put_LSN_diff(LSN base_lsn, LSN lsn, byte *dst)
+static uchar *translog_put_LSN_diff(LSN base_lsn, LSN lsn, uchar *dst)
{
DBUG_ENTER("translog_put_LSN_diff");
DBUG_PRINT("enter", ("Base: (0x%lu,0x%lx) val: (0x%lu,0x%lx) dst: 0x%lx",
@@ -3257,7 +3257,7 @@ static byte *translog_put_LSN_diff(LSN base_lsn, LSN lsn, byte *dst)
{
dst-= 2;
/*
- Note we store this high byte first to ensure that first byte has
+ Note we store this high uchar first to ensure that first uchar has
0 in the 3 upper bits.
*/
dst[0]= diff >> 8;
@@ -3347,7 +3347,7 @@ static byte *translog_put_LSN_diff(LSN base_lsn, LSN lsn, byte *dst)
pointer to buffer after decoded LSN
*/
-static byte *translog_get_LSN_from_diff(LSN base_lsn, byte *src, byte *dst)
+static uchar *translog_get_LSN_from_diff(LSN base_lsn, uchar *src, uchar *dst)
{
LSN lsn;
uint32 diff;
@@ -3432,7 +3432,7 @@ static byte *translog_get_LSN_from_diff(LSN base_lsn, byte *src, byte *dst)
static my_bool translog_relative_LSN_encode(struct st_translog_parts *parts,
LSN base_lsn,
- uint lsns, byte *compressed_LSNs)
+ uint lsns, uchar *compressed_LSNs)
{
LEX_STRING *part;
uint lsns_len= lsns * LSN_STORE_SIZE;
@@ -3450,14 +3450,14 @@ static my_bool translog_relative_LSN_encode(struct st_translog_parts *parts,
uint copied= part->length;
LEX_STRING *next_part;
DBUG_PRINT("info", ("Using buffer: 0x%lx", (ulong) compressed_LSNs));
- memcpy(buffer, (byte*)part->str, part->length);
+ memcpy(buffer, (uchar*)part->str, part->length);
next_part= parts->parts + parts->current + 1;
do
{
DBUG_ASSERT(next_part < parts->parts + parts->elements);
if ((next_part->length + copied) < lsns_len)
{
- memcpy(buffer + copied, (byte*)next_part->str,
+ memcpy(buffer + copied, (uchar*)next_part->str,
next_part->length);
copied+= next_part->length;
next_part->length= 0; next_part->str= 0;
@@ -3469,7 +3469,7 @@ static my_bool translog_relative_LSN_encode(struct st_translog_parts *parts,
else
{
uint len= lsns_len - copied;
- memcpy(buffer + copied, (byte*)next_part->str, len);
+ memcpy(buffer + copied, (uchar*)next_part->str, len);
copied= lsns_len;
next_part->str+= len;
next_part->length-= len;
@@ -3489,8 +3489,8 @@ static my_bool translog_relative_LSN_encode(struct st_translog_parts *parts,
/* Compress */
LSN ref;
int economy;
- byte *src_ptr;
- byte *dst_ptr= compressed_LSNs + (MAX_NUMBER_OF_LSNS_PER_RECORD *
+ uchar *src_ptr;
+ uchar *dst_ptr= compressed_LSNs + (MAX_NUMBER_OF_LSNS_PER_RECORD *
COMPRESSED_LSN_MAX_STORE_SIZE);
for (src_ptr= buffer + lsns_len - LSN_STORE_SIZE;
src_ptr >= buffer;
@@ -3558,8 +3558,8 @@ translog_write_variable_record_mgroup(LSN *lsn,
uint16 page_capacity= log_descriptor.page_capacity_chunk_2 + 1;
uint16 last_page_capacity;
my_bool new_page_before_chunk0= 1, first_chunk0= 1;
- byte chunk0_header[1 + 2 + 5 + 2 + 2], group_desc[7 + 1];
- byte chunk2_header[1];
+ uchar chunk0_header[1 + 2 + 5 + 2 + 2], group_desc[7 + 1];
+ uchar chunk2_header[1];
uint header_fixed_part= header_length + 2;
uint groups_per_page= (page_capacity - header_fixed_part) / (7 + 1);
DBUG_ENTER("translog_write_variable_record_mgroup");
@@ -3602,7 +3602,7 @@ translog_write_variable_record_mgroup(LSN *lsn,
But here we assign number of chunks - 1
*/
group.num= full_pages;
- if (insert_dynamic(&groups, (gptr) &group))
+ if (insert_dynamic(&groups, (uchar*) &group))
{
UNRECOVERABLE_ERROR(("insert into array failed"));
goto err_unlock;
@@ -3701,7 +3701,7 @@ translog_write_variable_record_mgroup(LSN *lsn,
cursor= log_descriptor.bc;
cursor.chaser= 1;
group.num= 0; /* 0 because it does not matter */
- if (insert_dynamic(&groups, (gptr) &group))
+ if (insert_dynamic(&groups, (uchar*) &group))
{
UNRECOVERABLE_ERROR(("insert into array failed"));
goto err_unlock;
@@ -3797,7 +3797,7 @@ translog_write_variable_record_mgroup(LSN *lsn,
{
DBUG_PRINT("info", ("chunk 3"));
DBUG_ASSERT(full_pages == 0);
- byte chunk3_header[3];
+ uchar chunk3_header[3];
chunk3_pages= 0;
chunk3_header[0]= TRANSLOG_CHUNK_LNGTH;
int2store(chunk3_header + 1, chunk3_size);
@@ -3846,7 +3846,7 @@ translog_write_variable_record_mgroup(LSN *lsn,
(ulong) LSN_OFFSET(horizon)));
- *chunk0_header= (byte) (type |TRANSLOG_CHUNK_LSN);
+ *chunk0_header= (uchar) (type |TRANSLOG_CHUNK_LSN);
int2store(chunk0_header + 1, short_trid);
translog_write_variable_record_1group_code_len(chunk0_header + 3,
parts->record_length,
@@ -3975,7 +3975,7 @@ static my_bool translog_write_variable_record(LSN *lsn,
ulong buffer_rest;
uint page_rest;
/* Max number of such LSNs per record is 2 */
- byte compressed_LSNs[MAX_NUMBER_OF_LSNS_PER_RECORD *
+ uchar compressed_LSNs[MAX_NUMBER_OF_LSNS_PER_RECORD *
COMPRESSED_LSN_MAX_STORE_SIZE];
DBUG_ENTER("translog_write_variable_record");
@@ -4001,7 +4001,7 @@ static my_bool translog_write_variable_record(LSN *lsn,
log_record_type_descriptor[type].read_header_len));
translog_page_next(&log_descriptor.horizon, &log_descriptor.bc,
&buffer_to_flush);
- /* Chunk 2 header is 1 byte, so full page capacity will be one byte more */
+ /* Chunk 2 header is 1 byte, so full page capacity will be one uchar more */
page_rest= log_descriptor.page_capacity_chunk_2 + 1;
DBUG_PRINT("info", ("page_rest: %u", page_rest));
}
@@ -4087,9 +4087,9 @@ static my_bool translog_write_fixed_record(LSN *lsn,
TRN *trn)
{
struct st_translog_buffer *buffer_to_flush= NULL;
- byte chunk1_header[1 + 2];
+ uchar chunk1_header[1 + 2];
/* Max number of such LSNs per record is 2 */
- byte compressed_LSNs[MAX_NUMBER_OF_LSNS_PER_RECORD *
+ uchar compressed_LSNs[MAX_NUMBER_OF_LSNS_PER_RECORD *
COMPRESSED_LSN_MAX_STORE_SIZE];
LEX_STRING *part;
int rc;
@@ -4162,7 +4162,7 @@ static my_bool translog_write_fixed_record(LSN *lsn,
part= parts->parts + (--parts->current);
parts->total_record_length+= (part->length= 1 + 2);
part->str= (char*)chunk1_header;
- *chunk1_header= (byte) (type | TRANSLOG_CHUNK_FIXED);
+ *chunk1_header= (uchar) (type | TRANSLOG_CHUNK_FIXED);
int2store(chunk1_header + 1, short_trid);
rc= translog_write_parts_on_page(&log_descriptor.horizon,
@@ -4364,8 +4364,8 @@ my_bool translog_write_record(LSN *lsn,
position in sources after decoded LSN(s)
*/
-static byte *translog_relative_LSN_decode(LSN base_lsn,
- byte *src, byte *dst, uint lsns)
+static uchar *translog_relative_LSN_decode(LSN base_lsn,
+ uchar *src, uchar *dst, uint lsns)
{
uint i;
for (i= 0; i < lsns; i++, dst+= LSN_STORE_SIZE)
@@ -4391,15 +4391,15 @@ static byte *translog_relative_LSN_decode(LSN base_lsn,
part of the header
*/
-translog_size_t translog_fixed_length_header(byte *page,
+translog_size_t translog_fixed_length_header(uchar *page,
translog_size_t page_offset,
TRANSLOG_HEADER_BUFFER *buff)
{
struct st_log_record_type_descriptor *desc=
log_record_type_descriptor + buff->type;
- byte *src= page + page_offset + 3;
- byte *dst= buff->header;
- byte *start= src;
+ uchar *src= page + page_offset + 3;
+ uchar *dst= buff->header;
+ uchar *start= src;
uint lsns= desc->compressed_LSN;
uint length= desc->fixed_length;
@@ -4439,7 +4439,7 @@ void translog_free_record_header(TRANSLOG_HEADER_BUFFER *buff)
DBUG_ENTER("translog_free_record_header");
if (buff->groups_no != 0)
{
- my_free((gptr) buff->groups, MYF(0));
+ my_free((uchar*) buff->groups, MYF(0));
buff->groups_no= 0;
}
DBUG_VOID_RETURN;
@@ -4719,7 +4719,7 @@ translog_get_next_chunk(TRANSLOG_SCANNER_DATA *scanner)
part of the header
*/
-translog_size_t translog_variable_length_header(byte *page,
+translog_size_t translog_variable_length_header(uchar *page,
translog_size_t page_offset,
TRANSLOG_HEADER_BUFFER *buff,
TRANSLOG_SCANNER_DATA
@@ -4727,8 +4727,8 @@ translog_size_t translog_variable_length_header(byte *page,
{
struct st_log_record_type_descriptor *desc= (log_record_type_descriptor +
buff->type);
- byte *src= page + page_offset + 1 + 2;
- byte *dst= buff->header;
+ uchar *src= page + page_offset + 1 + 2;
+ uchar *dst= buff->header;
LSN base_lsn;
uint lsns= desc->compressed_LSN;
uint16 chunk_len;
@@ -4848,7 +4848,7 @@ translog_size_t translog_variable_length_header(byte *page,
}
if (lsns)
{
- byte *start= src;
+ uchar *start= src;
src= translog_relative_LSN_decode(base_lsn, src, dst, lsns);
lsns*= LSN_STORE_SIZE;
dst+= lsns;
@@ -4890,7 +4890,7 @@ translog_size_t translog_variable_length_header(byte *page,
*/
translog_size_t
-translog_read_record_header_from_buffer(byte *page,
+translog_read_record_header_from_buffer(uchar *page,
uint16 page_offset,
TRANSLOG_HEADER_BUFFER *buff,
TRANSLOG_SCANNER_DATA *scanner)
@@ -4946,7 +4946,7 @@ translog_read_record_header_from_buffer(byte *page,
translog_size_t translog_read_record_header(LSN lsn,
TRANSLOG_HEADER_BUFFER *buff)
{
- byte buffer[TRANSLOG_PAGE_SIZE], *page;
+ uchar buffer[TRANSLOG_PAGE_SIZE], *page;
translog_size_t page_offset= LSN_OFFSET(lsn) % TRANSLOG_PAGE_SIZE;
TRANSLOG_ADDRESS addr;
TRANSLOG_VALIDATOR_DATA data;
@@ -5232,7 +5232,7 @@ static my_bool translog_init_reader_data(LSN lsn,
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)
{
translog_size_t requested_length= length;
@@ -5331,7 +5331,7 @@ static void translog_force_current_buffer_to_finish()
struct st_translog_buffer *new_buffer= (log_descriptor.buffers +
new_buffer_no);
struct st_translog_buffer *old_buffer= log_descriptor.bc.buffer;
- byte *data= log_descriptor.bc.ptr -log_descriptor.bc.current_page_fill;
+ uchar *data= log_descriptor.bc.ptr -log_descriptor.bc.current_page_fill;
uint16 left= TRANSLOG_PAGE_SIZE - log_descriptor.bc.current_page_fill;
uint16 current_page_fill, write_counter, previous_offset;
DBUG_ENTER("translog_force_current_buffer_to_finish");
diff --git a/storage/maria/ma_loghandler.h b/storage/maria/ma_loghandler.h
index 0a160a9bc53..a831f088e9b 100644
--- a/storage/maria/ma_loghandler.h
+++ b/storage/maria/ma_loghandler.h
@@ -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);
diff --git a/storage/maria/ma_loghandler_lsn.h b/storage/maria/ma_loghandler_lsn.h
index c641337e8ba..0c02fe2c489 100644
--- a/storage/maria/ma_loghandler_lsn.h
+++ b/storage/maria/ma_loghandler_lsn.h
@@ -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;
diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c
index 4e72adf3b7e..15f8dcf4e51 100644
--- a/storage/maria/ma_open.c
+++ b/storage/maria/ma_open.c
@@ -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 @@ err:
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 @@ err:
(*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 @@ err:
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 */
}
/***************************************************************************
diff --git a/storage/maria/ma_packrec.c b/storage/maria/ma_packrec.c
index f3187314f0e..5d54e42ac4f 100644
--- a/storage/maria/ma_packrec.c
+++ b/storage/maria/ma_packrec.c
@@ -44,14 +44,14 @@
{ bits-=(bit+1); break; } \
pos+= *pos
-/* Size in uint16 of a Huffman tree for byte compression of 256 byte values. */
+/* Size in uint16 of a Huffman tree for uchar compression of 256 uchar values. */
#define OFFSET_TABLE_SIZE 512
static my_bool _ma_read_pack_info(MARIA_SHARE *share, File file,
pbool fix_keys);
static uint read_huff_table(MARIA_BIT_BUFF *bit_buff,
MARIA_DECODE_TREE *decode_tree,
- uint16 **decode_table,byte **intervall_buff,
+ uint16 **decode_table,uchar **intervall_buff,
uint16 *tmp_buff);
static void make_quick_table(uint16 *to_table,uint16 *decode_table,
uint *next_free,uint value,uint bits,
@@ -63,49 +63,49 @@ static uint copy_decode_table(uint16 *to_pos,uint offset,
static uint find_longest_bitstream(uint16 *table, uint16 *end);
static void (*get_unpack_function(MARIA_COLUMNDEF *rec))(MARIA_COLUMNDEF *field,
MARIA_BIT_BUFF *buff,
- byte *to,
- byte *end);
+ uchar *to,
+ uchar *end);
static void uf_zerofill_skip_zero(MARIA_COLUMNDEF *rec,
MARIA_BIT_BUFF *bit_buff,
- byte *to,byte *end);
+ uchar *to,uchar *end);
static void uf_skip_zero(MARIA_COLUMNDEF *rec,MARIA_BIT_BUFF *bit_buff,
- byte *to,byte *end);
+ uchar *to,uchar *end);
static void uf_space_normal(MARIA_COLUMNDEF *rec,MARIA_BIT_BUFF *bit_buff,
- byte *to,byte *end);
+ uchar *to,uchar *end);
static void uf_space_endspace_selected(MARIA_COLUMNDEF *rec,
MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end);
+ uchar *to, uchar *end);
static void uf_endspace_selected(MARIA_COLUMNDEF *rec,MARIA_BIT_BUFF *bit_buff,
- byte *to,byte *end);
+ uchar *to,uchar *end);
static void uf_space_endspace(MARIA_COLUMNDEF *rec,MARIA_BIT_BUFF *bit_buff,
- byte *to,byte *end);
+ uchar *to,uchar *end);
static void uf_endspace(MARIA_COLUMNDEF *rec,MARIA_BIT_BUFF *bit_buff,
- byte *to,byte *end);
+ uchar *to,uchar *end);
static void uf_space_prespace_selected(MARIA_COLUMNDEF *rec,
MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end);
+ uchar *to, uchar *end);
static void uf_prespace_selected(MARIA_COLUMNDEF *rec,MARIA_BIT_BUFF *bit_buff,
- byte *to,byte *end);
+ uchar *to,uchar *end);
static void uf_space_prespace(MARIA_COLUMNDEF *rec,MARIA_BIT_BUFF *bit_buff,
- byte *to,byte *end);
+ uchar *to,uchar *end);
static void uf_prespace(MARIA_COLUMNDEF *rec,MARIA_BIT_BUFF *bit_buff,
- byte *to,byte *end);
+ uchar *to,uchar *end);
static void uf_zerofill_normal(MARIA_COLUMNDEF *rec,MARIA_BIT_BUFF *bit_buff,
- byte *to,byte *end);
+ uchar *to,uchar *end);
static void uf_constant(MARIA_COLUMNDEF *rec,MARIA_BIT_BUFF *bit_buff,
- byte *to,byte *end);
+ uchar *to,uchar *end);
static void uf_intervall(MARIA_COLUMNDEF *rec,MARIA_BIT_BUFF *bit_buff,
- byte *to,byte *end);
+ uchar *to,uchar *end);
static void uf_zero(MARIA_COLUMNDEF *rec,MARIA_BIT_BUFF *bit_buff,
- byte *to,byte *end);
+ uchar *to,uchar *end);
static void uf_blob(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end);
+ uchar *to, uchar *end);
static void uf_varchar1(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end);
+ uchar *to, uchar *end);
static void uf_varchar2(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end);
+ uchar *to, uchar *end);
static void decode_bytes(MARIA_COLUMNDEF *rec,MARIA_BIT_BUFF *bit_buff,
- byte *to,byte *end);
+ uchar *to,uchar *end);
static uint decode_pos(MARIA_BIT_BUFF *bit_buff,
MARIA_DECODE_TREE *decode_tree);
static void init_bit_buffer(MARIA_BIT_BUFF *bit_buff,uchar *buffer,
@@ -118,8 +118,8 @@ static uint read_pack_length(uint version, const uchar *buf, ulong *length);
static uchar *_ma_mempack_get_block_info(MARIA_HA *maria,
MARIA_BIT_BUFF *bit_buff,
MARIA_BLOCK_INFO *info,
- byte **rec_buff_p,
- my_size_t *rec_buff_size_p,
+ uchar **rec_buff_p,
+ size_t *rec_buff_size_p,
uchar *header);
#endif
@@ -154,8 +154,8 @@ my_bool _ma_once_end_pack_row(MARIA_SHARE *share)
{
if (share->decode_trees)
{
- my_free((gptr) share->decode_trees,MYF(0));
- my_free((gptr) share->decode_tables,MYF(0));
+ my_free((uchar*) share->decode_trees,MYF(0));
+ my_free((uchar*) share->decode_tables,MYF(0));
}
return 0;
}
@@ -181,19 +181,19 @@ static my_bool _ma_read_pack_info(MARIA_SHARE *share, File file,
maria_quick_table_bits=MAX_QUICK_TABLE_BITS;
my_errno=0;
- if (my_read(file,(byte*) header,sizeof(header),MYF(MY_NABP)))
+ if (my_read(file,(uchar*) header,sizeof(header),MYF(MY_NABP)))
{
if (!my_errno)
my_errno=HA_ERR_END_OF_FILE;
goto err0;
}
/* Only the first three bytes of magic number are independent of version. */
- if (memcmp((byte*) header, (byte*) maria_pack_file_magic, 3))
+ if (memcmp((uchar*) header, (uchar*) maria_pack_file_magic, 3))
{
my_errno=HA_ERR_WRONG_IN_RECORD;
goto err0;
}
- share->pack.version= header[3]; /* fourth byte of magic number */
+ share->pack.version= header[3]; /* fourth uchar of magic number */
share->pack.header_length= uint4korr(header+4);
share->min_pack_length=(uint) uint4korr(header+8);
share->max_pack_length=(uint) uint4korr(header+12);
@@ -228,10 +228,10 @@ static my_bool _ma_read_pack_info(MARIA_SHARE *share, File file,
*/
if (!(share->decode_trees=(MARIA_DECODE_TREE*)
my_malloc((uint) (trees*sizeof(MARIA_DECODE_TREE)+
- intervall_length*sizeof(byte)),
+ intervall_length*sizeof(uchar)),
MYF(MY_WME))))
goto err0;
- intervall_buff=(byte*) (share->decode_trees+trees);
+ intervall_buff=(uchar*) (share->decode_trees+trees);
/*
Memory segment #2:
@@ -248,7 +248,7 @@ static my_bool _ma_read_pack_info(MARIA_SHARE *share, File file,
MYF(MY_WME | MY_ZEROFILL))))
goto err1;
tmp_buff=share->decode_tables+length;
- disk_cache=(byte*) (tmp_buff+OFFSET_TABLE_SIZE);
+ disk_cache=(uchar*) (tmp_buff+OFFSET_TABLE_SIZE);
if (my_read(file,disk_cache,
(uint) (share->pack.header_length-sizeof(header)),
@@ -284,8 +284,8 @@ static my_bool _ma_read_pack_info(MARIA_SHARE *share, File file,
goto err3;
/* Reallocate the decoding tables to the used size. */
decode_table=(uint16*)
- my_realloc((gptr) share->decode_tables,
- (uint) ((byte*) decode_table - (byte*) share->decode_tables),
+ my_realloc((uchar*) share->decode_tables,
+ (uint) ((uchar*) decode_table - (uchar*) share->decode_tables),
MYF(MY_HOLD_ON_ERROR));
/* Fix the table addresses in the tree heads. */
{
@@ -325,9 +325,9 @@ static my_bool _ma_read_pack_info(MARIA_SHARE *share, File file,
err3:
my_errno=HA_ERR_WRONG_IN_RECORD;
err2:
- my_free((gptr) share->decode_tables,MYF(0));
+ my_free((uchar*) share->decode_tables,MYF(0));
err1:
- my_free((gptr) share->decode_trees,MYF(0));
+ my_free((uchar*) share->decode_trees,MYF(0));
err0:
DBUG_RETURN(1);
}
@@ -352,7 +352,7 @@ err0:
*/
static uint read_huff_table(MARIA_BIT_BUFF *bit_buff,
MARIA_DECODE_TREE *decode_tree,
- uint16 **decode_table, byte **intervall_buff,
+ uint16 **decode_table, uchar **intervall_buff,
uint16 *tmp_buff)
{
uint min_chr,elements,char_bits,offset_bits,size,intervall_length,table_bits,
@@ -371,7 +371,7 @@ static uint read_huff_table(MARIA_BIT_BUFF *bit_buff,
ptr=tmp_buff;
ptr=tmp_buff;
DBUG_PRINT("info", ("byte value compression"));
- DBUG_PRINT("info", ("minimum byte value: %u", min_chr));
+ DBUG_PRINT("info", ("minimum uchar value: %u", min_chr));
DBUG_PRINT("info", ("number of tree nodes: %u", elements));
DBUG_PRINT("info", ("bits for values: %u", char_bits));
DBUG_PRINT("info", ("bits for tree offsets: %u", offset_bits));
@@ -477,13 +477,13 @@ static uint read_huff_table(MARIA_BIT_BUFF *bit_buff,
In most cases table_bits is 9. So there are 512 16-bit values.
If the high-order bit (16) is set (IS_CHAR) then the array slot for
- this value is a valid Huffman code for a resulting byte value.
+ this value is a valid Huffman code for a resulting uchar value.
- The low-order 8 bits (1..8) are the resulting byte value.
+ The low-order 8 bits (1..8) are the resulting uchar value.
- Bits 9..14 are the length of the Huffman code for this byte value.
+ Bits 9..14 are the length of the Huffman code for this uchar value.
This means so many bits from the input stream were needed to
- represent this byte value. The remaining bits belong to later
+ represent this uchar value. The remaining bits belong to later
Huffman codes. This also means that for every Huffman code shorter
than table_bits there are multiple entires in the array, which
differ just in the unused bits.
@@ -570,7 +570,7 @@ static void make_quick_table(uint16 *to_table, uint16 *decode_table,
table Target quick_table position.
bits Unused bits from max_bits.
max_bits Total number of bits to collect (table_bits).
- value The byte encoded by the found Huffman code.
+ value The uchar encoded by the found Huffman code.
DESCRIPTION
@@ -593,8 +593,8 @@ static void fill_quick_table(uint16 *table, uint bits, uint max_bits,
DBUG_ENTER("fill_quick_table");
/*
- Bits 1..8 of value represent the decoded byte value.
- Bits 9..14 become the length of the Huffman code for this byte value.
+ Bits 1..8 of value represent the decoded uchar value.
+ Bits 9..14 become the length of the Huffman code for this uchar value.
Bit 16 flags a valid code (IS_CHAR).
*/
value|= (max_bits - bits) << 8 | IS_CHAR;
@@ -639,7 +639,7 @@ static uint copy_decode_table(uint16 *to_pos, uint offset,
}
else
{
- /* Copy the byte value. */
+ /* Copy the uchar value. */
to_pos[offset]= *decode_table;
/* Step behind this node. */
offset+=2;
@@ -656,7 +656,7 @@ static uint copy_decode_table(uint16 *to_pos, uint offset,
}
else
{
- /* Copy the byte value. */
+ /* Copy the uchar value. */
to_pos[prev_offset+1]= *decode_table;
}
DBUG_RETURN(offset);
@@ -674,7 +674,7 @@ static uint copy_decode_table(uint16 *to_pos, uint offset,
IMPLEMENTATION
Recursively follow the branch(es) of the code pair on every level of
- the tree until two byte values (and no branch) are found. Add one to
+ the tree until two uchar values (and no branch) are found. Add one to
each level when returning back from each recursion stage.
'end' is used for error checking only. A clean tree terminates
@@ -731,7 +731,7 @@ static uint find_longest_bitstream(uint16 *table, uint16 *end)
HA_ERR_WRONG_IN_RECORD or -1 on error
*/
-int _ma_read_pack_record(MARIA_HA *info, byte *buf, MARIA_RECORD_POS filepos)
+int _ma_read_pack_record(MARIA_HA *info, uchar *buf, MARIA_RECORD_POS filepos)
{
MARIA_BLOCK_INFO block_info;
File file;
@@ -745,7 +745,7 @@ int _ma_read_pack_record(MARIA_HA *info, byte *buf, MARIA_RECORD_POS filepos)
&info->rec_buff, &info->rec_buff_size, file,
filepos))
goto err;
- if (my_read(file,(byte*) info->rec_buff + block_info.offset ,
+ if (my_read(file,(uchar*) info->rec_buff + block_info.offset ,
block_info.rec_len - block_info.offset, MYF(MY_NABP)))
goto panic;
info->update|= HA_STATE_AKTIV;
@@ -760,9 +760,9 @@ err:
int _ma_pack_rec_unpack(register MARIA_HA *info, MARIA_BIT_BUFF *bit_buff,
- register byte *to, byte *from, ulong reclength)
+ register uchar *to, uchar *from, ulong reclength)
{
- byte *end_field;
+ uchar *end_field;
reg3 MARIA_COLUMNDEF *end;
MARIA_COLUMNDEF *current_field;
MARIA_SHARE *share=info->s;
@@ -794,7 +794,7 @@ int _ma_pack_rec_unpack(register MARIA_HA *info, MARIA_BIT_BUFF *bit_buff,
/* Return function to unpack field */
static void (*get_unpack_function(MARIA_COLUMNDEF *rec))
- (MARIA_COLUMNDEF *, MARIA_BIT_BUFF *, byte *, byte *)
+ (MARIA_COLUMNDEF *, MARIA_BIT_BUFF *, uchar *, uchar *)
{
switch (rec->base_type) {
case FIELD_SKIP_ZERO:
@@ -837,7 +837,7 @@ static void (*get_unpack_function(MARIA_COLUMNDEF *rec))
case FIELD_BLOB:
return &uf_blob;
case FIELD_VARCHAR:
- if (rec->length <= 256) /* 255 + 1 byte length */
+ if (rec->length <= 256) /* 255 + 1 uchar length */
return &uf_varchar1;
return &uf_varchar2;
case FIELD_LAST:
@@ -850,7 +850,7 @@ static void (*get_unpack_function(MARIA_COLUMNDEF *rec))
static void uf_zerofill_skip_zero(MARIA_COLUMNDEF *rec,
MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end)
+ uchar *to, uchar *end)
{
if (get_bit(bit_buff))
bzero((char*) to,(uint) (end-to));
@@ -863,7 +863,7 @@ static void uf_zerofill_skip_zero(MARIA_COLUMNDEF *rec,
}
static void uf_skip_zero(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end)
+ uchar *to, uchar *end)
{
if (get_bit(bit_buff))
bzero((char*) to,(uint) (end-to));
@@ -872,21 +872,21 @@ static void uf_skip_zero(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
}
static void uf_space_normal(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end)
+ uchar *to, uchar *end)
{
if (get_bit(bit_buff))
- bfill((byte*) to,(end-to),' ');
+ bfill((uchar*) to,(end-to),' ');
else
decode_bytes(rec,bit_buff,to,end);
}
static void uf_space_endspace_selected(MARIA_COLUMNDEF *rec,
MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end)
+ uchar *to, uchar *end)
{
uint spaces;
if (get_bit(bit_buff))
- bfill((byte*) to,(end-to),' ');
+ bfill((uchar*) to,(end-to),' ');
else
{
if (get_bit(bit_buff))
@@ -898,7 +898,7 @@ static void uf_space_endspace_selected(MARIA_COLUMNDEF *rec,
}
if (to+spaces != end)
decode_bytes(rec,bit_buff,to,end-spaces);
- bfill((byte*) end-spaces,spaces,' ');
+ bfill((uchar*) end-spaces,spaces,' ');
}
else
decode_bytes(rec,bit_buff,to,end);
@@ -907,7 +907,7 @@ static void uf_space_endspace_selected(MARIA_COLUMNDEF *rec,
static void uf_endspace_selected(MARIA_COLUMNDEF *rec,
MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end)
+ uchar *to, uchar *end)
{
uint spaces;
if (get_bit(bit_buff))
@@ -919,18 +919,18 @@ static void uf_endspace_selected(MARIA_COLUMNDEF *rec,
}
if (to+spaces != end)
decode_bytes(rec,bit_buff,to,end-spaces);
- bfill((byte*) end-spaces,spaces,' ');
+ bfill((uchar*) end-spaces,spaces,' ');
}
else
decode_bytes(rec,bit_buff,to,end);
}
static void uf_space_endspace(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end)
+ uchar *to, uchar *end)
{
uint spaces;
if (get_bit(bit_buff))
- bfill((byte*) to,(end-to),' ');
+ bfill((uchar*) to,(end-to),' ');
else
{
if ((spaces=get_bits(bit_buff,rec->space_length_bits))+to > end)
@@ -940,12 +940,12 @@ static void uf_space_endspace(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
}
if (to+spaces != end)
decode_bytes(rec,bit_buff,to,end-spaces);
- bfill((byte*) end-spaces,spaces,' ');
+ bfill((uchar*) end-spaces,spaces,' ');
}
}
static void uf_endspace(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end)
+ uchar *to, uchar *end)
{
uint spaces;
if ((spaces=get_bits(bit_buff,rec->space_length_bits))+to > end)
@@ -955,16 +955,16 @@ static void uf_endspace(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
}
if (to+spaces != end)
decode_bytes(rec,bit_buff,to,end-spaces);
- bfill((byte*) end-spaces,spaces,' ');
+ bfill((uchar*) end-spaces,spaces,' ');
}
static void uf_space_prespace_selected(MARIA_COLUMNDEF *rec,
MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end)
+ uchar *to, uchar *end)
{
uint spaces;
if (get_bit(bit_buff))
- bfill((byte*) to,(end-to),' ');
+ bfill((uchar*) to,(end-to),' ');
else
{
if (get_bit(bit_buff))
@@ -974,7 +974,7 @@ static void uf_space_prespace_selected(MARIA_COLUMNDEF *rec,
bit_buff->error=1;
return;
}
- bfill((byte*) to,spaces,' ');
+ bfill((uchar*) to,spaces,' ');
if (to+spaces != end)
decode_bytes(rec,bit_buff,to+spaces,end);
}
@@ -986,7 +986,7 @@ static void uf_space_prespace_selected(MARIA_COLUMNDEF *rec,
static void uf_prespace_selected(MARIA_COLUMNDEF *rec,
MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end)
+ uchar *to, uchar *end)
{
uint spaces;
if (get_bit(bit_buff))
@@ -996,7 +996,7 @@ static void uf_prespace_selected(MARIA_COLUMNDEF *rec,
bit_buff->error=1;
return;
}
- bfill((byte*) to,spaces,' ');
+ bfill((uchar*) to,spaces,' ');
if (to+spaces != end)
decode_bytes(rec,bit_buff,to+spaces,end);
}
@@ -1006,11 +1006,11 @@ static void uf_prespace_selected(MARIA_COLUMNDEF *rec,
static void uf_space_prespace(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end)
+ uchar *to, uchar *end)
{
uint spaces;
if (get_bit(bit_buff))
- bfill((byte*) to,(end-to),' ');
+ bfill((uchar*) to,(end-to),' ');
else
{
if ((spaces=get_bits(bit_buff,rec->space_length_bits))+to > end)
@@ -1018,14 +1018,14 @@ static void uf_space_prespace(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
bit_buff->error=1;
return;
}
- bfill((byte*) to,spaces,' ');
+ bfill((uchar*) to,spaces,' ');
if (to+spaces != end)
decode_bytes(rec,bit_buff,to+spaces,end);
}
}
static void uf_prespace(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end)
+ uchar *to, uchar *end)
{
uint spaces;
if ((spaces=get_bits(bit_buff,rec->space_length_bits))+to > end)
@@ -1033,13 +1033,13 @@ static void uf_prespace(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
bit_buff->error=1;
return;
}
- bfill((byte*) to,spaces,' ');
+ bfill((uchar*) to,spaces,' ');
if (to+spaces != end)
decode_bytes(rec,bit_buff,to+spaces,end);
}
static void uf_zerofill_normal(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end)
+ uchar *to, uchar *end)
{
end-=rec->space_length_bits;
decode_bytes(rec,bit_buff, to, end);
@@ -1048,14 +1048,14 @@ static void uf_zerofill_normal(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
static void uf_constant(MARIA_COLUMNDEF *rec,
MARIA_BIT_BUFF *bit_buff __attribute__((unused)),
- byte *to, byte *end)
+ uchar *to, uchar *end)
{
memcpy(to,rec->huff_tree->intervalls,(size_t) (end-to));
}
static void uf_intervall(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
- byte *to,
- byte *end)
+ uchar *to,
+ uchar *end)
{
reg1 uint field_length=(uint) (end-to);
memcpy(to,rec->huff_tree->intervalls+field_length*decode_pos(bit_buff,
@@ -1067,13 +1067,13 @@ static void uf_intervall(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
/*ARGSUSED*/
static void uf_zero(MARIA_COLUMNDEF *rec __attribute__((unused)),
MARIA_BIT_BUFF *bit_buff __attribute__((unused)),
- byte *to, byte *end)
+ uchar *to, uchar *end)
{
bzero(to, (uint) (end-to));
}
static void uf_blob(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end)
+ uchar *to, uchar *end)
{
if (get_bit(bit_buff))
bzero(to, (uint) (end-to));
@@ -1084,12 +1084,12 @@ static void uf_blob(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
if (bit_buff->blob_pos+length > bit_buff->blob_end)
{
bit_buff->error=1;
- bzero((byte*) to,(end-to));
+ bzero((uchar*) to,(end-to));
return;
}
- decode_bytes(rec,bit_buff,(byte*) bit_buff->blob_pos,
- (byte*) bit_buff->blob_pos+length);
- _ma_store_blob_length((byte*) to,pack_length,length);
+ decode_bytes(rec,bit_buff,(uchar*) bit_buff->blob_pos,
+ (uchar*) bit_buff->blob_pos+length);
+ _ma_store_blob_length((uchar*) to,pack_length,length);
memcpy_fixed((char*) to+pack_length,(char*) &bit_buff->blob_pos,
sizeof(char*));
bit_buff->blob_pos+=length;
@@ -1098,7 +1098,7 @@ static void uf_blob(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
static void uf_varchar1(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end __attribute__((unused)))
+ uchar *to, uchar *end __attribute__((unused)))
{
if (get_bit(bit_buff))
to[0]= 0; /* Zero lengths */
@@ -1112,7 +1112,7 @@ static void uf_varchar1(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
static void uf_varchar2(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end __attribute__((unused)))
+ uchar *to, uchar *end __attribute__((unused)))
{
if (get_bit(bit_buff))
to[0]=to[1]=0; /* Zero lengths */
@@ -1129,7 +1129,7 @@ static void uf_varchar2(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
#if BITS_SAVED == 64
static void decode_bytes(MARIA_COLUMNDEF *rec,MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end)
+ uchar *to, uchar *end)
{
reg1 uint bits,low_byte;
reg3 uint16 *pos;
@@ -1166,13 +1166,13 @@ static void decode_bytes(MARIA_COLUMNDEF *rec,MARIA_BIT_BUFF *bit_buff,
In most cases table_bits is 9. So there are 512 16-bit values.
If the high-order bit (16) is set (IS_CHAR) then the array slot
- for this value is a valid Huffman code for a resulting byte value.
+ for this value is a valid Huffman code for a resulting uchar value.
- The low-order 8 bits (1..8) are the resulting byte value.
+ The low-order 8 bits (1..8) are the resulting uchar value.
- Bits 9..14 are the length of the Huffman code for this byte value.
+ Bits 9..14 are the length of the Huffman code for this uchar value.
This means so many bits from the input stream were needed to
- represent this byte value. The remaining bits belong to later
+ represent this uchar value. The remaining bits belong to later
Huffman codes. This also means that for every Huffman code shorter
than table_bits there are multiple entires in the array, which
differ just in the unused bits.
@@ -1222,7 +1222,7 @@ static void decode_bytes(MARIA_COLUMNDEF *rec,MARIA_BIT_BUFF *bit_buff,
#else
static void decode_bytes(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *end)
+ uchar *to, uchar *end)
{
reg1 uint bits,low_byte;
reg3 uint16 *pos;
@@ -1334,7 +1334,7 @@ static uint decode_pos(MARIA_BIT_BUFF *bit_buff,
int _ma_read_rnd_pack_record(MARIA_HA *info,
- byte *buf,
+ uchar *buf,
register MARIA_RECORD_POS filepos,
my_bool skip_deleted_blocks)
{
@@ -1352,7 +1352,7 @@ int _ma_read_rnd_pack_record(MARIA_HA *info,
file= info->dfile.file;
if (info->opt_flag & READ_CACHE_USED)
{
- if (_ma_read_cache(&info->rec_cache, (byte*) block_info.header,
+ if (_ma_read_cache(&info->rec_cache, (uchar*) block_info.header,
filepos, share->pack.ref_length,
skip_deleted_blocks ? READING_NEXT : 0))
goto err;
@@ -1372,14 +1372,14 @@ int _ma_read_rnd_pack_record(MARIA_HA *info,
if (info->opt_flag & READ_CACHE_USED)
{
- if (_ma_read_cache(&info->rec_cache, (byte*) info->rec_buff,
+ if (_ma_read_cache(&info->rec_cache, (uchar*) info->rec_buff,
block_info.filepos, block_info.rec_len,
skip_deleted_blocks ? READING_NEXT : 0))
goto err;
}
else
{
- if (my_read(info->dfile.file, (byte*)info->rec_buff + block_info.offset,
+ if (my_read(info->dfile.file, (uchar*)info->rec_buff + block_info.offset,
block_info.rec_len-block_info.offset,
MYF(MY_NABP)))
goto err;
@@ -1400,7 +1400,7 @@ int _ma_read_rnd_pack_record(MARIA_HA *info,
uint _ma_pack_get_block_info(MARIA_HA *maria, MARIA_BIT_BUFF *bit_buff,
MARIA_BLOCK_INFO *info,
- byte **rec_buff_p, my_size_t *rec_buff_size_p,
+ uchar **rec_buff_p, size_t *rec_buff_size_p,
File file, my_off_t filepos)
{
uchar *header= info->header;
@@ -1417,7 +1417,7 @@ uint _ma_pack_get_block_info(MARIA_HA *maria, MARIA_BIT_BUFF *bit_buff,
VOID(my_seek(file,filepos,MY_SEEK_SET,MYF(0)));
if (my_read(file,(char*) header,ref_length,MYF(MY_NABP)))
return BLOCK_FATAL_ERROR;
- DBUG_DUMP("header",(byte*) header,ref_length);
+ DBUG_DUMP("header",(uchar*) header,ref_length);
}
head_length= read_pack_length((uint) maria->s->pack.version, header,
&info->rec_len);
@@ -1449,7 +1449,7 @@ uint _ma_pack_get_block_info(MARIA_HA *maria, MARIA_BIT_BUFF *bit_buff,
/* rutines for bit buffer */
- /* Note buffer must be 6 byte bigger than longest row */
+ /* Note buffer must be 6 uchar bigger than longest row */
static void init_bit_buffer(MARIA_BIT_BUFF *bit_buff, uchar *buffer,
uint length)
@@ -1528,9 +1528,9 @@ static uint max_bit(register uint value)
#ifdef HAVE_MMAP
-static int _ma_read_mempack_record(MARIA_HA *info, byte *buf,
+static int _ma_read_mempack_record(MARIA_HA *info, uchar *buf,
MARIA_RECORD_POS filepos);
-static int _ma_read_rnd_mempack_record(MARIA_HA*, byte *, MARIA_RECORD_POS,
+static int _ma_read_rnd_mempack_record(MARIA_HA*, uchar *, MARIA_RECORD_POS,
my_bool);
my_bool _ma_memmap_file(MARIA_HA *info)
@@ -1567,8 +1567,8 @@ static uchar *
_ma_mempack_get_block_info(MARIA_HA *maria,
MARIA_BIT_BUFF *bit_buff,
MARIA_BLOCK_INFO *info,
- byte **rec_buff_p,
- my_size_t *rec_buff_size_p,
+ uchar **rec_buff_p,
+ size_t *rec_buff_size_p,
uchar *header)
{
header+= read_pack_length((uint) maria->s->pack.version, header,
@@ -1588,18 +1588,18 @@ _ma_mempack_get_block_info(MARIA_HA *maria,
}
-static int _ma_read_mempack_record(MARIA_HA *info, byte *buf,
+static int _ma_read_mempack_record(MARIA_HA *info, uchar *buf,
MARIA_RECORD_POS filepos)
{
MARIA_BLOCK_INFO block_info;
MARIA_SHARE *share=info->s;
- byte *pos;
+ uchar *pos;
DBUG_ENTER("maria_read_mempack_record");
if (filepos == HA_OFFSET_ERROR)
DBUG_RETURN(-1); /* _search() didn't find record */
- if (!(pos= (byte*) _ma_mempack_get_block_info(info, &info->bit_buff,
+ if (!(pos= (uchar*) _ma_mempack_get_block_info(info, &info->bit_buff,
&block_info, &info->rec_buff,
&info->rec_buff_size,
(uchar*) share->file_map+
@@ -1612,14 +1612,14 @@ static int _ma_read_mempack_record(MARIA_HA *info, byte *buf,
/*ARGSUSED*/
static int _ma_read_rnd_mempack_record(MARIA_HA *info,
- byte *buf,
+ uchar *buf,
register MARIA_RECORD_POS filepos,
my_bool skip_deleted_blocks
__attribute__((unused)))
{
MARIA_BLOCK_INFO block_info;
MARIA_SHARE *share=info->s;
- byte *pos,*start;
+ uchar *pos,*start;
DBUG_ENTER("_ma_read_rnd_mempack_record");
if (filepos >= share->state.state.data_file_length)
@@ -1627,7 +1627,7 @@ static int _ma_read_rnd_mempack_record(MARIA_HA *info,
my_errno=HA_ERR_END_OF_FILE;
goto err;
}
- if (!(pos= (byte*) _ma_mempack_get_block_info(info, &info->bit_buff,
+ if (!(pos= (uchar*) _ma_mempack_get_block_info(info, &info->bit_buff,
&block_info,
&info->rec_buff,
&info->rec_buff_size,
@@ -1657,7 +1657,7 @@ static int _ma_read_rnd_mempack_record(MARIA_HA *info,
/* Save length of row */
-uint _ma_save_pack_length(uint version, byte *block_buff, ulong length)
+uint _ma_save_pack_length(uint version, uchar *block_buff, ulong length)
{
if (length < 254)
{
diff --git a/storage/maria/ma_page.c b/storage/maria/ma_page.c
index d6b8d5ecd7d..9e57898f4a1 100644
--- a/storage/maria/ma_page.c
+++ b/storage/maria/ma_page.c
@@ -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)
diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c
index ae42f702b0a..8af4532ff97 100755
--- a/storage/maria/ma_pagecache.c
+++ b/storage/maria/ma_pagecache.c
@@ -302,7 +302,7 @@ struct st_pagecache_block_link
WQUEUE
wqueue[COND_SIZE]; /* queues on waiting requests for new/old pages */
uint requests; /* number of requests for the block */
- byte *buffer; /* buffer for the block page */
+ uchar *buffer; /* buffer for the block page */
uint status; /* state of the block */
uint pins; /* pin counter */
#ifndef DBUG_OFF
@@ -575,7 +575,7 @@ extern my_bool translog_flush(LSN lsn);
static uint pagecache_fwrite(PAGECACHE *pagecache,
PAGECACHE_FILE *filedesc,
- byte *buffer,
+ uchar *buffer,
pgcache_page_no_t pageno,
enum pagecache_page_type type,
myf flags)
@@ -651,7 +651,7 @@ static inline uint next_power(uint value)
*/
-int init_pagecache(PAGECACHE *pagecache, my_size_t use_mem,
+int init_pagecache(PAGECACHE *pagecache, size_t use_mem,
uint division_limit, uint age_threshold,
uint block_size)
{
@@ -745,11 +745,11 @@ int init_pagecache(PAGECACHE *pagecache, my_size_t use_mem,
(PAGECACHE_HASH_LINK*) ((char*) pagecache->hash_root +
ALIGN_SIZE((sizeof(PAGECACHE_HASH_LINK*) *
pagecache->hash_entries)));
- bzero((byte*) pagecache->block_root,
+ bzero((uchar*) pagecache->block_root,
pagecache->disk_blocks * sizeof(PAGECACHE_BLOCK_LINK));
- bzero((byte*) pagecache->hash_root,
+ bzero((uchar*) pagecache->hash_root,
pagecache->hash_entries * sizeof(PAGECACHE_HASH_LINK*));
- bzero((byte*) pagecache->hash_link_root,
+ bzero((uchar*) pagecache->hash_link_root,
pagecache->hash_links * sizeof(PAGECACHE_HASH_LINK));
pagecache->hash_links_used= 0;
pagecache->free_hash_list= NULL;
@@ -783,10 +783,10 @@ int init_pagecache(PAGECACHE *pagecache, my_size_t use_mem,
pagecache->disk_blocks, (long) pagecache->block_root,
pagecache->hash_entries, (long) pagecache->hash_root,
pagecache->hash_links, (long) pagecache->hash_link_root));
- bzero((gptr) pagecache->changed_blocks,
+ bzero((uchar*) pagecache->changed_blocks,
sizeof(pagecache->changed_blocks[0]) *
PAGECACHE_CHANGED_BLOCKS_HASH);
- bzero((gptr) pagecache->file_blocks,
+ bzero((uchar*) pagecache->file_blocks,
sizeof(pagecache->file_blocks[0]) *
PAGECACHE_CHANGED_BLOCKS_HASH);
}
@@ -800,12 +800,12 @@ err:
pagecache->blocks= 0;
if (pagecache->block_mem)
{
- my_large_free((gptr) pagecache->block_mem, MYF(0));
+ my_large_free((uchar*) pagecache->block_mem, MYF(0));
pagecache->block_mem= NULL;
}
if (pagecache->block_root)
{
- my_free((gptr) pagecache->block_root, MYF(0));
+ my_free((uchar*) pagecache->block_root, MYF(0));
pagecache->block_root= NULL;
}
my_errno= error;
@@ -884,7 +884,7 @@ static int flush_all_key_blocks(PAGECACHE *pagecache)
*/
#if NOT_USED /* keep disabled until code is fixed see above !! */
int resize_pagecache(PAGECACHE *pagecache,
- my_size_t use_mem, uint division_limit,
+ size_t use_mem, uint division_limit,
uint age_threshold)
{
int blocks;
@@ -1049,9 +1049,9 @@ void end_pagecache(PAGECACHE *pagecache, my_bool cleanup)
{
if (pagecache->block_mem)
{
- my_large_free((gptr) pagecache->block_mem, MYF(0));
+ my_large_free((uchar*) pagecache->block_mem, MYF(0));
pagecache->block_mem= NULL;
- my_free((gptr) pagecache->block_root, MYF(0));
+ my_free((uchar*) pagecache->block_root, MYF(0));
pagecache->block_root= NULL;
}
pagecache->disk_blocks= -1;
@@ -1876,7 +1876,7 @@ restart:
block->buffer= ADD_TO_PTR(pagecache->block_mem,
((ulong) pagecache->blocks_used*
pagecache->block_size),
- byte*);
+ uchar*);
pagecache->blocks_used++;
}
pagecache->blocks_unused--;
@@ -2097,7 +2097,7 @@ static void remove_pin(PAGECACHE_BLOCK_LINK *block)
PAGECACHE_PIN_INFO *info= info_find(block->pin_list, my_thread_var);
DBUG_ASSERT(info != 0);
info_unlink(info);
- my_free((gptr) info, MYF(0));
+ my_free((uchar*) info, MYF(0));
}
#endif
DBUG_VOID_RETURN;
@@ -2119,7 +2119,7 @@ static void info_remove_lock(PAGECACHE_BLOCK_LINK *block)
my_thread_var);
DBUG_ASSERT(info != 0);
info_unlink((PAGECACHE_PIN_INFO *)info);
- my_free((gptr)info, MYF(0));
+ my_free((uchar*)info, MYF(0));
}
static void info_change_lock(PAGECACHE_BLOCK_LINK *block, my_bool wl)
{
@@ -2362,7 +2362,7 @@ static void read_block(PAGECACHE *pagecache,
PAGECACHE_BLOCK_LINK *block,
my_bool primary,
pagecache_disk_read_validator validator,
- gptr validator_data)
+ uchar* validator_data)
{
uint got_length;
@@ -2814,16 +2814,16 @@ static enum pagecache_page_pin lock_to_pin[]=
PAGECACHE_UNPIN /*PAGECACHE_LOCK_WRITE_TO_READ*/
};
-byte *pagecache_valid_read(PAGECACHE *pagecache,
+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)
{
int error= 0;
enum pagecache_page_pin pin= lock_to_pin[lock];
@@ -2918,7 +2918,7 @@ restart:
pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
if (status & PCBLOCK_ERROR)
- DBUG_RETURN((byte *) 0);
+ DBUG_RETURN((uchar *) 0);
DBUG_RETURN(buff);
}
@@ -2928,9 +2928,9 @@ no_key_cache: /* Key cache is not used */
/* We can't use mutex here as the key cache may not be initialized */
pagecache->global_cache_r_requests++;
pagecache->global_cache_read++;
- if (pagecache_fread(pagecache, file, (byte*) buff, pageno, MYF(MY_NABP)))
+ if (pagecache_fread(pagecache, file, (uchar*) buff, pageno, MYF(MY_NABP)))
error= 1;
- DBUG_RETURN(error ? (byte*) 0 : buff);
+ DBUG_RETURN(error ? (uchar*) 0 : buff);
}
@@ -3160,7 +3160,7 @@ 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,
@@ -3320,7 +3320,7 @@ no_key_cache:
{
pagecache->global_cache_w_requests++;
pagecache->global_cache_write++;
- if (pagecache_fwrite(pagecache, file, (byte*) buff, pageno, type,
+ if (pagecache_fwrite(pagecache, file, (uchar*) buff, pageno, type,
MYF(MY_NABP | MY_WAIT_IF_FULL)))
error=1;
}
@@ -3426,7 +3426,7 @@ static int flush_cached_blocks(PAGECACHE *pagecache,
As all blocks referred in 'cache' are marked by PCBLOCK_IN_FLUSH
we are guarunteed no thread will change them
*/
- qsort((byte*) cache, count, sizeof(*cache), (qsort_cmp) cmp_sec_link);
+ qsort((uchar*) cache, count, sizeof(*cache), (qsort_cmp) cmp_sec_link);
pagecache_pthread_mutex_lock(&pagecache->cache_lock);
for (; cache != end; cache++)
@@ -3730,7 +3730,7 @@ restart:
test_key_cache(pagecache, "end of flush_pagecache_blocks", 0););
#endif
if (cache != cache_buff)
- my_free((gptr) cache, MYF(0));
+ my_free((uchar*) cache, MYF(0));
if (last_errno)
errno=last_errno; /* Return first error */
DBUG_RETURN(last_errno != 0);
diff --git a/storage/maria/ma_pagecache.h b/storage/maria/ma_pagecache.h
index 478f71161eb..5030c2a2d7b 100644
--- a/storage/maria/ma_pagecache.h
+++ b/storage/maria/ma_pagecache.h
@@ -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);
diff --git a/storage/maria/ma_pagecaches.c b/storage/maria/ma_pagecaches.c
index d2ed4edca31..a9460be10c5 100644
--- a/storage/maria/ma_pagecaches.c
+++ b/storage/maria/ma_pagecaches.c
@@ -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);
}
diff --git a/storage/maria/ma_preload.c b/storage/maria/ma_preload.c
index 44fc12f8571..35ae8868ee7 100644
--- a/storage/maria/ma_preload.c
+++ b/storage/maria/ma_preload.c
@@ -76,7 +76,7 @@ int maria_preload(MARIA_HA *info, ulonglong key_map, my_bool ignore_leaves)
/* Read the next block of index file into the preload buffer */
if ((my_off_t) length > (key_file_length-pos))
length= (ulong) (key_file_length-pos);
- if (my_pread(share->kfile.file, (byte*) buff, length, pos,
+ if (my_pread(share->kfile.file, (uchar*) buff, length, pos,
MYF(MY_FAE|MY_FNABP)))
goto err;
@@ -91,7 +91,7 @@ int maria_preload(MARIA_HA *info, ulonglong key_map, my_bool ignore_leaves)
if (pagecache_write(share->pagecache,
&share->kfile, pos / block_length,
DFLT_INIT_HITS,
- (byte*) buff,
+ (uchar*) buff,
PAGECACHE_PLAIN_PAGE,
PAGECACHE_LOCK_LEFT_UNLOCKED,
PAGECACHE_PIN_LEFT_UNPINNED,
@@ -108,7 +108,7 @@ int maria_preload(MARIA_HA *info, ulonglong key_map, my_bool ignore_leaves)
if (pagecache_write(share->pagecache,
&share->kfile, pos / block_length,
DFLT_INIT_HITS,
- (byte*) buff,
+ (uchar*) buff,
PAGECACHE_PLAIN_PAGE,
PAGECACHE_LOCK_LEFT_UNLOCKED,
PAGECACHE_PIN_LEFT_UNPINNED,
diff --git a/storage/maria/ma_range.c b/storage/maria/ma_range.c
index b359868e8e4..7250e6796d2 100644
--- a/storage/maria/ma_range.c
+++ b/storage/maria/ma_range.c
@@ -21,12 +21,12 @@
#include "maria_def.h"
#include "ma_rt_index.h"
-static ha_rows _ma_record_pos(MARIA_HA *info,const byte *key,uint key_len,
+static ha_rows _ma_record_pos(MARIA_HA *info,const uchar *key,uint key_len,
enum ha_rkey_function search_flag);
-static double _ma_search_pos(MARIA_HA *info,MARIA_KEYDEF *keyinfo, byte *key,
+static double _ma_search_pos(MARIA_HA *info,MARIA_KEYDEF *keyinfo, uchar *key,
uint key_len,uint nextflag, my_off_t pos);
-static uint _ma_keynr(MARIA_HA *info, MARIA_KEYDEF *keyinfo, byte *page,
- byte *keypos, uint *ret_max_key);
+static uint _ma_keynr(MARIA_HA *info, MARIA_KEYDEF *keyinfo, uchar *page,
+ uchar *keypos, uint *ret_max_key);
/**
@@ -64,7 +64,7 @@ ha_rows maria_records_in_range(MARIA_HA *info, int inx, key_range *min_key,
#ifdef HAVE_RTREE_KEYS
case HA_KEY_ALG_RTREE:
{
- byte *key_buff;
+ uchar *key_buff;
uint start_key_len;
/*
@@ -126,12 +126,12 @@ ha_rows maria_records_in_range(MARIA_HA *info, int inx, key_range *min_key,
/* Find relative position (in records) for key in index-tree */
-static ha_rows _ma_record_pos(MARIA_HA *info, const byte *key, uint key_len,
+static ha_rows _ma_record_pos(MARIA_HA *info, const uchar *key, uint key_len,
enum ha_rkey_function search_flag)
{
uint inx=(uint) info->lastinx, nextflag;
MARIA_KEYDEF *keyinfo=info->s->keyinfo+inx;
- byte *key_buff;
+ uchar *key_buff;
double pos;
DBUG_ENTER("_ma_record_pos");
DBUG_PRINT("enter",("search_flag: %d",search_flag));
@@ -164,13 +164,13 @@ static ha_rows _ma_record_pos(MARIA_HA *info, const byte *key, uint key_len,
static double _ma_search_pos(register MARIA_HA *info,
register MARIA_KEYDEF *keyinfo,
- byte *key, uint key_len, uint nextflag,
+ uchar *key, uint key_len, uint nextflag,
register my_off_t pos)
{
int flag;
uint nod_flag,keynr,max_keynr;
my_bool after_key;
- byte *keypos, *buff;
+ uchar *keypos, *buff;
double offset;
DBUG_ENTER("_ma_search_pos");
LINT_INIT(max_keynr);
@@ -232,10 +232,10 @@ err:
/* Get keynummer of current key and max number of keys in nod */
static uint _ma_keynr(MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
- byte *page, byte *keypos, uint *ret_max_key)
+ uchar *page, uchar *keypos, uint *ret_max_key)
{
uint nod_flag,keynr,max_key;
- byte t_buff[HA_MAX_KEY_BUFF],*end;
+ uchar t_buff[HA_MAX_KEY_BUFF],*end;
end= page+maria_data_on_page(page);
nod_flag=_ma_test_if_nod(page);
diff --git a/storage/maria/ma_rfirst.c b/storage/maria/ma_rfirst.c
index 04c496d9c56..226aaa551f0 100644
--- a/storage/maria/ma_rfirst.c
+++ b/storage/maria/ma_rfirst.c
@@ -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;
diff --git a/storage/maria/ma_rkey.c b/storage/maria/ma_rkey.c
index 6158935472b..ef8b8468f1f 100644
--- a/storage/maria/ma_rkey.c
+++ b/storage/maria/ma_rkey.c
@@ -21,10 +21,10 @@
/* Read a record using key */
/* Ordinary search_flag is 0 ; Give error if no record with key */
-int maria_rkey(MARIA_HA *info, byte *buf, int inx, const byte *key,
+int maria_rkey(MARIA_HA *info, uchar *buf, int inx, const uchar *key,
uint key_len, enum ha_rkey_function search_flag)
{
- byte *key_buff;
+ uchar *key_buff;
MARIA_SHARE *share=info->s;
MARIA_KEYDEF *keyinfo;
HA_KEYSEG *last_used_keyseg;
diff --git a/storage/maria/ma_rlast.c b/storage/maria/ma_rlast.c
index ebd039843c8..a9a470d37d9 100644
--- a/storage/maria/ma_rlast.c
+++ b/storage/maria/ma_rlast.c
@@ -17,7 +17,7 @@
/* Read last row with the same key as the previous read. */
-int maria_rlast(MARIA_HA *info, byte *buf, int inx)
+int maria_rlast(MARIA_HA *info, uchar *buf, int inx)
{
DBUG_ENTER("maria_rlast");
info->cur_row.lastpos= HA_OFFSET_ERROR;
diff --git a/storage/maria/ma_rnext.c b/storage/maria/ma_rnext.c
index ccca05ff3ad..fcc0f1f6a90 100644
--- a/storage/maria/ma_rnext.c
+++ b/storage/maria/ma_rnext.c
@@ -24,7 +24,7 @@
based on the position of the last used key!
*/
-int maria_rnext(MARIA_HA *info, byte *buf, int inx)
+int maria_rnext(MARIA_HA *info, uchar *buf, int inx)
{
int error,changed;
uint flag;
diff --git a/storage/maria/ma_rnext_same.c b/storage/maria/ma_rnext_same.c
index 207a438e10b..6782cf5b8cf 100644
--- a/storage/maria/ma_rnext_same.c
+++ b/storage/maria/ma_rnext_same.c
@@ -25,7 +25,7 @@
based on the position of the last used key!
*/
-int maria_rnext_same(MARIA_HA *info, byte *buf)
+int maria_rnext_same(MARIA_HA *info, uchar *buf)
{
int error;
uint inx,not_used[2];
diff --git a/storage/maria/ma_rprev.c b/storage/maria/ma_rprev.c
index 5e7cfc9f41a..753ff604975 100644
--- a/storage/maria/ma_rprev.c
+++ b/storage/maria/ma_rprev.c
@@ -22,7 +22,7 @@
based on the position of the last used key!
*/
-int maria_rprev(MARIA_HA *info, byte *buf, int inx)
+int maria_rprev(MARIA_HA *info, uchar *buf, int inx)
{
int error,changed;
register uint flag;
diff --git a/storage/maria/ma_rrnd.c b/storage/maria/ma_rrnd.c
index 8e2b12dc60d..4f5c2fb06cf 100644
--- a/storage/maria/ma_rrnd.c
+++ b/storage/maria/ma_rrnd.c
@@ -28,7 +28,7 @@
HA_ERR_END_OF_FILE EOF.
*/
-int maria_rrnd(MARIA_HA *info, byte *buf, MARIA_RECORD_POS filepos)
+int maria_rrnd(MARIA_HA *info, uchar *buf, MARIA_RECORD_POS filepos)
{
DBUG_ENTER("maria_rrnd");
diff --git a/storage/maria/ma_rsame.c b/storage/maria/ma_rsame.c
index 052fe79af58..9c9acac013a 100644
--- a/storage/maria/ma_rsame.c
+++ b/storage/maria/ma_rsame.c
@@ -28,7 +28,7 @@
*/
-int maria_rsame(MARIA_HA *info, byte *record, int inx)
+int maria_rsame(MARIA_HA *info, uchar *record, int inx)
{
DBUG_ENTER("maria_rsame");
diff --git a/storage/maria/ma_rsamepos.c b/storage/maria/ma_rsamepos.c
index 1e09bdb8db4..186bc80c06d 100644
--- a/storage/maria/ma_rsamepos.c
+++ b/storage/maria/ma_rsamepos.c
@@ -27,7 +27,7 @@
** HA_ERR_END_OF_FILE = End of file
*/
-int maria_rsame_with_pos(MARIA_HA *info, byte *record, int inx,
+int maria_rsame_with_pos(MARIA_HA *info, uchar *record, int inx,
MARIA_RECORD_POS filepos)
{
DBUG_ENTER("maria_rsame_with_pos");
diff --git a/storage/maria/ma_rt_index.c b/storage/maria/ma_rt_index.c
index 27a83e433a4..4d99eade9b5 100644
--- a/storage/maria/ma_rt_index.c
+++ b/storage/maria/ma_rt_index.c
@@ -58,11 +58,11 @@ static int maria_rtree_find_req(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
{
uint nod_flag;
int res;
- byte *page_buf, *k, *last;
+ uchar *page_buf, *k, *last;
int k_len;
uint *saved_key = (uint*) (info->maria_rtree_recursion_state) + level;
- if (!(page_buf = (byte*) my_alloca((uint)keyinfo->block_length)))
+ if (!(page_buf = (uchar*) my_alloca((uint)keyinfo->block_length)))
{
my_errno = HA_ERR_OUT_OF_MEM;
return -1;
@@ -115,7 +115,7 @@ static int maria_rtree_find_req(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
if (!maria_rtree_key_cmp(keyinfo->seg, info->first_mbr_key,
k, info->last_rkey_length, search_flag))
{
- byte *after_key = (byte*) rt_PAGE_NEXT_KEY(k, k_len, nod_flag);
+ uchar *after_key = (uchar*) rt_PAGE_NEXT_KEY(k, k_len, nod_flag);
info->cur_row.lastpos = _ma_dpos(info, 0, after_key);
info->lastkey_length = k_len + info->s->base.rec_reflength;
memcpy(info->lastkey, k, info->lastkey_length);
@@ -144,11 +144,11 @@ static int maria_rtree_find_req(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
res = 1;
ok:
- my_afree((byte*)page_buf);
+ my_afree((uchar*)page_buf);
return res;
err1:
- my_afree((byte*)page_buf);
+ my_afree((uchar*)page_buf);
info->cur_row.lastpos = HA_OFFSET_ERROR;
return -1;
}
@@ -171,7 +171,7 @@ err1:
1 Not found
*/
-int maria_rtree_find_first(MARIA_HA *info, uint keynr, byte *key,
+int maria_rtree_find_first(MARIA_HA *info, uint keynr, uchar *key,
uint key_length, uint search_flag)
{
my_off_t root;
@@ -229,7 +229,7 @@ int maria_rtree_find_next(MARIA_HA *info, uint keynr, uint search_flag)
if (!info->keyread_buff_used)
{
- byte *key= info->int_keypos;
+ uchar *key= info->int_keypos;
while (key < info->int_maxpos)
{
@@ -237,7 +237,7 @@ int maria_rtree_find_next(MARIA_HA *info, uint keynr, uint search_flag)
info->first_mbr_key, key,
info->last_rkey_length, search_flag))
{
- byte *after_key= key + keyinfo->keylength;
+ uchar *after_key= key + keyinfo->keylength;
info->cur_row.lastpos= _ma_dpos(info, 0, after_key);
memcpy(info->lastkey, key, info->lastkey_length);
@@ -278,12 +278,12 @@ int maria_rtree_find_next(MARIA_HA *info, uint keynr, uint search_flag)
static int maria_rtree_get_req(MARIA_HA *info, MARIA_KEYDEF *keyinfo, uint key_length,
my_off_t page, int level)
{
- byte *page_buf, *last, *k;
+ uchar *page_buf, *last, *k;
uint nod_flag, k_len;
int res;
uint *saved_key= (uint*) (info->maria_rtree_recursion_state) + level;
- if (!(page_buf= (byte*) my_alloca((uint)keyinfo->block_length)))
+ if (!(page_buf= (uchar*) my_alloca((uint)keyinfo->block_length)))
return -1;
if (!_ma_fetch_keypage(info, keyinfo, page, DFLT_INIT_HITS, page_buf, 0))
goto err1;
@@ -329,7 +329,7 @@ static int maria_rtree_get_req(MARIA_HA *info, MARIA_KEYDEF *keyinfo, uint key_l
else
{
/* this is a leaf */
- byte *after_key = rt_PAGE_NEXT_KEY(k, k_len, nod_flag);
+ uchar *after_key = rt_PAGE_NEXT_KEY(k, k_len, nod_flag);
info->cur_row.lastpos = _ma_dpos(info, 0, after_key);
info->lastkey_length = k_len + info->s->base.rec_reflength;
memcpy(info->lastkey, k, info->lastkey_length);
@@ -339,7 +339,7 @@ static int maria_rtree_get_req(MARIA_HA *info, MARIA_KEYDEF *keyinfo, uint key_l
if (after_key < last)
{
- info->int_keypos = (byte*) saved_key;
+ info->int_keypos = (uchar*) saved_key;
memcpy(info->buff, page_buf, keyinfo->block_length);
info->int_maxpos = rt_PAGE_END(info->buff);
info->keyread_buff_used = 0;
@@ -358,11 +358,11 @@ static int maria_rtree_get_req(MARIA_HA *info, MARIA_KEYDEF *keyinfo, uint key_l
res = 1;
ok:
- my_afree((byte*)page_buf);
+ my_afree((uchar*)page_buf);
return res;
err1:
- my_afree((byte*)page_buf);
+ my_afree((uchar*)page_buf);
info->cur_row.lastpos = HA_OFFSET_ERROR;
return -1;
}
@@ -413,10 +413,10 @@ int maria_rtree_get_next(MARIA_HA *info, uint keynr, uint key_length)
{
uint k_len = keyinfo->keylength - info->s->base.rec_reflength;
/* rt_PAGE_NEXT_KEY(info->int_keypos) */
- byte *key = info->buff + *(int*)info->int_keypos + k_len +
+ uchar *key = info->buff + *(int*)info->int_keypos + k_len +
info->s->base.rec_reflength;
/* rt_PAGE_NEXT_KEY(key) */
- byte *after_key = key + k_len + info->s->base.rec_reflength;
+ uchar *after_key = key + k_len + info->s->base.rec_reflength;
info->cur_row.lastpos = _ma_dpos(info, 0, after_key);
info->lastkey_length = k_len + info->s->base.rec_reflength;
@@ -450,7 +450,7 @@ int maria_rtree_get_next(MARIA_HA *info, uint keynr, uint key_length)
#ifdef PICK_BY_PERIMETER
static uchar *maria_rtree_pick_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
uchar *key,
- uint key_length, byte *page_buf,
+ uint key_length, uchar *page_buf,
uint nod_flag)
{
double increase;
@@ -483,18 +483,18 @@ static uchar *maria_rtree_pick_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
#endif /*PICK_BY_PERIMETER*/
#ifdef PICK_BY_AREA
-static byte *maria_rtree_pick_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- byte *key,
- uint key_length, byte *page_buf,
+static uchar *maria_rtree_pick_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
+ uchar *key,
+ uint key_length, uchar *page_buf,
uint nod_flag)
{
double increase;
double best_incr = DBL_MAX;
double area;
double best_area;
- byte *best_key;
- byte *k = rt_PAGE_FIRST_KEY(page_buf, nod_flag);
- byte *last = rt_PAGE_END(page_buf);
+ uchar *best_key;
+ uchar *k = rt_PAGE_FIRST_KEY(page_buf, nod_flag);
+ uchar *last = rt_PAGE_END(page_buf);
LINT_INIT(best_area);
LINT_INIT(best_key);
@@ -538,16 +538,16 @@ static byte *maria_rtree_pick_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
*/
static int maria_rtree_insert_req(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- byte *key,
+ uchar *key,
uint key_length, my_off_t page,
my_off_t *new_page,
int ins_level, int level)
{
uint nod_flag;
int res;
- byte *page_buf, *k;
+ uchar *page_buf, *k;
- if (!(page_buf= (byte*) my_alloca((uint)keyinfo->block_length +
+ if (!(page_buf= (uchar*) my_alloca((uint)keyinfo->block_length +
HA_MAX_KEY_BUFF)))
{
my_errno = HA_ERR_OUT_OF_MEM;
@@ -576,7 +576,7 @@ static int maria_rtree_insert_req(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
}
case 1: /* child was split */
{
- byte *new_key = page_buf + keyinfo->block_length + nod_flag;
+ uchar *new_key = page_buf + keyinfo->block_length + nod_flag;
/* set proper MBR for key */
if (maria_rtree_set_key_mbr(info, keyinfo, k, key_length,
_ma_kpos(nod_flag, k)))
@@ -626,7 +626,7 @@ err1:
1 Root was split
*/
-static int maria_rtree_insert_level(MARIA_HA *info, uint keynr, byte *key,
+static int maria_rtree_insert_level(MARIA_HA *info, uint keynr, uchar *key,
uint key_length, int ins_level)
{
my_off_t old_root;
@@ -656,11 +656,11 @@ static int maria_rtree_insert_level(MARIA_HA *info, uint keynr, byte *key,
}
case 1: /* root was split, grow a new root */
{
- byte *new_root_buf, *new_key;
+ uchar *new_root_buf, *new_key;
my_off_t new_root;
uint nod_flag = info->s->base.key_reflength;
- if (!(new_root_buf= (byte*) my_alloca((uint)keyinfo->block_length +
+ if (!(new_root_buf= (uchar*) my_alloca((uint)keyinfo->block_length +
HA_MAX_KEY_BUFF)))
{
my_errno = HA_ERR_OUT_OF_MEM;
@@ -695,10 +695,10 @@ static int maria_rtree_insert_level(MARIA_HA *info, uint keynr, byte *key,
goto err1;
info->s->state.key_root[keynr] = new_root;
- my_afree((byte*)new_root_buf);
+ my_afree((uchar*)new_root_buf);
break;
err1:
- my_afree((byte*)new_root_buf);
+ my_afree((uchar*)new_root_buf);
return -1;
}
default:
@@ -719,7 +719,7 @@ err1:
0 OK
*/
-int maria_rtree_insert(MARIA_HA *info, uint keynr, byte *key, uint key_length)
+int maria_rtree_insert(MARIA_HA *info, uint keynr, uchar *key, uint key_length)
{
return (!key_length ||
(maria_rtree_insert_level(info, keynr, key, key_length, -1) == -1)) ?
@@ -741,7 +741,7 @@ static int maria_rtree_fill_reinsert_list(stPageList *ReinsertList, my_off_t pag
if (ReinsertList->n_pages == ReinsertList->m_pages)
{
ReinsertList->m_pages += REINSERT_BUFFER_INC;
- if (!(ReinsertList->pages = (stPageLevel*)my_realloc((gptr)ReinsertList->pages,
+ if (!(ReinsertList->pages = (stPageLevel*)my_realloc((uchar*)ReinsertList->pages,
ReinsertList->m_pages * sizeof(stPageLevel), MYF(MY_ALLOW_ZERO_PTR))))
goto err1;
}
@@ -767,7 +767,7 @@ err1:
*/
static int maria_rtree_delete_req(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- byte *key,
+ uchar *key,
uint key_length, my_off_t page,
uint *page_size,
stPageList *ReinsertList, int level)
@@ -775,9 +775,9 @@ static int maria_rtree_delete_req(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
ulong i;
uint nod_flag;
int res;
- byte *page_buf, *last, *k;
+ uchar *page_buf, *last, *k;
- if (!(page_buf = (byte*) my_alloca((uint)keyinfo->block_length)))
+ if (!(page_buf = (uchar*) my_alloca((uint)keyinfo->block_length)))
{
my_errno = HA_ERR_OUT_OF_MEM;
return -1;
@@ -878,11 +878,11 @@ static int maria_rtree_delete_req(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
res = 1;
ok:
- my_afree((byte*)page_buf);
+ my_afree((uchar*)page_buf);
return res;
err1:
- my_afree((byte*)page_buf);
+ my_afree((uchar*)page_buf);
return -1;
}
@@ -895,7 +895,7 @@ err1:
0 Deleted
*/
-int maria_rtree_delete(MARIA_HA *info, uint keynr, byte *key, uint key_length)
+int maria_rtree_delete(MARIA_HA *info, uint keynr, uchar *key, uint key_length)
{
uint page_size;
stPageList ReinsertList;
@@ -926,9 +926,9 @@ int maria_rtree_delete(MARIA_HA *info, uint keynr, byte *key, uint key_length)
ulong i;
for (i = 0; i < ReinsertList.n_pages; ++i)
{
- byte *page_buf, *k, *last;
+ uchar *page_buf, *k, *last;
- if (!(page_buf = (byte*) my_alloca((uint)keyinfo->block_length)))
+ if (!(page_buf = (uchar*) my_alloca((uint)keyinfo->block_length)))
{
my_errno = HA_ERR_OUT_OF_MEM;
goto err1;
@@ -954,7 +954,7 @@ int maria_rtree_delete(MARIA_HA *info, uint keynr, byte *key, uint key_length)
goto err1;
}
if (ReinsertList.pages)
- my_free((byte*) ReinsertList.pages, MYF(0));
+ my_free((uchar*) ReinsertList.pages, MYF(0));
/* check for redundant root (not leaf, 1 child) and eliminate */
if ((old_root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR)
@@ -997,14 +997,14 @@ err1:
estimated value
*/
-ha_rows maria_rtree_estimate(MARIA_HA *info, uint keynr, byte *key,
+ha_rows maria_rtree_estimate(MARIA_HA *info, uint keynr, uchar *key,
uint key_length, uint flag)
{
MARIA_KEYDEF *keyinfo = info->s->keyinfo + keynr;
my_off_t root;
uint i = 0;
uint nod_flag, k_len;
- byte *page_buf, *k, *last;
+ uchar *page_buf, *k, *last;
double area = 0;
ha_rows res = 0;
@@ -1013,7 +1013,7 @@ ha_rows maria_rtree_estimate(MARIA_HA *info, uint keynr, byte *key,
if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR)
return HA_POS_ERROR;
- if (!(page_buf= (byte*) my_alloca((uint)keyinfo->block_length)))
+ if (!(page_buf= (uchar*) my_alloca((uint)keyinfo->block_length)))
return HA_POS_ERROR;
if (!_ma_fetch_keypage(info, keyinfo, root, DFLT_INIT_HITS, page_buf, 0))
goto err1;
@@ -1078,7 +1078,7 @@ ha_rows maria_rtree_estimate(MARIA_HA *info, uint keynr, byte *key,
res = HA_POS_ERROR;
}
- my_afree((byte*)page_buf);
+ my_afree((uchar*)page_buf);
return res;
err1:
diff --git a/storage/maria/ma_rt_index.h b/storage/maria/ma_rt_index.h
index eae43966aa0..fe2f62b662c 100644
--- a/storage/maria/ma_rt_index.h
+++ b/storage/maria/ma_rt_index.h
@@ -26,21 +26,23 @@
#define rt_PAGE_MIN_SIZE(block_length) ((uint)(block_length) / 3)
-int maria_rtree_insert(MARIA_HA *info, uint keynr, byte *key, uint key_length);
-int maria_rtree_delete(MARIA_HA *info, uint keynr, byte *key, uint key_length);
+int maria_rtree_insert(MARIA_HA *info, uint keynr, uchar *key,
+ uint key_length);
+int maria_rtree_delete(MARIA_HA *info, uint keynr, uchar *key,
+ uint key_length);
-int maria_rtree_find_first(MARIA_HA *info, uint keynr, byte *key,
+int maria_rtree_find_first(MARIA_HA *info, uint keynr, uchar *key,
uint key_length, uint search_flag);
int maria_rtree_find_next(MARIA_HA *info, uint keynr, uint search_flag);
int maria_rtree_get_first(MARIA_HA *info, uint keynr, uint key_length);
int maria_rtree_get_next(MARIA_HA *info, uint keynr, uint key_length);
-ha_rows maria_rtree_estimate(MARIA_HA *info, uint keynr, byte *key,
+ha_rows maria_rtree_estimate(MARIA_HA *info, uint keynr, uchar *key,
uint key_length, uint flag);
-int maria_rtree_split_page(MARIA_HA *info, MARIA_KEYDEF *keyinfo, byte *page,
- byte *key, uint key_length,
+int maria_rtree_split_page(MARIA_HA *info, MARIA_KEYDEF *keyinfo, uchar *page,
+ uchar *key, uint key_length,
my_off_t *new_page_offs);
#endif /*HAVE_RTREE_KEYS*/
diff --git a/storage/maria/ma_rt_key.c b/storage/maria/ma_rt_key.c
index a27ff23c006..1b9f246081d 100644
--- a/storage/maria/ma_rt_key.c
+++ b/storage/maria/ma_rt_key.c
@@ -29,8 +29,8 @@
1 Split
*/
-int maria_rtree_add_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo, byte *key,
- uint key_length, byte *page_buf, my_off_t *new_page)
+int maria_rtree_add_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo, uchar *key,
+ uint key_length, uchar *page_buf, my_off_t *new_page)
{
uint page_size = maria_data_on_page(page_buf);
uint nod_flag = _ma_test_if_nod(page_buf);
@@ -65,11 +65,11 @@ int maria_rtree_add_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo, byte *key,
Delete key from the page
*/
-int maria_rtree_delete_key(MARIA_HA *info, byte *page_buf, byte *key,
+int maria_rtree_delete_key(MARIA_HA *info, uchar *page_buf, uchar *key,
uint key_length, uint nod_flag)
{
uint16 page_size = maria_data_on_page(page_buf);
- byte *key_start;
+ uchar *key_start;
key_start= key - nod_flag;
if (!nod_flag)
@@ -88,7 +88,7 @@ int maria_rtree_delete_key(MARIA_HA *info, byte *page_buf, byte *key,
Calculate and store key MBR
*/
-int maria_rtree_set_key_mbr(MARIA_HA *info, MARIA_KEYDEF *keyinfo, byte *key,
+int maria_rtree_set_key_mbr(MARIA_HA *info, MARIA_KEYDEF *keyinfo, uchar *key,
uint key_length, my_off_t child_page)
{
if (!_ma_fetch_keypage(info, keyinfo, child_page,
diff --git a/storage/maria/ma_rt_key.h b/storage/maria/ma_rt_key.h
index 03c9ef46438..3f95d3d3e67 100644
--- a/storage/maria/ma_rt_key.h
+++ b/storage/maria/ma_rt_key.h
@@ -21,11 +21,11 @@
#ifdef HAVE_RTREE_KEYS
-int maria_rtree_add_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo, byte *key,
- uint key_length, byte *page_buf, my_off_t *new_page);
-int maria_rtree_delete_key(MARIA_HA *info, byte *page, byte *key,
+int maria_rtree_add_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo, uchar *key,
+ uint key_length, uchar *page_buf, my_off_t *new_page);
+int maria_rtree_delete_key(MARIA_HA *info, uchar *page, uchar *key,
uint key_length, uint nod_flag);
-int maria_rtree_set_key_mbr(MARIA_HA *info, MARIA_KEYDEF *keyinfo, byte *key,
+int maria_rtree_set_key_mbr(MARIA_HA *info, MARIA_KEYDEF *keyinfo, uchar *key,
uint key_length, my_off_t child_page);
#endif /*HAVE_RTREE_KEYS*/
diff --git a/storage/maria/ma_rt_mbr.c b/storage/maria/ma_rt_mbr.c
index 2da4ffea7a4..a224cefac12 100644
--- a/storage/maria/ma_rt_mbr.c
+++ b/storage/maria/ma_rt_mbr.c
@@ -93,7 +93,7 @@
Returns 0 on success.
*/
-int maria_rtree_key_cmp(HA_KEYSEG *keyseg, byte *b, byte *a, uint key_length,
+int maria_rtree_key_cmp(HA_KEYSEG *keyseg, uchar *b, uchar *a, uint key_length,
uint nextflag)
{
for (; (int) key_length > 0; keyseg += 2 )
@@ -153,7 +153,7 @@ int maria_rtree_key_cmp(HA_KEYSEG *keyseg, byte *b, byte *a, uint key_length,
end:
if (nextflag & MBR_DATA)
{
- byte *end = a + keyseg->length;
+ uchar *end = a + keyseg->length;
do
{
if (*a++ != *b++)
@@ -182,7 +182,7 @@ end:
/*
Calculates rectangle volume
*/
-double maria_rtree_rect_volume(HA_KEYSEG *keyseg, byte *a, uint key_length)
+double maria_rtree_rect_volume(HA_KEYSEG *keyseg, uchar *a, uint key_length)
{
double res = 1;
for (; (int)key_length > 0; keyseg += 2)
@@ -263,7 +263,7 @@ double maria_rtree_rect_volume(HA_KEYSEG *keyseg, byte *a, uint key_length)
Creates an MBR as an array of doubles.
*/
-int maria_rtree_d_mbr(HA_KEYSEG *keyseg, byte *a, uint key_length, double *res)
+int maria_rtree_d_mbr(HA_KEYSEG *keyseg, uchar *a, uint key_length, double *res)
{
for (; (int)key_length > 0; keyseg += 2)
{
@@ -352,7 +352,7 @@ int maria_rtree_d_mbr(HA_KEYSEG *keyseg, byte *a, uint key_length, double *res)
Result is written to c
*/
-int maria_rtree_combine_rect(HA_KEYSEG *keyseg, byte* a, byte* b, byte* c,
+int maria_rtree_combine_rect(HA_KEYSEG *keyseg, uchar* a, uchar* b, uchar* c,
uint key_length)
{
for ( ; (int) key_length > 0 ; keyseg += 2)
@@ -443,7 +443,7 @@ int maria_rtree_combine_rect(HA_KEYSEG *keyseg, byte* a, byte* b, byte* c,
/*
Calculates overlapping area of two MBRs a & b
*/
-double maria_rtree_overlapping_area(HA_KEYSEG *keyseg, byte* a, byte* b,
+double maria_rtree_overlapping_area(HA_KEYSEG *keyseg, uchar* a, uchar* b,
uint key_length)
{
double res = 1;
@@ -528,7 +528,7 @@ double maria_rtree_overlapping_area(HA_KEYSEG *keyseg, byte* a, byte* b,
Calculates MBR_AREA(a+b) - MBR_AREA(a)
*/
-double maria_rtree_area_increase(HA_KEYSEG *keyseg, byte *a, byte *b,
+double maria_rtree_area_increase(HA_KEYSEG *keyseg, uchar *a, uchar *b,
uint key_length, double *ab_area)
{
double a_area= 1.0;
@@ -621,7 +621,7 @@ safe_end:
/*
Calculates MBR_PERIMETER(a+b) - MBR_PERIMETER(a)
*/
-double maria_rtree_perimeter_increase(HA_KEYSEG *keyseg, byte* a, byte* b,
+double maria_rtree_perimeter_increase(HA_KEYSEG *keyseg, uchar* a, uchar* b,
uint key_length, double *ab_perim)
{
double a_perim = 0.0;
@@ -734,14 +734,14 @@ double maria_rtree_perimeter_increase(HA_KEYSEG *keyseg, byte* a, byte* b,
/*
Calculates key page total MBR = MBR(key1) + MBR(key2) + ...
*/
-int maria_rtree_page_mbr(MARIA_HA *info, HA_KEYSEG *keyseg, byte *page_buf,
- byte *c, uint key_length)
+int maria_rtree_page_mbr(MARIA_HA *info, HA_KEYSEG *keyseg, uchar *page_buf,
+ uchar *c, uint key_length)
{
uint inc = 0;
uint k_len = key_length;
uint nod_flag = _ma_test_if_nod(page_buf);
- byte *k;
- byte *last = rt_PAGE_END(page_buf);
+ uchar *k;
+ uchar *last = rt_PAGE_END(page_buf);
for (; (int)key_length > 0; keyseg += 2)
{
diff --git a/storage/maria/ma_rt_mbr.h b/storage/maria/ma_rt_mbr.h
index 01da74418a6..ad855518e62 100644
--- a/storage/maria/ma_rt_mbr.h
+++ b/storage/maria/ma_rt_mbr.h
@@ -19,20 +19,20 @@
#ifdef HAVE_RTREE_KEYS
-int maria_rtree_key_cmp(HA_KEYSEG *keyseg, byte *a, byte *b, uint key_length,
+int maria_rtree_key_cmp(HA_KEYSEG *keyseg, uchar *a, uchar *b, uint key_length,
uint nextflag);
-int maria_rtree_combine_rect(HA_KEYSEG *keyseg,byte *, byte *, byte*,
+int maria_rtree_combine_rect(HA_KEYSEG *keyseg,uchar *, uchar *, uchar*,
uint key_length);
-double maria_rtree_rect_volume(HA_KEYSEG *keyseg, byte*, uint key_length);
-int maria_rtree_d_mbr(HA_KEYSEG *keyseg, byte *a, uint key_length,
+double maria_rtree_rect_volume(HA_KEYSEG *keyseg, uchar*, uint key_length);
+int maria_rtree_d_mbr(HA_KEYSEG *keyseg, uchar *a, uint key_length,
double *res);
-double maria_rtree_overlapping_area(HA_KEYSEG *keyseg, byte *a, byte *b,
+double maria_rtree_overlapping_area(HA_KEYSEG *keyseg, uchar *a, uchar *b,
uint key_length);
-double maria_rtree_area_increase(HA_KEYSEG *keyseg, byte *a, byte *b,
+double maria_rtree_area_increase(HA_KEYSEG *keyseg, uchar *a, uchar *b,
uint key_length, double *ab_area);
-double maria_rtree_perimeter_increase(HA_KEYSEG *keyseg, byte* a, byte* b,
+double maria_rtree_perimeter_increase(HA_KEYSEG *keyseg, uchar* a, uchar* b,
uint key_length, double *ab_perim);
-int maria_rtree_page_mbr(MARIA_HA *info, HA_KEYSEG *keyseg, byte *page_buf,
- byte* c, uint key_length);
+int maria_rtree_page_mbr(MARIA_HA *info, HA_KEYSEG *keyseg, uchar *page_buf,
+ uchar* c, uint key_length);
#endif /*HAVE_RTREE_KEYS*/
#endif /* _rt_mbr_h */
diff --git a/storage/maria/ma_rt_split.c b/storage/maria/ma_rt_split.c
index 6a66c4424eb..9d195d802c1 100644
--- a/storage/maria/ma_rt_split.c
+++ b/storage/maria/ma_rt_split.c
@@ -26,7 +26,7 @@ typedef struct
{
double square;
int n_node;
- byte *key;
+ uchar *key;
double *coords;
} SplitStruct;
@@ -247,7 +247,7 @@ static int split_maria_rtree_node(SplitStruct *node, int n_entries,
}
int maria_rtree_split_page(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- byte *page, byte *key,
+ uchar *page, uchar *key,
uint key_length, my_off_t *new_page_offs)
{
int n1, n2; /* Number of items in groups */
@@ -259,8 +259,8 @@ int maria_rtree_split_page(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
double *next_coord;
double *old_coord;
int n_dim;
- byte *source_cur, *cur1, *cur2;
- byte *new_page;
+ uchar *source_cur, *cur1, *cur2;
+ uchar *new_page;
int err_code= 0;
uint nod_flag= _ma_test_if_nod(page);
uint full_length= key_length + (nod_flag ? nod_flag :
@@ -304,7 +304,7 @@ int maria_rtree_split_page(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
goto split_err;
}
- if (!(new_page = (byte*) my_alloca((uint)keyinfo->block_length)))
+ if (!(new_page = (uchar*) my_alloca((uint)keyinfo->block_length)))
{
err_code= -1;
goto split_err;
@@ -317,7 +317,7 @@ int maria_rtree_split_page(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
n1= n2 = 0;
for (cur = task; cur < stop; ++cur)
{
- byte *to;
+ uchar *to;
if (cur->n_node == 1)
{
to = cur1;
@@ -344,10 +344,10 @@ int maria_rtree_split_page(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
err_code= _ma_write_keypage(info, keyinfo, *new_page_offs,
DFLT_INIT_HITS, new_page);
- my_afree((byte*)new_page);
+ my_afree((uchar*)new_page);
split_err:
- my_afree((byte*) coord_buf);
+ my_afree((uchar*) coord_buf);
return err_code;
}
diff --git a/storage/maria/ma_scan.c b/storage/maria/ma_scan.c
index 4ed4027378e..f9657833fdd 100644
--- a/storage/maria/ma_scan.c
+++ b/storage/maria/ma_scan.c
@@ -45,7 +45,7 @@ int maria_scan_init(register MARIA_HA *info)
# Error code
*/
-int maria_scan(MARIA_HA *info, byte *record)
+int maria_scan(MARIA_HA *info, uchar *record)
{
DBUG_ENTER("maria_scan");
/* Init all but update-flag */
diff --git a/storage/maria/ma_search.c b/storage/maria/ma_search.c
index f3e7a0d542a..1a7263e6a5a 100644
--- a/storage/maria/ma_search.c
+++ b/storage/maria/ma_search.c
@@ -19,8 +19,8 @@
#include "m_ctype.h"
static my_bool _ma_get_prev_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- byte *page,
- byte *key, byte *keypos,
+ uchar *page,
+ uchar *key, uchar *keypos,
uint *return_key_length);
/* Check index */
@@ -55,13 +55,13 @@ int _ma_check_index(MARIA_HA *info, int inx)
*/
int _ma_search(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
- byte *key, uint key_len, uint nextflag, register my_off_t pos)
+ uchar *key, uint key_len, uint nextflag, register my_off_t pos)
{
my_bool last_key;
int error,flag;
uint nod_flag;
- byte *keypos,*maxpos;
- byte lastkey[HA_MAX_KEY_BUFF],*buff;
+ uchar *keypos,*maxpos;
+ uchar lastkey[HA_MAX_KEY_BUFF],*buff;
DBUG_ENTER("_ma_search");
DBUG_PRINT("enter",("pos: %lu nextflag: %u lastpos: %lu",
(ulong) pos, nextflag, (ulong) info->cur_row.lastpos));
@@ -119,7 +119,7 @@ int _ma_search(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
}
if (pos != info->last_keypage)
{
- byte *old_buff=buff;
+ uchar *old_buff=buff;
if (!(buff= _ma_fetch_keypage(info,keyinfo,pos,DFLT_INIT_HITS,
info->keyread_buff,
test(!(nextflag & SEARCH_SAVE_BUFF)))))
@@ -175,9 +175,9 @@ err:
/* ret_pos point to where find or bigger key starts */
/* ARGSUSED */
-int _ma_bin_search(MARIA_HA *info, register MARIA_KEYDEF *keyinfo, byte *page,
- byte *key, uint key_len, uint comp_flag, byte **ret_pos,
- byte *buff __attribute__((unused)), my_bool *last_key)
+int _ma_bin_search(MARIA_HA *info, register MARIA_KEYDEF *keyinfo, uchar *page,
+ uchar *key, uint key_len, uint comp_flag, uchar **ret_pos,
+ uchar *buff __attribute__((unused)), my_bool *last_key)
{
reg4 int start,mid,end,save_end;
int flag;
@@ -239,13 +239,13 @@ int _ma_bin_search(MARIA_HA *info, register MARIA_KEYDEF *keyinfo, byte *page,
< 0 Not found.
*/
-int _ma_seq_search(MARIA_HA *info, register MARIA_KEYDEF *keyinfo, byte *page,
- byte *key, uint key_len, uint comp_flag, byte **ret_pos,
- byte *buff, my_bool *last_key)
+int _ma_seq_search(MARIA_HA *info, register MARIA_KEYDEF *keyinfo, uchar *page,
+ uchar *key, uint key_len, uint comp_flag, uchar **ret_pos,
+ uchar *buff, my_bool *last_key)
{
int flag;
uint nod_flag,length,not_used[2];
- byte t_buff[HA_MAX_KEY_BUFF],*end;
+ uchar t_buff[HA_MAX_KEY_BUFF],*end;
DBUG_ENTER("_ma_seq_search");
LINT_INIT(flag); LINT_INIT(length);
@@ -285,8 +285,8 @@ int _ma_seq_search(MARIA_HA *info, register MARIA_KEYDEF *keyinfo, byte *page,
int _ma_prefix_search(MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
- byte *page, byte *key, uint key_len, uint nextflag,
- byte **ret_pos, byte *buff, my_bool *last_key)
+ uchar *page, uchar *key, uint key_len, uint nextflag,
+ uchar **ret_pos, uchar *buff, my_bool *last_key)
{
/*
my_flag is raw comparison result to be changed according to
@@ -297,11 +297,11 @@ int _ma_prefix_search(MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
uint nod_flag, length, len, matched, cmplen, kseg_len;
uint prefix_len,suffix_len;
int key_len_skip, seg_len_pack, key_len_left;
- byte *end;
+ uchar *end;
uchar *kseg, *vseg, *saved_vseg, *saved_from;
uchar *sort_order= keyinfo->seg->charset->sort_order;
- byte tt_buff[HA_MAX_KEY_BUFF+2], *t_buff=tt_buff+2;
- byte *saved_to;
+ uchar tt_buff[HA_MAX_KEY_BUFF+2], *t_buff=tt_buff+2;
+ uchar *saved_to;
uint saved_length=0, saved_prefix_len=0;
uint length_pack;
DBUG_ENTER("_ma_prefix_search");
@@ -331,7 +331,7 @@ int _ma_prefix_search(MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
Keys are compressed the following way:
If the max length of first key segment <= 127 bytes the prefix is
- 1 byte else it's 2 byte
+ 1 uchar else it's 2 byte
(prefix) length The high bit is set if this is a prefix for the prev key.
[suffix length] Packed length of suffix if the previous was a prefix.
@@ -412,7 +412,7 @@ int _ma_prefix_search(MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
from+=l;
}
from+= keyseg->length;
- page= (byte*) from+nod_flag;
+ page= (uchar*) from+nod_flag;
length= (uint) (from-vseg);
}
@@ -496,7 +496,7 @@ int _ma_prefix_search(MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
/* We have to compare k and vseg as if they were space extended */
for (vseg_end= vseg + (len-cmplen) ;
- vseg < vseg_end && *vseg == (byte) ' ';
+ vseg < vseg_end && *vseg == (uchar) ' ';
vseg++, matched++) ;
DBUG_ASSERT(vseg < vseg_end);
@@ -552,7 +552,7 @@ int _ma_prefix_search(MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
saved_length=length;
}
if (saved_length)
- memcpy(saved_to, (byte*) saved_from, saved_length);
+ memcpy(saved_to, (uchar*) saved_from, saved_length);
*last_key= page == end;
@@ -563,7 +563,7 @@ int _ma_prefix_search(MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
/* Get pos to a key_block */
-my_off_t _ma_kpos(uint nod_flag, byte *after_key)
+my_off_t _ma_kpos(uint nod_flag, uchar *after_key)
{
after_key-=nod_flag;
switch (nod_flag) {
@@ -599,7 +599,7 @@ my_off_t _ma_kpos(uint nod_flag, byte *after_key)
/* Save pos to a key_block */
-void _ma_kpointer(register MARIA_HA *info, register byte *buff, my_off_t pos)
+void _ma_kpointer(register MARIA_HA *info, register uchar *buff, my_off_t pos)
{
pos/=MARIA_MIN_KEY_BLOCK_LENGTH;
switch (info->s->base.key_reflength) {
@@ -618,7 +618,7 @@ void _ma_kpointer(register MARIA_HA *info, register byte *buff, my_off_t pos)
case 4: mi_int4store(buff,pos); break;
case 3: mi_int3store(buff,pos); break;
case 2: mi_int2store(buff,(uint) pos); break;
- case 1: buff[0]= (byte) pos; break;
+ case 1: buff[0]= (uchar) pos; break;
default: abort(); /* impossible */
}
} /* _ma_kpointer */
@@ -627,7 +627,7 @@ void _ma_kpointer(register MARIA_HA *info, register byte *buff, my_off_t pos)
/* Calc pos to a data-record from a key */
-my_off_t _ma_dpos(MARIA_HA *info, uint nod_flag, const byte *after_key)
+my_off_t _ma_dpos(MARIA_HA *info, uint nod_flag, const uchar *after_key)
{
my_off_t pos;
after_key-=(nod_flag + info->s->rec_reflength);
@@ -656,7 +656,7 @@ my_off_t _ma_dpos(MARIA_HA *info, uint nod_flag, const byte *after_key)
/* Calc position from a record pointer ( in delete link chain ) */
-my_off_t _ma_rec_pos(MARIA_SHARE *s, byte *ptr)
+my_off_t _ma_rec_pos(MARIA_SHARE *s, uchar *ptr)
{
my_off_t pos;
switch (s->rec_reflength) {
@@ -713,7 +713,7 @@ my_off_t _ma_rec_pos(MARIA_SHARE *s, byte *ptr)
/* save position to record */
-void _ma_dpointer(MARIA_HA *info, byte *buff, my_off_t pos)
+void _ma_dpointer(MARIA_HA *info, uchar *buff, my_off_t pos)
{
if (info->s->data_file_type == STATIC_RECORD &&
pos != HA_OFFSET_ERROR)
@@ -752,9 +752,9 @@ void _ma_dpointer(MARIA_HA *info, byte *buff, my_off_t pos)
/* same as _ma_get_key but used with fixed length keys */
uint _ma_get_static_key(register MARIA_KEYDEF *keyinfo, uint nod_flag,
- register byte **page, register byte *key)
+ register uchar **page, register uchar *key)
{
- memcpy((byte*) key,(byte*) *page,
+ memcpy((uchar*) key,(uchar*) *page,
(size_t) (keyinfo->keylength+nod_flag));
*page+=keyinfo->keylength+nod_flag;
return(keyinfo->keylength);
@@ -776,10 +776,10 @@ uint _ma_get_static_key(register MARIA_KEYDEF *keyinfo, uint nod_flag,
*/
uint _ma_get_pack_key(register MARIA_KEYDEF *keyinfo, uint nod_flag,
- register byte **page_pos, register byte *key)
+ register uchar **page_pos, register uchar *key)
{
reg1 HA_KEYSEG *keyseg;
- byte *start_key,*page=*page_pos;
+ uchar *start_key,*page=*page_pos;
uint length;
start_key=key;
@@ -788,7 +788,7 @@ uint _ma_get_pack_key(register MARIA_KEYDEF *keyinfo, uint nod_flag,
if (keyseg->flag & HA_PACK_KEY)
{
/* key with length, packed to previous key */
- byte *start= key;
+ uchar *start= key;
uint packed= *page & 128,tot_length,rest_length;
if (keyseg->length >= 127)
{
@@ -891,19 +891,19 @@ uint _ma_get_pack_key(register MARIA_KEYDEF *keyinfo, uint nod_flag,
if (keyseg->flag &
(HA_VAR_LENGTH_PART | HA_BLOB_PART | HA_SPACE_PACK))
{
- byte *tmp=page;
+ uchar *tmp=page;
get_key_length(length,tmp);
length+=(uint) (tmp-page);
}
else
length=keyseg->length;
}
- memcpy((byte*) key,(byte*) page,(size_t) length);
+ memcpy((uchar*) key,(uchar*) page,(size_t) length);
key+=length;
page+=length;
}
length=keyseg->length+nod_flag;
- bmove((byte*) key,(byte*) page,length);
+ bmove((uchar*) key,(uchar*) page,length);
*page_pos= page+length;
return ((uint) (key-start_key)+keyseg->length);
} /* _ma_get_pack_key */
@@ -913,10 +913,10 @@ uint _ma_get_pack_key(register MARIA_KEYDEF *keyinfo, uint nod_flag,
/* key that is packed relatively to previous */
uint _ma_get_binary_pack_key(register MARIA_KEYDEF *keyinfo, uint nod_flag,
- register byte **page_pos, register byte *key)
+ register uchar **page_pos, register uchar *key)
{
reg1 HA_KEYSEG *keyseg;
- byte *start_key,*page,*page_end,*from,*from_end;
+ uchar *start_key,*page,*page_end,*from,*from_end;
uint length,tmp;
DBUG_ENTER("_ma_get_binary_pack_key");
@@ -990,7 +990,7 @@ uint _ma_get_binary_pack_key(register MARIA_KEYDEF *keyinfo, uint nod_flag,
DBUG_ASSERT((int) length >= 0);
DBUG_PRINT("info",("key: 0x%lx from: 0x%lx length: %u",
(long) key, (long) from, length));
- memmove((byte*) key, (byte*) from, (size_t) length);
+ memmove((uchar*) key, (uchar*) from, (size_t) length);
key+=length;
from+=length;
}
@@ -1009,7 +1009,7 @@ uint _ma_get_binary_pack_key(register MARIA_KEYDEF *keyinfo, uint nod_flag,
my_errno=HA_ERR_CRASHED;
DBUG_RETURN(0); /* Error */
}
- memcpy((byte*) key,(byte*) from,(size_t) length);
+ memcpy((uchar*) key,(uchar*) from,(size_t) length);
*page_pos= from+length;
}
DBUG_RETURN((uint) (key-start_key)+keyseg->length);
@@ -1019,8 +1019,8 @@ uint _ma_get_binary_pack_key(register MARIA_KEYDEF *keyinfo, uint nod_flag,
/* Get key at position without knowledge of previous key */
/* Returns pointer to next key */
-byte *_ma_get_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo, byte *page,
- byte *key, byte *keypos, uint *return_key_length)
+uchar *_ma_get_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo, uchar *page,
+ uchar *key, uchar *keypos, uint *return_key_length)
{
uint nod_flag;
DBUG_ENTER("_ma_get_key");
@@ -1028,7 +1028,7 @@ byte *_ma_get_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo, byte *page,
nod_flag=_ma_test_if_nod(page);
if (! (keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY)))
{
- bmove((byte*) key,(byte*) keypos,keyinfo->keylength+nod_flag);
+ bmove((uchar*) key,(uchar*) keypos,keyinfo->keylength+nod_flag);
DBUG_RETURN(keypos+keyinfo->keylength+nod_flag);
}
else
@@ -1056,7 +1056,7 @@ byte *_ma_get_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo, byte *page,
/* Returns 0 if ok */
static my_bool _ma_get_prev_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- byte *page, byte *key, byte *keypos,
+ uchar *page, uchar *key, uchar *keypos,
uint *return_key_length)
{
uint nod_flag;
@@ -1066,7 +1066,7 @@ static my_bool _ma_get_prev_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
if (! (keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY)))
{
*return_key_length=keyinfo->keylength;
- bmove((byte*) key,(byte*) keypos- *return_key_length-nod_flag,
+ bmove((uchar*) key,(uchar*) keypos- *return_key_length-nod_flag,
*return_key_length);
DBUG_RETURN(0);
}
@@ -1093,11 +1093,11 @@ static my_bool _ma_get_prev_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
/* Get last key from key-page */
/* Return pointer to where key starts */
-byte *_ma_get_last_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo, byte *page,
- byte *lastkey, byte *endpos, uint *return_key_length)
+uchar *_ma_get_last_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo, uchar *page,
+ uchar *lastkey, uchar *endpos, uint *return_key_length)
{
uint nod_flag;
- byte *lastpos;
+ uchar *lastpos;
DBUG_ENTER("_ma_get_last_key");
DBUG_PRINT("enter",("page: 0x%lx endpos: 0x%lx", (long) page,
(long) endpos));
@@ -1108,7 +1108,7 @@ byte *_ma_get_last_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo, byte *page,
lastpos=endpos-keyinfo->keylength-nod_flag;
*return_key_length=keyinfo->keylength;
if (lastpos > page)
- bmove((byte*) lastkey,(byte*) lastpos,keyinfo->keylength+nod_flag);
+ bmove((uchar*) lastkey,(uchar*) lastpos,keyinfo->keylength+nod_flag);
}
else
{
@@ -1136,10 +1136,10 @@ byte *_ma_get_last_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo, byte *page,
/* Calculate length of key */
-uint _ma_keylength(MARIA_KEYDEF *keyinfo, register const byte *key)
+uint _ma_keylength(MARIA_KEYDEF *keyinfo, register const uchar *key)
{
reg1 HA_KEYSEG *keyseg;
- const byte *start;
+ const uchar *start;
if (! (keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY)))
return (keyinfo->keylength);
@@ -1171,11 +1171,11 @@ uint _ma_keylength(MARIA_KEYDEF *keyinfo, register const byte *key)
after '0xDF' but find 'ss'
*/
-uint _ma_keylength_part(MARIA_KEYDEF *keyinfo, register const byte *key,
+uint _ma_keylength_part(MARIA_KEYDEF *keyinfo, register const uchar *key,
HA_KEYSEG *end)
{
reg1 HA_KEYSEG *keyseg;
- const byte *start= key;
+ const uchar *start= key;
for (keyseg=keyinfo->seg ; keyseg != end ; keyseg++)
{
@@ -1197,7 +1197,7 @@ uint _ma_keylength_part(MARIA_KEYDEF *keyinfo, register const byte *key,
/* Move a key */
-byte *_ma_move_key(MARIA_KEYDEF *keyinfo, byte *to, const byte *from)
+uchar *_ma_move_key(MARIA_KEYDEF *keyinfo, uchar *to, const uchar *from)
{
reg1 uint length;
memcpy(to, from, (size_t) (length= _ma_keylength(keyinfo, from)));
@@ -1213,11 +1213,11 @@ byte *_ma_move_key(MARIA_KEYDEF *keyinfo, byte *to, const byte *from)
*/
int _ma_search_next(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
- byte *key, uint key_length, uint nextflag, my_off_t pos)
+ uchar *key, uint key_length, uint nextflag, my_off_t pos)
{
int error;
uint nod_flag;
- byte lastkey[HA_MAX_KEY_BUFF];
+ uchar lastkey[HA_MAX_KEY_BUFF];
DBUG_ENTER("_ma_search_next");
DBUG_PRINT("enter",("nextflag: %u lastpos: %lu int_keypos: %lu page_changed %d keyread_buff_used: %d",
nextflag, (ulong) info->cur_row.lastpos,
@@ -1299,7 +1299,7 @@ int _ma_search_first(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
register my_off_t pos)
{
uint nod_flag;
- byte *page;
+ uchar *page;
DBUG_ENTER("_ma_search_first");
if (pos == HA_OFFSET_ERROR)
@@ -1343,7 +1343,7 @@ int _ma_search_last(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
register my_off_t pos)
{
uint nod_flag;
- byte *buff,*page;
+ uchar *buff,*page;
DBUG_ENTER("_ma_search_last");
if (pos == HA_OFFSET_ERROR)
@@ -1398,10 +1398,10 @@ int _ma_search_last(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
int
_ma_calc_static_key_length(MARIA_KEYDEF *keyinfo,uint nod_flag,
- byte *next_pos __attribute__((unused)),
- byte *org_key __attribute__((unused)),
- byte *prev_key __attribute__((unused)),
- const byte *key, MARIA_KEY_PARAM *s_temp)
+ uchar *next_pos __attribute__((unused)),
+ uchar *org_key __attribute__((unused)),
+ uchar *prev_key __attribute__((unused)),
+ const uchar *key, MARIA_KEY_PARAM *s_temp)
{
s_temp->key= key;
return (int) (s_temp->totlength=keyinfo->keylength+nod_flag);
@@ -1411,10 +1411,10 @@ _ma_calc_static_key_length(MARIA_KEYDEF *keyinfo,uint nod_flag,
int
_ma_calc_var_key_length(MARIA_KEYDEF *keyinfo,uint nod_flag,
- byte *next_pos __attribute__((unused)),
- byte *org_key __attribute__((unused)),
- byte *prev_key __attribute__((unused)),
- const byte *key, MARIA_KEY_PARAM *s_temp)
+ uchar *next_pos __attribute__((unused)),
+ uchar *org_key __attribute__((unused)),
+ uchar *prev_key __attribute__((unused)),
+ const uchar *key, MARIA_KEY_PARAM *s_temp)
{
s_temp->key= key;
return (int) (s_temp->totlength= _ma_keylength(keyinfo,key)+nod_flag);
@@ -1427,7 +1427,7 @@ _ma_calc_var_key_length(MARIA_KEYDEF *keyinfo,uint nod_flag,
Keys are compressed the following way:
If the max length of first key segment <= 127 bytes the prefix is
- 1 byte else it's 2 byte
+ 1 uchar else it's 2 byte
prefix byte(s) The high bit is set if this is a prefix for the prev key
length Packed length if the previous was a prefix byte
@@ -1441,15 +1441,15 @@ _ma_calc_var_key_length(MARIA_KEYDEF *keyinfo,uint nod_flag,
int
_ma_calc_var_pack_key_length(MARIA_KEYDEF *keyinfo, uint nod_flag,
- byte *next_key,
- byte *org_key, byte *prev_key, const byte *key,
+ uchar *next_key,
+ uchar *org_key, uchar *prev_key, const uchar *key,
MARIA_KEY_PARAM *s_temp)
{
reg1 HA_KEYSEG *keyseg;
int length;
uint key_length,ref_length,org_key_length=0,
length_pack,new_key_length,diff_flag,pack_marker;
- const byte *start,*end,*key_end;
+ const uchar *start,*end,*key_end;
uchar *sort_order;
bool same_length;
@@ -1726,9 +1726,9 @@ _ma_calc_var_pack_key_length(MARIA_KEYDEF *keyinfo, uint nod_flag,
/* Length of key which is prefix compressed */
int _ma_calc_bin_pack_key_length(MARIA_KEYDEF *keyinfo, uint nod_flag,
- byte *next_key,
- byte *org_key, byte *prev_key,
- const byte *key,
+ uchar *next_key,
+ uchar *org_key, uchar *prev_key,
+ const uchar *key,
MARIA_KEY_PARAM *s_temp)
{
uint length,key_length,ref_length;
@@ -1746,7 +1746,7 @@ int _ma_calc_bin_pack_key_length(MARIA_KEYDEF *keyinfo, uint nod_flag,
As keys may be identical when running a sort in maria_chk, we
have to guard against the case where keys may be identical
*/
- const byte *end;
+ const uchar *end;
end=key+key_length;
for ( ; *key == *prev_key && key < end; key++,prev_key++) ;
s_temp->ref_length= ref_length=(uint) (key-s_temp->key);
@@ -1767,7 +1767,7 @@ int _ma_calc_bin_pack_key_length(MARIA_KEYDEF *keyinfo, uint nod_flag,
/* If first key and next key is packed (only on delete) */
if (!prev_key && org_key && next_length)
{
- const byte *end;
+ const uchar *end;
for (key= s_temp->key, end=key+next_length ;
*key == *org_key && key < end;
key++,org_key++) ;
@@ -1809,10 +1809,10 @@ int _ma_calc_bin_pack_key_length(MARIA_KEYDEF *keyinfo, uint nod_flag,
/* store key without compression */
void _ma_store_static_key(MARIA_KEYDEF *keyinfo __attribute__((unused)),
- register byte *key_pos,
+ register uchar *key_pos,
register MARIA_KEY_PARAM *s_temp)
{
- memcpy((byte*) key_pos,(byte*) s_temp->key,(size_t) s_temp->totlength);
+ memcpy((uchar*) key_pos,(uchar*) s_temp->key,(size_t) s_temp->totlength);
}
@@ -1824,11 +1824,11 @@ void _ma_store_static_key(MARIA_KEYDEF *keyinfo __attribute__((unused)),
void _ma_store_var_pack_key(MARIA_KEYDEF *keyinfo __attribute__((unused)),
- register byte *key_pos,
+ register uchar *key_pos,
register MARIA_KEY_PARAM *s_temp)
{
uint length;
- byte *start;
+ uchar *start;
start=key_pos;
@@ -1845,7 +1845,7 @@ void _ma_store_var_pack_key(MARIA_KEYDEF *keyinfo __attribute__((unused)),
/* Not packed against previous key */
store_pack_length(s_temp->pack_marker == 128,key_pos,s_temp->key_length);
}
- bmove((byte*) key_pos,(byte*) s_temp->key,
+ bmove((uchar*) key_pos,(uchar*) s_temp->key,
(length=s_temp->totlength-(uint) (key_pos-start)));
if (!s_temp->next_key_pos) /* No following key */
@@ -1887,7 +1887,7 @@ void _ma_store_var_pack_key(MARIA_KEYDEF *keyinfo __attribute__((unused)),
/* variable length key with prefix compression */
void _ma_store_bin_pack_key(MARIA_KEYDEF *keyinfo __attribute__((unused)),
- register byte *key_pos,
+ register uchar *key_pos,
register MARIA_KEY_PARAM *s_temp)
{
store_key_length_inc(key_pos,s_temp->ref_length);
diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c
index d6256deb39c..bc2b75807d9 100644
--- a/storage/maria/ma_sort.c
+++ b/storage/maria/ma_sort.c
@@ -48,31 +48,31 @@ extern void print_error _VARARGS((const char *fmt,...));
/* Functions defined in this file */
static ha_rows NEAR_F find_all_keys(MARIA_SORT_PARAM *info,uint keys,
- byte **sort_keys,
+ uchar **sort_keys,
DYNAMIC_ARRAY *buffpek,int *maxbuffer,
IO_CACHE *tempfile,
IO_CACHE *tempfile_for_exceptions);
-static int NEAR_F write_keys(MARIA_SORT_PARAM *info, byte **sort_keys,
+static int NEAR_F write_keys(MARIA_SORT_PARAM *info, uchar **sort_keys,
uint count, BUFFPEK *buffpek,IO_CACHE *tempfile);
-static int NEAR_F write_key(MARIA_SORT_PARAM *info, byte *key,
+static int NEAR_F write_key(MARIA_SORT_PARAM *info, uchar *key,
IO_CACHE *tempfile);
-static int NEAR_F write_index(MARIA_SORT_PARAM *info, byte **sort_keys,
+static int NEAR_F write_index(MARIA_SORT_PARAM *info, uchar **sort_keys,
uint count);
static int NEAR_F merge_many_buff(MARIA_SORT_PARAM *info,uint keys,
- byte **sort_keys,
+ uchar **sort_keys,
BUFFPEK *buffpek,int *maxbuffer,
IO_CACHE *t_file);
static uint NEAR_F read_to_buffer(IO_CACHE *fromfile,BUFFPEK *buffpek,
uint sort_length);
static int NEAR_F merge_buffers(MARIA_SORT_PARAM *info,uint keys,
IO_CACHE *from_file, IO_CACHE *to_file,
- byte **sort_keys, BUFFPEK *lastbuff,
+ uchar **sort_keys, BUFFPEK *lastbuff,
BUFFPEK *Fb, BUFFPEK *Tb);
-static int NEAR_F merge_index(MARIA_SORT_PARAM *,uint, byte **,BUFFPEK *, int,
+static int NEAR_F merge_index(MARIA_SORT_PARAM *,uint, uchar **,BUFFPEK *, int,
IO_CACHE *);
static int flush_maria_ft_buf(MARIA_SORT_PARAM *info);
-static int NEAR_F write_keys_varlen(MARIA_SORT_PARAM *info, byte **sort_keys,
+static int NEAR_F write_keys_varlen(MARIA_SORT_PARAM *info, uchar **sort_keys,
uint count, BUFFPEK *buffpek,
IO_CACHE *tempfile);
static uint NEAR_F read_to_buffer_varlen(IO_CACHE *fromfile,BUFFPEK *buffpek,
@@ -84,7 +84,7 @@ static int NEAR_F write_merge_key_varlen(MARIA_SORT_PARAM *info,
char* key, uint sort_length,
uint count);
static inline int
-my_var_write(MARIA_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs);
+my_var_write(MARIA_SORT_PARAM *info, IO_CACHE *to_file, uchar *bufs);
/*
Creates a index of sorted keys
@@ -107,7 +107,7 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
uint memavl,old_memavl,keys,sort_length;
DYNAMIC_ARRAY buffpek;
ha_rows records;
- byte **sort_keys;
+ uchar **sort_keys;
IO_CACHE tempfile, tempfile_for_exceptions;
DBUG_ENTER("_ma_create_index_by_sort");
DBUG_PRINT("enter",("sort_length: %d", info->key_length));
@@ -128,7 +128,7 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
my_b_clear(&tempfile);
my_b_clear(&tempfile_for_exceptions);
bzero((char*) &buffpek,sizeof(buffpek));
- sort_keys= (byte **) NULL; error= 1;
+ sort_keys= (uchar **) NULL; error= 1;
maxbuffer=1;
memavl=max(sortbuff_size,MIN_SORT_MEMORY);
@@ -157,13 +157,13 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
}
while ((maxbuffer= (int) (records/(keys-1)+1)) != skr);
- if ((sort_keys=(byte**) my_malloc(keys*(sort_length+sizeof(char*))+
+ if ((sort_keys=(uchar**) my_malloc(keys*(sort_length+sizeof(char*))+
HA_FT_MAXBYTELEN, MYF(0))))
{
if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer,
maxbuffer/2))
{
- my_free((gptr) sort_keys,MYF(0));
+ my_free((uchar*) sort_keys,MYF(0));
sort_keys= 0;
}
else
@@ -230,12 +230,12 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
reinit_io_cache(&tempfile_for_exceptions,READ_CACHE,0L,0,0))
goto err;
- while (!my_b_read(&tempfile_for_exceptions,(byte*)&key_length,
+ while (!my_b_read(&tempfile_for_exceptions,(uchar*)&key_length,
sizeof(key_length))
- && !my_b_read(&tempfile_for_exceptions,(byte*)sort_keys,
+ && !my_b_read(&tempfile_for_exceptions,(uchar*)sort_keys,
(uint) key_length))
{
- if (_ma_ck_write(idx,keyno,(byte*) sort_keys,key_length-ref_length))
+ if (_ma_ck_write(idx,keyno,(uchar*) sort_keys,key_length-ref_length))
goto err;
}
}
@@ -244,7 +244,7 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
err:
if (sort_keys)
- my_free((gptr) sort_keys,MYF(0));
+ my_free((uchar*) sort_keys,MYF(0));
delete_dynamic(&buffpek);
close_cached_file(&tempfile);
close_cached_file(&tempfile_for_exceptions);
@@ -256,7 +256,7 @@ err:
/* Search after all keys and place them in a temp. file */
static ha_rows NEAR_F find_all_keys(MARIA_SORT_PARAM *info, uint keys,
- byte **sort_keys, DYNAMIC_ARRAY *buffpek,
+ uchar **sort_keys, DYNAMIC_ARRAY *buffpek,
int *maxbuffer, IO_CACHE *tempfile,
IO_CACHE *tempfile_for_exceptions)
{
@@ -265,7 +265,7 @@ static ha_rows NEAR_F find_all_keys(MARIA_SORT_PARAM *info, uint keys,
DBUG_ENTER("find_all_keys");
idx=error=0;
- sort_keys[0]= (byte*) (sort_keys+keys);
+ sort_keys[0]= (uchar*) (sort_keys+keys);
while (!(error=(*info->key_read)(info,sort_keys[idx])))
{
@@ -283,7 +283,7 @@ static ha_rows NEAR_F find_all_keys(MARIA_SORT_PARAM *info, uint keys,
tempfile))
DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */
- sort_keys[0]=(byte*) (sort_keys+keys);
+ sort_keys[0]=(uchar*) (sort_keys+keys);
memcpy(sort_keys[0],sort_keys[idx-1],(size_t) info->key_length);
idx=1;
}
@@ -314,7 +314,7 @@ pthread_handler_t _ma_thr_find_all_keys(void *arg)
int error;
uint memavl,old_memavl,keys,sort_length;
uint idx, maxbuffer;
- byte **sort_keys=0;
+ uchar **sort_keys=0;
LINT_INIT(keys);
@@ -375,7 +375,7 @@ pthread_handler_t _ma_thr_find_all_keys(void *arg)
}
while ((maxbuffer= (int) (idx/(keys-1)+1)) != skr);
}
- if ((sort_keys= (byte **)
+ if ((sort_keys= (uchar **)
my_malloc(keys*(sort_length+sizeof(char*))+
((sort_param->keyinfo->flag & HA_FULLTEXT) ?
HA_FT_MAXBYTELEN : 0), MYF(0))))
@@ -383,8 +383,8 @@ pthread_handler_t _ma_thr_find_all_keys(void *arg)
if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK),
maxbuffer, maxbuffer/2))
{
- my_free((gptr) sort_keys,MYF(0));
- sort_keys= (byte **) NULL; /* for err: label */
+ my_free((uchar*) sort_keys,MYF(0));
+ sort_keys= (uchar **) NULL; /* for err: label */
}
else
break;
@@ -407,7 +407,7 @@ pthread_handler_t _ma_thr_find_all_keys(void *arg)
sort_param->sort_keys= sort_keys;
idx= error= 0;
- sort_keys[0]= (byte*) (sort_keys+keys);
+ sort_keys[0]= (uchar*) (sort_keys+keys);
DBUG_PRINT("info", ("reading keys"));
while (!(error= sort_param->sort_info->got_error) &&
@@ -428,7 +428,7 @@ pthread_handler_t _ma_thr_find_all_keys(void *arg)
buffpek),
&sort_param->tempfile))
goto err;
- sort_keys[0]= (byte*) (sort_keys+keys);
+ sort_keys[0]= (uchar*) (sort_keys+keys);
memcpy(sort_keys[0], sort_keys[idx - 1],
(size_t) sort_param->key_length);
idx= 1;
@@ -455,7 +455,7 @@ pthread_handler_t _ma_thr_find_all_keys(void *arg)
err:
DBUG_PRINT("error", ("got some error"));
sort_param->sort_info->got_error= 1; /* no need to protect with a mutex */
- my_free((gptr) sort_keys,MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) sort_keys,MYF(MY_ALLOW_ZERO_PTR));
sort_param->sort_keys=0;
delete_dynamic(& sort_param->buffpek);
close_cached_file(&sort_param->tempfile);
@@ -497,7 +497,7 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param)
MARIA_HA *info=sort_info->info;
MARIA_SHARE *share=info->s;
MARIA_SORT_PARAM *sinfo;
- byte *mergebuf=0;
+ uchar *mergebuf=0;
DBUG_ENTER("_ma_thr_write_keys");
LINT_INIT(length);
@@ -532,7 +532,7 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param)
sinfo->notnull: NULL,
(ulonglong) info->state->records);
}
- my_free((gptr) sinfo->sort_keys,MYF(0));
+ my_free((uchar*) sinfo->sort_keys,MYF(0));
my_free(sinfo->rec_buff, MYF(MY_ALLOW_ZERO_PTR));
sinfo->sort_keys=0;
}
@@ -581,7 +581,7 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param)
{
if (param->testflag & T_VERBOSE)
printf("Key %d - Merging %u keys\n",sinfo->key+1, sinfo->keys);
- if (merge_many_buff(sinfo, keys, (byte **) mergebuf,
+ if (merge_many_buff(sinfo, keys, (uchar **) mergebuf,
dynamic_element(&sinfo->buffpek, 0, BUFFPEK *),
(int*) &maxbuffer, &sinfo->tempfile))
{
@@ -597,7 +597,7 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param)
}
if (param->testflag & T_VERBOSE)
printf("Key %d - Last merge and dumping keys\n", sinfo->key+1);
- if (merge_index(sinfo, keys, (byte**) mergebuf,
+ if (merge_index(sinfo, keys, (uchar**) mergebuf,
dynamic_element(&sinfo->buffpek,0,BUFFPEK *),
maxbuffer,&sinfo->tempfile) ||
flush_maria_ft_buf(sinfo) ||
@@ -622,12 +622,12 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param)
}
while (!got_error &&
- !my_b_read(&sinfo->tempfile_for_exceptions,(byte*)&key_length,
+ !my_b_read(&sinfo->tempfile_for_exceptions,(uchar*)&key_length,
sizeof(key_length)))
{
- byte maria_ft_buf[HA_FT_MAXBYTELEN + HA_FT_WLEN + 10];
+ uchar maria_ft_buf[HA_FT_MAXBYTELEN + HA_FT_WLEN + 10];
if (key_length > sizeof(maria_ft_buf) ||
- my_b_read(&sinfo->tempfile_for_exceptions, (byte*)maria_ft_buf,
+ my_b_read(&sinfo->tempfile_for_exceptions, (uchar*)maria_ft_buf,
(uint)key_length) ||
_ma_ck_write(info, sinfo->key, maria_ft_buf,
key_length - info->s->rec_reflength))
@@ -635,21 +635,21 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param)
}
}
}
- my_free((gptr) mergebuf,MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) mergebuf,MYF(MY_ALLOW_ZERO_PTR));
DBUG_RETURN(got_error);
}
#endif /* THREAD */
/* Write all keys in memory to file for later merge */
-static int write_keys(MARIA_SORT_PARAM *info, register byte **sort_keys,
+static int write_keys(MARIA_SORT_PARAM *info, register uchar **sort_keys,
uint count, BUFFPEK *buffpek, IO_CACHE *tempfile)
{
- byte **end;
+ uchar **end;
uint sort_length=info->key_length;
DBUG_ENTER("write_keys");
- qsort2((byte*) sort_keys,count,sizeof(byte*),(qsort2_cmp) info->key_cmp,
+ qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp,
info);
if (!my_b_inited(tempfile) &&
open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST",
@@ -669,13 +669,13 @@ static int write_keys(MARIA_SORT_PARAM *info, register byte **sort_keys,
static inline int
-my_var_write(MARIA_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs)
+my_var_write(MARIA_SORT_PARAM *info, IO_CACHE *to_file, uchar *bufs)
{
int err;
uint16 len= _ma_keylength(info->keyinfo, bufs);
/* The following is safe as this is a local file */
- if ((err= my_b_write(to_file, (byte*)&len, sizeof(len))))
+ if ((err= my_b_write(to_file, (uchar*)&len, sizeof(len))))
return (err);
if ((err= my_b_write(to_file,bufs, (uint) len)))
return (err);
@@ -684,15 +684,15 @@ my_var_write(MARIA_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs)
static int NEAR_F write_keys_varlen(MARIA_SORT_PARAM *info,
- register byte **sort_keys,
+ register uchar **sort_keys,
uint count, BUFFPEK *buffpek,
IO_CACHE *tempfile)
{
- byte **end;
+ uchar **end;
int err;
DBUG_ENTER("write_keys_varlen");
- qsort2((byte*) sort_keys,count,sizeof(byte*),(qsort2_cmp) info->key_cmp,
+ qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp,
info);
if (!my_b_inited(tempfile) &&
open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST",
@@ -710,7 +710,7 @@ static int NEAR_F write_keys_varlen(MARIA_SORT_PARAM *info,
} /* write_keys_varlen */
-static int NEAR_F write_key(MARIA_SORT_PARAM *info, byte *key,
+static int NEAR_F write_key(MARIA_SORT_PARAM *info, uchar *key,
IO_CACHE *tempfile)
{
uint key_length=info->real_key_length;
@@ -721,7 +721,7 @@ static int NEAR_F write_key(MARIA_SORT_PARAM *info, byte *key,
DISK_BUFFER_SIZE, info->sort_info->param->myf_rw))
DBUG_RETURN(1);
- if (my_b_write(tempfile, (byte*)&key_length,sizeof(key_length)) ||
+ if (my_b_write(tempfile, (uchar*)&key_length,sizeof(key_length)) ||
my_b_write(tempfile, key, (uint) key_length))
DBUG_RETURN(1);
DBUG_RETURN(0);
@@ -731,12 +731,12 @@ static int NEAR_F write_key(MARIA_SORT_PARAM *info, byte *key,
/* Write index */
static int NEAR_F write_index(MARIA_SORT_PARAM *info,
- register byte **sort_keys,
+ register uchar **sort_keys,
register uint count)
{
DBUG_ENTER("write_index");
- qsort2((gptr) sort_keys,(size_t) count,sizeof(byte*),
+ qsort2((uchar*) sort_keys,(size_t) count,sizeof(uchar*),
(qsort2_cmp) info->key_cmp,info);
while (count--)
{
@@ -750,7 +750,7 @@ static int NEAR_F write_index(MARIA_SORT_PARAM *info,
/* Merge buffers to make < MERGEBUFF2 buffers */
static int NEAR_F merge_many_buff(MARIA_SORT_PARAM *info, uint keys,
- byte **sort_keys, BUFFPEK *buffpek,
+ uchar **sort_keys, BUFFPEK *buffpek,
int *maxbuffer, IO_CACHE *t_file)
{
register int i;
@@ -814,7 +814,7 @@ static uint NEAR_F read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek,
if ((count=(uint) min((ha_rows) buffpek->max_keys,buffpek->count)))
{
- if (my_pread(fromfile->file,(byte*) buffpek->base,
+ if (my_pread(fromfile->file,(uchar*) buffpek->base,
(length= sort_length*count),buffpek->file_pos,MYF_RW))
return((uint) -1); /* purecov: inspected */
buffpek->key=buffpek->base;
@@ -831,7 +831,7 @@ static uint NEAR_F read_to_buffer_varlen(IO_CACHE *fromfile, BUFFPEK *buffpek,
register uint count;
uint16 length_of_key = 0;
uint idx;
- byte *buffp;
+ uchar *buffp;
if ((count=(uint) min((ha_rows) buffpek->max_keys,buffpek->count)))
{
@@ -839,11 +839,11 @@ static uint NEAR_F read_to_buffer_varlen(IO_CACHE *fromfile, BUFFPEK *buffpek,
for (idx=1;idx<=count;idx++)
{
- if (my_pread(fromfile->file,(byte*)&length_of_key,sizeof(length_of_key),
+ if (my_pread(fromfile->file,(uchar*)&length_of_key,sizeof(length_of_key),
buffpek->file_pos,MYF_RW))
return((uint) -1);
buffpek->file_pos+=sizeof(length_of_key);
- if (my_pread(fromfile->file,(byte*) buffp,length_of_key,
+ if (my_pread(fromfile->file,(uchar*) buffp,length_of_key,
buffpek->file_pos,MYF_RW))
return((uint) -1);
buffpek->file_pos+=length_of_key;
@@ -867,7 +867,7 @@ static int NEAR_F write_merge_key_varlen(MARIA_SORT_PARAM *info,
for (idx=1;idx<=count;idx++)
{
int err;
- if ((err= my_var_write(info,to_file, (byte*) bufs)))
+ if ((err= my_var_write(info,to_file, (uchar*) bufs)))
return (err);
bufs=bufs+sort_length;
}
@@ -879,7 +879,7 @@ static int NEAR_F write_merge_key(MARIA_SORT_PARAM *info __attribute__((unused))
IO_CACHE *to_file, char* key,
uint sort_length, uint count)
{
- return my_b_write(to_file,(byte*) key,(uint) sort_length*count);
+ return my_b_write(to_file,(uchar*) key,(uint) sort_length*count);
}
/*
@@ -889,14 +889,14 @@ static int NEAR_F write_merge_key(MARIA_SORT_PARAM *info __attribute__((unused))
static int NEAR_F
merge_buffers(MARIA_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
- IO_CACHE *to_file, byte **sort_keys, BUFFPEK *lastbuff,
+ IO_CACHE *to_file, uchar **sort_keys, BUFFPEK *lastbuff,
BUFFPEK *Fb, BUFFPEK *Tb)
{
int error;
uint sort_length,maxcount;
ha_rows count;
my_off_t to_start_filepos;
- byte *strpos;
+ uchar *strpos;
BUFFPEK *buffpek,**refpek;
QUEUE queue;
volatile int *killed= _ma_killed_ptr(info->sort_info->param);
@@ -907,11 +907,11 @@ merge_buffers(MARIA_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
LINT_INIT(to_start_filepos);
if (to_file)
to_start_filepos=my_b_tell(to_file);
- strpos= (byte*) sort_keys;
+ strpos= (uchar*) sort_keys;
sort_length=info->key_length;
if (init_queue(&queue,(uint) (Tb-Fb)+1,offsetof(BUFFPEK,key),0,
- (int (*)(void*, byte *,byte*)) info->key_cmp,
+ (int (*)(void*, uchar *,uchar*)) info->key_cmp,
(void*) info))
DBUG_RETURN(1); /* purecov: inspected */
@@ -938,7 +938,7 @@ merge_buffers(MARIA_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
buffpek=(BUFFPEK*) queue_top(&queue);
if (to_file)
{
- if (info->write_key(info,to_file,(byte*) buffpek->key,
+ if (info->write_key(info,to_file,(uchar*) buffpek->key,
(uint) sort_length,1))
{
error=1; goto err; /* purecov: inspected */
@@ -956,7 +956,7 @@ merge_buffers(MARIA_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
{
if (!(error=(int) info->read_to_buffer(from_file,buffpek,sort_length)))
{
- byte *base= buffpek->base;
+ uchar *base= buffpek->base;
uint max_keys=buffpek->max_keys;
VOID(queue_remove(&queue,0));
@@ -988,13 +988,13 @@ merge_buffers(MARIA_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
}
}
buffpek=(BUFFPEK*) queue_top(&queue);
- buffpek->base= (byte*) sort_keys;
+ buffpek->base= (uchar*) sort_keys;
buffpek->max_keys=keys;
do
{
if (to_file)
{
- if (info->write_key(info,to_file,(byte*) buffpek->key,
+ if (info->write_key(info,to_file,(uchar*) buffpek->key,
sort_length,buffpek->mem_count))
{
error=1; goto err; /* purecov: inspected */
@@ -1002,13 +1002,13 @@ merge_buffers(MARIA_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
}
else
{
- register byte *end;
+ register uchar *end;
strpos= buffpek->key;
for (end= strpos+buffpek->mem_count*sort_length;
strpos != end ;
strpos+=sort_length)
{
- if ((*info->key_write)(info, (byte*) strpos))
+ if ((*info->key_write)(info, (uchar*) strpos))
{
error=1; goto err; /* purecov: inspected */
}
@@ -1030,7 +1030,7 @@ err:
/* Do a merge to output-file (save only positions) */
static int NEAR_F
-merge_index(MARIA_SORT_PARAM *info, uint keys, byte **sort_keys,
+merge_index(MARIA_SORT_PARAM *info, uint keys, uchar **sort_keys,
BUFFPEK *buffpek, int maxbuffer, IO_CACHE *tempfile)
{
DBUG_ENTER("merge_index");
@@ -1047,7 +1047,7 @@ static int flush_maria_ft_buf(MARIA_SORT_PARAM *info)
if (info->sort_info->ft_buf)
{
err=_ma_sort_ft_buf_flush(info);
- my_free((gptr)info->sort_info->ft_buf, MYF(0));
+ my_free((uchar*)info->sort_info->ft_buf, MYF(0));
info->sort_info->ft_buf=0;
}
return err;
diff --git a/storage/maria/ma_sp_defs.h b/storage/maria/ma_sp_defs.h
index a2870bfa062..a70695bea3a 100644
--- a/storage/maria/ma_sp_defs.h
+++ b/storage/maria/ma_sp_defs.h
@@ -40,8 +40,8 @@ enum wkbByteOrder
wkbNDR = 1 /* Little Endian */
};
-uint _ma_sp_make_key(register MARIA_HA *info, uint keynr, byte *key,
- const byte *record, my_off_t filepos);
+uint _ma_sp_make_key(register MARIA_HA *info, uint keynr, uchar *key,
+ const uchar *record, my_off_t filepos);
#endif /*HAVE_SPATIAL*/
#endif /* _SP_DEFS_H */
diff --git a/storage/maria/ma_sp_key.c b/storage/maria/ma_sp_key.c
index 06769e97d30..1ea9b410ab6 100644
--- a/storage/maria/ma_sp_key.c
+++ b/storage/maria/ma_sp_key.c
@@ -31,25 +31,25 @@ static int sp_get_geometry_mbr(uchar *(*wkb), uchar *end, uint n_dims,
double *mbr, int top);
static int sp_mbr_from_wkb(uchar (*wkb), uint size, uint n_dims, double *mbr);
-static void get_double(double *d, const byte *pos)
+static void get_double(double *d, const uchar *pos)
{
float8get(*d, pos);
}
-uint _ma_sp_make_key(register MARIA_HA *info, uint keynr, byte *key,
- const byte *record, my_off_t filepos)
+uint _ma_sp_make_key(register MARIA_HA *info, uint keynr, uchar *key,
+ const uchar *record, my_off_t filepos)
{
HA_KEYSEG *keyseg;
MARIA_KEYDEF *keyinfo = &info->s->keyinfo[keynr];
uint len = 0;
- byte *pos;
+ uchar *pos;
uint dlen;
uchar *dptr;
double mbr[SPDIMS * 2];
uint i;
keyseg = &keyinfo->seg[-1];
- pos = (byte*)record + keyseg->start;
+ pos = (uchar*)record + keyseg->start;
dlen = _ma_calc_blob_length(keyseg->bit_start, pos);
memcpy_fixed(&dptr, pos + keyseg->bit_start, sizeof(char*));
@@ -64,7 +64,7 @@ uint _ma_sp_make_key(register MARIA_HA *info, uint keynr, byte *key,
{
uint length = keyseg->length;
- pos = ((byte*)mbr) + keyseg->start;
+ pos = ((uchar*)mbr) + keyseg->start;
if (keyseg->flag & HA_SWAP_KEY)
{
#ifdef HAVE_ISNAN
@@ -100,7 +100,7 @@ uint _ma_sp_make_key(register MARIA_HA *info, uint keynr, byte *key,
}
else
{
- memcpy((byte*)key, pos, length);
+ memcpy((uchar*)key, pos, length);
key += keyseg->length;
}
len += keyseg->length;
@@ -141,7 +141,7 @@ static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims,
{
if ((*wkb) > end - 8)
return -1;
- get_double(&ord, (const byte*) *wkb);
+ get_double(&ord, (const uchar*) *wkb);
(*wkb)+= 8;
if (ord < *mbr)
float8store((char*) mbr, ord);
diff --git a/storage/maria/ma_static.c b/storage/maria/ma_static.c
index 16bf0eca935..41b202491a7 100644
--- a/storage/maria/ma_static.c
+++ b/storage/maria/ma_static.c
@@ -57,7 +57,7 @@ PAGECACHE *maria_log_pagecache= &maria_log_pagecache_var;
TRN dummy_transaction_object;
/* Enough for comparing if number is zero */
-byte maria_zero_string[]= {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+uchar maria_zero_string[]= {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
/*
read_vec[] is used for converting between P_READ_KEY.. and SEARCH_
diff --git a/storage/maria/ma_statrec.c b/storage/maria/ma_statrec.c
index 8ca3a5e989d..b04b858c685 100644
--- a/storage/maria/ma_statrec.c
+++ b/storage/maria/ma_statrec.c
@@ -18,9 +18,9 @@
#include "maria_def.h"
-my_bool _ma_write_static_record(MARIA_HA *info, const byte *record)
+my_bool _ma_write_static_record(MARIA_HA *info, const uchar *record)
{
- byte temp[8]; /* max pointer length */
+ uchar temp[8]; /* max pointer length */
if (info->s->state.dellink != HA_OFFSET_ERROR &&
!info->append_insert_at_end)
{
@@ -48,14 +48,14 @@ my_bool _ma_write_static_record(MARIA_HA *info, const byte *record)
}
if (info->opt_flag & WRITE_CACHE_USED)
{ /* Cash in use */
- if (my_b_write(&info->rec_cache, (byte*) record,
+ if (my_b_write(&info->rec_cache, (uchar*) record,
info->s->base.reclength))
goto err;
if (info->s->base.pack_reclength != info->s->base.reclength)
{
uint length=info->s->base.pack_reclength - info->s->base.reclength;
bzero((char*) temp,length);
- if (my_b_write(&info->rec_cache, (byte*) temp,length))
+ if (my_b_write(&info->rec_cache, (uchar*) temp,length))
goto err;
}
}
@@ -70,7 +70,7 @@ my_bool _ma_write_static_record(MARIA_HA *info, const byte *record)
{
uint length=info->s->base.pack_reclength - info->s->base.reclength;
bzero((char*) temp,length);
- if (info->s->file_write(info, (byte*) temp,length,
+ if (info->s->file_write(info, (uchar*) temp,length,
info->state->data_file_length+
info->s->base.reclength,
info->s->write_flag))
@@ -86,8 +86,8 @@ my_bool _ma_write_static_record(MARIA_HA *info, const byte *record)
}
my_bool _ma_update_static_record(MARIA_HA *info, MARIA_RECORD_POS pos,
- const byte *oldrec __attribute__ ((unused)),
- const byte *record)
+ const uchar *oldrec __attribute__ ((unused)),
+ const uchar *record)
{
info->rec_cache.seek_not_done=1; /* We have done a seek */
return (info->s->file_write(info,
@@ -98,9 +98,9 @@ my_bool _ma_update_static_record(MARIA_HA *info, MARIA_RECORD_POS pos,
my_bool _ma_delete_static_record(MARIA_HA *info,
- const byte *record __attribute__ ((unused)))
+ const uchar *record __attribute__ ((unused)))
{
- byte temp[9]; /* 1+sizeof(uint32) */
+ uchar temp[9]; /* 1+sizeof(uint32) */
info->state->del++;
info->state->empty+=info->s->base.pack_reclength;
temp[0]= '\0'; /* Mark that record is deleted */
@@ -113,7 +113,7 @@ my_bool _ma_delete_static_record(MARIA_HA *info,
my_bool _ma_cmp_static_record(register MARIA_HA *info,
- register const byte *old)
+ register const uchar *old)
{
DBUG_ENTER("_ma_cmp_static_record");
@@ -137,7 +137,7 @@ my_bool _ma_cmp_static_record(register MARIA_HA *info,
info->cur_row.lastpos,
MYF(MY_NABP)))
DBUG_RETURN(1);
- if (memcmp((byte*) info->rec_buff, (byte*) old,
+ if (memcmp((uchar*) info->rec_buff, (uchar*) old,
(uint) info->s->base.reclength))
{
DBUG_DUMP("read",old,info->s->base.reclength);
@@ -151,7 +151,7 @@ my_bool _ma_cmp_static_record(register MARIA_HA *info,
my_bool _ma_cmp_static_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def,
- const byte *record, MARIA_RECORD_POS pos)
+ const uchar *record, MARIA_RECORD_POS pos)
{
DBUG_ENTER("_ma_cmp_static_unique");
@@ -159,7 +159,7 @@ my_bool _ma_cmp_static_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def,
if (info->s->file_read(info, (char*) info->rec_buff, info->s->base.reclength,
pos, MYF(MY_NABP)))
DBUG_RETURN(1);
- DBUG_RETURN(_ma_unique_comp(def, record, (byte*) info->rec_buff,
+ DBUG_RETURN(_ma_unique_comp(def, record, (uchar*) info->rec_buff,
def->null_are_equal));
}
@@ -173,7 +173,7 @@ my_bool _ma_cmp_static_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def,
-1 on read-error or locking-error
*/
-int _ma_read_static_record(register MARIA_HA *info, register byte *record,
+int _ma_read_static_record(register MARIA_HA *info, register uchar *record,
MARIA_RECORD_POS pos)
{
int error;
@@ -207,7 +207,7 @@ int _ma_read_static_record(register MARIA_HA *info, register byte *record,
-int _ma_read_rnd_static_record(MARIA_HA *info, byte *buf,
+int _ma_read_rnd_static_record(MARIA_HA *info, uchar *buf,
MARIA_RECORD_POS filepos,
my_bool skip_deleted_blocks)
{
@@ -275,11 +275,11 @@ int _ma_read_rnd_static_record(MARIA_HA *info, byte *buf,
}
/* Read record with cacheing */
- error=my_b_read(&info->rec_cache,(byte*) buf,share->base.reclength);
+ error=my_b_read(&info->rec_cache,(uchar*) buf,share->base.reclength);
if (info->s->base.pack_reclength != info->s->base.reclength && !error)
{
char tmp[8]; /* Skill fill bytes */
- error=my_b_read(&info->rec_cache,(byte*) tmp,
+ error=my_b_read(&info->rec_cache,(uchar*) tmp,
info->s->base.pack_reclength - info->s->base.reclength);
}
if (locked)
diff --git a/storage/maria/ma_test1.c b/storage/maria/ma_test1.c
index 028e02ab9d1..35d654bbb45 100644
--- a/storage/maria/ma_test1.c
+++ b/storage/maria/ma_test1.c
@@ -128,7 +128,7 @@ static int run_test(const char *filename)
}
keyinfo[0].flag = (uint8) (pack_keys | unique_key);
- bzero((byte*) flags,sizeof(flags));
+ bzero((uchar*) flags,sizeof(flags));
if (opt_unique)
{
uint start;
@@ -575,22 +575,22 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"delete-rows", 'd', "Abort after this many rows has been deleted",
- (gptr*) &remove_count, (gptr*) &remove_count, 0, GET_UINT, REQUIRED_ARG,
+ (uchar**) &remove_count, (uchar**) &remove_count, 0, GET_UINT, REQUIRED_ARG,
1000, 0, 0, 0, 0, 0},
{"help", '?', "Display help and exit",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"insert-rows", 'i', "Undocumented", (gptr*) &insert_count,
- (gptr*) &insert_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0},
+ {"insert-rows", 'i', "Undocumented", (uchar**) &insert_count,
+ (uchar**) &insert_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0},
{"key-alpha", 'a', "Use a key of type HA_KEYTYPE_TEXT",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"key-binary-pack", 'B', "Undocumented",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"key-blob", 'b', "Undocumented",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"key-cache", 'K', "Undocumented", (gptr*) &pagecacheing,
- (gptr*) &pagecacheing, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"key-length", 'k', "Undocumented", (gptr*) &key_length, (gptr*) &key_length,
- 0, GET_UINT, REQUIRED_ARG, 6, 0, 0, 0, 0, 0},
+ {"key-cache", 'K', "Undocumented", (uchar**) &pagecacheing,
+ (uchar**) &pagecacheing, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"key-length", 'k', "Undocumented", (uchar**) &key_length,
+ (uchar**) &key_length, 0, GET_UINT, REQUIRED_ARG, 6, 0, 0, 0, 0, 0},
{"key-multiple", 'm', "Undocumented",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"key-prefix_pack", 'P', "Undocumented",
@@ -600,29 +600,31 @@ static struct my_option my_long_options[] =
{"key-varchar", 'w', "Test VARCHAR keys",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"null-fields", 'N', "Define fields with NULL",
- (gptr*) &null_fields, (gptr*) &null_fields, 0, GET_BOOL, NO_ARG,
+ (uchar**) &null_fields, (uchar**) &null_fields, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"row-fixed-size", 'S', "Fixed size records",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"rows-in-block", 'M', "Store rows in block format",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"row-pointer-size", 'R', "Undocumented", (gptr*) &rec_pointer_size,
- (gptr*) &rec_pointer_size, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"row-pointer-size", 'R', "Undocumented", (uchar**) &rec_pointer_size,
+ (uchar**) &rec_pointer_size, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"silent", 's', "Undocumented",
- (gptr*) &silent, (gptr*) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"skip-delete", 'U', "Don't test deletes", (gptr*) &skip_delete,
- (gptr*) &skip_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"skip-update", 'D', "Don't test updates", (gptr*) &skip_update,
- (gptr*) &skip_update, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"transactional", 'T', "Test in transactional mode. (Only works with block format)",
- (gptr*) &transactional, (gptr*) &transactional, 0, GET_BOOL, NO_ARG,
+ (uchar**) &silent, (uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ 0, 0},
+ {"skip-delete", 'U', "Don't test deletes", (uchar**) &skip_delete,
+ (uchar**) &skip_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"skip-update", 'D', "Don't test updates", (uchar**) &skip_update,
+ (uchar**) &skip_update, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"transactional", 'T',
+ "Test in transactional mode. (Only works with block format)",
+ (uchar**) &transactional, (uchar**) &transactional, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
- {"unique", 'C', "Undocumented", (gptr*) &opt_unique, (gptr*) &opt_unique, 0,
- GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"update-rows", 'u', "Undocumented", (gptr*) &update_count,
- (gptr*) &update_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0},
- {"verbose", 'v', "Be more verbose", (gptr*) &verbose, (gptr*) &verbose, 0,
- GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"unique", 'C', "Undocumented", (uchar**) &opt_unique,
+ (uchar**) &opt_unique, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"update-rows", 'u', "Undocumented", (uchar**) &update_count,
+ (uchar**) &update_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0},
+ {"verbose", 'v', "Be more verbose", (uchar**) &verbose,
+ (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Print version number and exit",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
diff --git a/storage/maria/ma_test2.c b/storage/maria/ma_test2.c
index bbbb4fca1bf..dd5596c4d5c 100644
--- a/storage/maria/ma_test2.c
+++ b/storage/maria/ma_test2.c
@@ -38,7 +38,7 @@
static void get_options(int argc, char *argv[]);
static uint rnd(uint max_value);
-static void fix_length(byte *record,uint length);
+static void fix_length(uchar *record,uint length);
static void put_blob_in_record(char *blob_pos,char **blob_buffer,
ulong *length);
static void copy_key(struct st_maria_info *info,uint inx,
@@ -496,8 +496,8 @@ int main(int argc, char *argv[])
bcmp(read_record2,read_record3,reclength))
{
printf("Can't find last record\n");
- DBUG_DUMP("record2",(byte*) read_record2,reclength);
- DBUG_DUMP("record3",(byte*) read_record3,reclength);
+ DBUG_DUMP("record2",(uchar*) read_record2,reclength);
+ DBUG_DUMP("record3",(uchar*) read_record3,reclength);
goto end;
}
ant=1;
@@ -1050,7 +1050,7 @@ static uint rnd(uint max_value)
/* Create a variable length record */
-static void fix_length(byte *rec, uint length)
+static void fix_length(uchar *rec, uint length)
{
bmove(rec+STANDARD_LENGTH,
"0123456789012345678901234567890123456789012345678901234567890",
diff --git a/storage/maria/ma_test3.c b/storage/maria/ma_test3.c
index dcc0ac2e013..948ba09aa24 100644
--- a/storage/maria/ma_test3.c
+++ b/storage/maria/ma_test3.c
@@ -242,7 +242,7 @@ int test_read(MARIA_HA *file,int id)
for (i=0 ; i < 100 ; i++)
{
find=rnd(100000);
- if (!maria_rkey(file,record.id,1,(byte*) &find,
+ if (!maria_rkey(file,record.id,1,(uchar*) &find,
sizeof(find),HA_READ_KEY_EXACT))
found++;
else
@@ -425,7 +425,7 @@ int test_update(MARIA_HA *file,int id,int lock_type)
{
tmp=rnd(100000);
int4store(find,tmp);
- if (!maria_rkey(file,record.id,1,(byte*) find,
+ if (!maria_rkey(file,record.id,1,(uchar*) find,
sizeof(find),HA_READ_KEY_EXACT))
found++;
else
diff --git a/storage/maria/ma_unique.c b/storage/maria/ma_unique.c
index 06d29b9b037..3ab717887c7 100644
--- a/storage/maria/ma_unique.c
+++ b/storage/maria/ma_unique.c
@@ -18,12 +18,12 @@
#include "maria_def.h"
#include <m_ctype.h>
-my_bool _ma_check_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def, byte *record,
+my_bool _ma_check_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def, uchar *record,
ha_checksum unique_hash, my_off_t disk_pos)
{
my_off_t lastpos=info->cur_row.lastpos;
MARIA_KEYDEF *key= &info->s->keyinfo[def->key];
- byte *key_buff= info->lastkey2;
+ uchar *key_buff= info->lastkey2;
DBUG_ENTER("_ma_check_unique");
DBUG_PRINT("enter",("unique_hash: %lu", (ulong) unique_hash));
@@ -76,9 +76,9 @@ my_bool _ma_check_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def, byte *record,
Add support for bit fields
*/
-ha_checksum _ma_unique_hash(MARIA_UNIQUEDEF *def, const byte *record)
+ha_checksum _ma_unique_hash(MARIA_UNIQUEDEF *def, const uchar *record)
{
- const byte *pos, *end;
+ const uchar *pos, *end;
ha_checksum crc= 0;
ulong seed1=0, seed2= 4;
HA_KEYSEG *keyseg;
@@ -114,7 +114,7 @@ ha_checksum _ma_unique_hash(MARIA_UNIQUEDEF *def, const byte *record)
else if (keyseg->flag & HA_BLOB_PART)
{
uint tmp_length= _ma_calc_blob_length(keyseg->bit_start,pos);
- memcpy_fixed((byte*) &pos,pos+keyseg->bit_start,sizeof(char*));
+ memcpy_fixed((uchar*) &pos,pos+keyseg->bit_start,sizeof(char*));
if (!length || length > tmp_length)
length=tmp_length; /* The whole blob */
}
@@ -148,10 +148,10 @@ ha_checksum _ma_unique_hash(MARIA_UNIQUEDEF *def, const byte *record)
1 Rows are different
*/
-my_bool _ma_unique_comp(MARIA_UNIQUEDEF *def, const byte *a, const byte *b,
+my_bool _ma_unique_comp(MARIA_UNIQUEDEF *def, const uchar *a, const uchar *b,
my_bool null_are_equal)
{
- const byte *pos_a, *pos_b, *end;
+ const uchar *pos_a, *pos_b, *end;
HA_KEYSEG *keyseg;
for (keyseg=def->seg ; keyseg < def->end ; keyseg++)
@@ -209,8 +209,8 @@ my_bool _ma_unique_comp(MARIA_UNIQUEDEF *def, const byte *a, const byte *b,
set_if_smaller(a_length, keyseg->length);
set_if_smaller(b_length, keyseg->length);
}
- memcpy_fixed((byte*) &pos_a,pos_a+keyseg->bit_start,sizeof(char*));
- memcpy_fixed((byte*) &pos_b,pos_b+keyseg->bit_start,sizeof(char*));
+ memcpy_fixed((uchar*) &pos_a,pos_a+keyseg->bit_start,sizeof(char*));
+ memcpy_fixed((uchar*) &pos_b,pos_b+keyseg->bit_start,sizeof(char*));
}
if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT1 ||
type == HA_KEYTYPE_VARTEXT2)
diff --git a/storage/maria/ma_update.c b/storage/maria/ma_update.c
index 737c7c909b4..4d21167535d 100644
--- a/storage/maria/ma_update.c
+++ b/storage/maria/ma_update.c
@@ -18,12 +18,12 @@
#include "ma_fulltext.h"
#include "ma_rt_index.h"
-int maria_update(register MARIA_HA *info, const byte *oldrec, byte *newrec)
+int maria_update(register MARIA_HA *info, const uchar *oldrec, uchar *newrec)
{
int flag,key_changed,save_errno;
reg3 my_off_t pos;
uint i;
- byte old_key[HA_MAX_KEY_BUFF],*new_key;
+ uchar old_key[HA_MAX_KEY_BUFF],*new_key;
bool auto_key_changed=0;
ulonglong changed;
MARIA_SHARE *share=info->s;
diff --git a/storage/maria/ma_write.c b/storage/maria/ma_write.c
index a87e2d76fc7..cb15280fc6e 100644
--- a/storage/maria/ma_write.c
+++ b/storage/maria/ma_write.c
@@ -23,24 +23,24 @@
/* Functions declared in this file */
static int w_search(MARIA_HA *info,MARIA_KEYDEF *keyinfo,
- uint comp_flag, byte *key,
- uint key_length, my_off_t pos, byte *father_buff,
- byte *father_keypos, my_off_t father_page,
+ uint comp_flag, uchar *key,
+ uint key_length, my_off_t pos, uchar *father_buff,
+ uchar *father_keypos, my_off_t father_page,
my_bool insert_last);
-static int _ma_balance_page(MARIA_HA *info,MARIA_KEYDEF *keyinfo,byte *key,
- byte *curr_buff,byte *father_buff,
- byte *father_keypos,my_off_t father_page);
-static byte *_ma_find_last_pos(MARIA_KEYDEF *keyinfo, byte *page,
- byte *key, uint *return_key_length,
- byte **after_key);
-int _ma_ck_write_tree(register MARIA_HA *info, uint keynr,byte *key,
+static int _ma_balance_page(MARIA_HA *info,MARIA_KEYDEF *keyinfo,uchar *key,
+ uchar *curr_buff,uchar *father_buff,
+ uchar *father_keypos,my_off_t father_page);
+static uchar *_ma_find_last_pos(MARIA_KEYDEF *keyinfo, uchar *page,
+ uchar *key, uint *return_key_length,
+ uchar **after_key);
+int _ma_ck_write_tree(register MARIA_HA *info, uint keynr,uchar *key,
uint key_length);
-int _ma_ck_write_btree(register MARIA_HA *info, uint keynr,byte *key,
+int _ma_ck_write_btree(register MARIA_HA *info, uint keynr,uchar *key,
uint key_length);
MARIA_RECORD_POS _ma_write_init_default(MARIA_HA *info,
- const byte *record
+ const uchar *record
__attribute__((unused)))
{
return ((info->s->state.dellink != HA_OFFSET_ERROR &&
@@ -57,13 +57,13 @@ my_bool _ma_write_abort_default(MARIA_HA *info __attribute__((unused)))
/* Write new record to a table */
-int maria_write(MARIA_HA *info, byte *record)
+int maria_write(MARIA_HA *info, uchar *record)
{
MARIA_SHARE *share=info->s;
uint i;
int save_errno;
MARIA_RECORD_POS filepos;
- byte *buff;
+ uchar *buff;
my_bool lock_tree= share->concurrent_insert;
my_bool fatal_error;
DBUG_ENTER("maria_write");
@@ -271,7 +271,7 @@ err2:
/* Write one key to btree */
-int _ma_ck_write(MARIA_HA *info, uint keynr, byte *key, uint key_length)
+int _ma_ck_write(MARIA_HA *info, uint keynr, uchar *key, uint key_length)
{
DBUG_ENTER("_ma_ck_write");
@@ -290,7 +290,7 @@ int _ma_ck_write(MARIA_HA *info, uint keynr, byte *key, uint key_length)
* Normal insert code *
**********************************************************************/
-int _ma_ck_write_btree(register MARIA_HA *info, uint keynr, byte *key,
+int _ma_ck_write_btree(register MARIA_HA *info, uint keynr, uchar *key,
uint key_length)
{
int error;
@@ -317,7 +317,7 @@ int _ma_ck_write_btree(register MARIA_HA *info, uint keynr, byte *key,
if (!error)
error= _ma_ft_convert_to_ft2(info, keynr, key);
delete_dynamic(info->ft1_to_ft2);
- my_free((gptr)info->ft1_to_ft2, MYF(0));
+ my_free((uchar*)info->ft1_to_ft2, MYF(0));
info->ft1_to_ft2=0;
}
DBUG_RETURN(error);
@@ -325,7 +325,7 @@ int _ma_ck_write_btree(register MARIA_HA *info, uint keynr, byte *key,
int _ma_ck_real_write_btree(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- byte *key, uint key_length, my_off_t *root,
+ uchar *key, uint key_length, my_off_t *root,
uint comp_flag)
{
int error;
@@ -333,7 +333,7 @@ int _ma_ck_real_write_btree(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
/* key_length parameter is used only if comp_flag is SEARCH_FIND */
if (*root == HA_OFFSET_ERROR ||
(error=w_search(info, keyinfo, comp_flag, key, key_length,
- *root, (byte*) 0, (byte*) 0,
+ *root, (uchar*) 0, (uchar*) 0,
(my_off_t) 0, 1)) > 0)
error= _ma_enlarge_root(info,keyinfo,key,root);
DBUG_RETURN(error);
@@ -342,7 +342,7 @@ int _ma_ck_real_write_btree(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
/* Make a new root with key as only pointer */
-int _ma_enlarge_root(MARIA_HA *info, MARIA_KEYDEF *keyinfo, byte *key,
+int _ma_enlarge_root(MARIA_HA *info, MARIA_KEYDEF *keyinfo, uchar *key,
my_off_t *root)
{
uint t_length,nod_flag;
@@ -352,8 +352,8 @@ int _ma_enlarge_root(MARIA_HA *info, MARIA_KEYDEF *keyinfo, byte *key,
nod_flag= (*root != HA_OFFSET_ERROR) ? share->base.key_reflength : 0;
_ma_kpointer(info,info->buff+2,*root); /* if nod */
- t_length=(*keyinfo->pack_key)(keyinfo,nod_flag,(byte*) 0,
- (byte*) 0, (byte*) 0, key,&s_temp);
+ t_length=(*keyinfo->pack_key)(keyinfo,nod_flag,(uchar*) 0,
+ (uchar*) 0, (uchar*) 0, key,&s_temp);
maria_putint(info->buff,t_length+2+nod_flag,nod_flag);
(*keyinfo->store_key)(keyinfo,info->buff+2+nod_flag,&s_temp);
info->keyread_buff_used=info->page_changed=1; /* info->buff is used */
@@ -372,21 +372,21 @@ int _ma_enlarge_root(MARIA_HA *info, MARIA_KEYDEF *keyinfo, byte *key,
*/
static int w_search(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
- uint comp_flag, byte *key, uint key_length, my_off_t page,
- byte *father_buff, byte *father_keypos,
+ uint comp_flag, uchar *key, uint key_length, my_off_t page,
+ uchar *father_buff, uchar *father_keypos,
my_off_t father_page, my_bool insert_last)
{
int error,flag;
uint nod_flag, search_key_length;
- byte *temp_buff,*keypos;
- byte keybuff[HA_MAX_KEY_BUFF];
+ uchar *temp_buff,*keypos;
+ uchar keybuff[HA_MAX_KEY_BUFF];
my_bool was_last_key;
my_off_t next_page, dup_key_pos;
DBUG_ENTER("w_search");
DBUG_PRINT("enter",("page: %ld", (long) page));
search_key_length= (comp_flag & SEARCH_FIND) ? key_length : USE_WHOLE_KEY;
- if (!(temp_buff= (byte*) my_alloca((uint) keyinfo->block_length+
+ if (!(temp_buff= (uchar*) my_alloca((uint) keyinfo->block_length+
HA_MAX_KEY_BUFF*2)))
DBUG_RETURN(-1);
if (!_ma_fetch_keypage(info,keyinfo,page,DFLT_INIT_HITS,temp_buff,0))
@@ -436,14 +436,14 @@ static int w_search(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
ft_intXstore(keypos, subkeys);
if (!error)
error= _ma_write_keypage(info,keyinfo,page,DFLT_INIT_HITS,temp_buff);
- my_afree((byte*) temp_buff);
+ my_afree((uchar*) temp_buff);
DBUG_RETURN(error);
}
}
else /* not HA_FULLTEXT, normal HA_NOSAME key */
{
info->dup_key_pos= dup_key_pos;
- my_afree((byte*) temp_buff);
+ my_afree((uchar*) temp_buff);
my_errno=HA_ERR_FOUND_DUPP_KEY;
DBUG_RETURN(-1);
}
@@ -462,10 +462,10 @@ static int w_search(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
if (_ma_write_keypage(info,keyinfo,page,DFLT_INIT_HITS,temp_buff))
goto err;
}
- my_afree((byte*) temp_buff);
+ my_afree((uchar*) temp_buff);
DBUG_RETURN(error);
err:
- my_afree((byte*) temp_buff);
+ my_afree((uchar*) temp_buff);
DBUG_PRINT("exit",("Error: %d",my_errno));
DBUG_RETURN (-1);
} /* w_search */
@@ -497,13 +497,13 @@ err:
*/
int _ma_insert(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
- byte *key, byte *anc_buff, byte *key_pos, byte *key_buff,
- byte *father_buff, byte *father_key_pos, my_off_t father_page,
+ uchar *key, uchar *anc_buff, uchar *key_pos, uchar *key_buff,
+ uchar *father_buff, uchar *father_key_pos, my_off_t father_page,
my_bool insert_last)
{
uint a_length,nod_flag;
int t_length;
- byte *endpos, *prev_key;
+ uchar *endpos, *prev_key;
MARIA_KEY_PARAM s_temp;
DBUG_ENTER("_ma_insert");
DBUG_PRINT("enter",("key_pos: 0x%lx", (ulong) key_pos));
@@ -513,16 +513,16 @@ int _ma_insert(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
nod_flag=_ma_test_if_nod(anc_buff);
a_length= maria_data_on_page(anc_buff);
endpos= anc_buff+ a_length;
- prev_key=(key_pos == anc_buff+2+nod_flag ? (byte*) 0 : key_buff);
+ prev_key=(key_pos == anc_buff+2+nod_flag ? (uchar*) 0 : key_buff);
t_length=(*keyinfo->pack_key)(keyinfo,nod_flag,
- (key_pos == endpos ? (byte*) 0 : key_pos),
+ (key_pos == endpos ? (uchar*) 0 : key_pos),
prev_key, prev_key,
key,&s_temp);
#ifndef DBUG_OFF
if (key_pos != anc_buff+2+nod_flag && (keyinfo->flag &
(HA_BINARY_PACK_KEY | HA_PACK_KEY)))
{
- DBUG_DUMP("prev_key",(byte*) key_buff, _ma_keylength(keyinfo,key_buff));
+ DBUG_DUMP("prev_key",(uchar*) key_buff, _ma_keylength(keyinfo,key_buff));
}
if (keyinfo->flag & HA_PACK_KEY)
{
@@ -540,7 +540,7 @@ int _ma_insert(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
my_errno=HA_ERR_CRASHED;
DBUG_RETURN(-1);
}
- bmove_upp((byte*) endpos+t_length,(byte*) endpos,(uint) (endpos-key_pos));
+ bmove_upp((uchar*) endpos+t_length,(uchar*) endpos,(uint) (endpos-key_pos));
}
else
{
@@ -567,7 +567,7 @@ int _ma_insert(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
Let's consider converting.
We'll compare 'key' and the first key at anc_buff
*/
- byte *a=key, *b=anc_buff+2+nod_flag;
+ uchar *a=key, *b=anc_buff+2+nod_flag;
uint alen, blen, ft2len=info->s->ft2_keyinfo.keylength;
/* the very first key on the page is always unpacked */
DBUG_ASSERT((*b & 128) == 0);
@@ -621,16 +621,16 @@ int _ma_insert(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
/* split a full page in two and assign emerging item to key */
int _ma_split_page(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
- byte *key, byte *buff, byte *key_buff,
+ uchar *key, uchar *buff, uchar *key_buff,
my_bool insert_last_key)
{
uint length,a_length,key_ref_length,t_length,nod_flag,key_length;
- byte *key_pos,*pos, *after_key;
+ uchar *key_pos,*pos, *after_key;
my_off_t new_pos;
MARIA_KEY_PARAM s_temp;
DBUG_ENTER("maria_split_page");
LINT_INIT(after_key);
- DBUG_DUMP("buff",(byte*) buff,maria_data_on_page(buff));
+ DBUG_DUMP("buff",(uchar*) buff,maria_data_on_page(buff));
if (info->s->keyinfo+info->lastinx == keyinfo)
info->page_changed=1; /* Info->buff is used */
@@ -654,7 +654,7 @@ int _ma_split_page(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
{
DBUG_PRINT("test",("Splitting nod"));
pos=key_pos-nod_flag;
- memcpy((byte*) info->buff+2,(byte*) pos,(size_t) nod_flag);
+ memcpy((uchar*) info->buff+2,(uchar*) pos,(size_t) nod_flag);
}
/* Move middle item to key and pointer to new page */
@@ -666,18 +666,18 @@ int _ma_split_page(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
if (!(*keyinfo->get_key)(keyinfo,nod_flag,&key_pos,key_buff))
DBUG_RETURN(-1);
- t_length=(*keyinfo->pack_key)(keyinfo,nod_flag,(byte *) 0,
- (byte*) 0, (byte*) 0,
+ t_length=(*keyinfo->pack_key)(keyinfo,nod_flag,(uchar *) 0,
+ (uchar*) 0, (uchar*) 0,
key_buff, &s_temp);
length=(uint) ((buff+a_length)-key_pos);
- memcpy((byte*) info->buff+key_ref_length+t_length,(byte*) key_pos,
+ memcpy((uchar*) info->buff+key_ref_length+t_length,(uchar*) key_pos,
(size_t) length);
(*keyinfo->store_key)(keyinfo,info->buff+key_ref_length,&s_temp);
maria_putint(info->buff,length+t_length+key_ref_length,nod_flag);
if (_ma_write_keypage(info,keyinfo,new_pos,DFLT_INIT_HITS,info->buff))
DBUG_RETURN(-1);
- DBUG_DUMP("key",(byte*) key, _ma_keylength(keyinfo,key));
+ DBUG_DUMP("key",(uchar*) key, _ma_keylength(keyinfo,key));
DBUG_RETURN(2); /* Middle key up */
} /* _ma_split_page */
@@ -690,12 +690,12 @@ int _ma_split_page(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo,
after_key will contain the position to where the next key starts
*/
-byte *_ma_find_half_pos(uint nod_flag, MARIA_KEYDEF *keyinfo, byte *page,
- byte *key, uint *return_key_length,
- byte **after_key)
+uchar *_ma_find_half_pos(uint nod_flag, MARIA_KEYDEF *keyinfo, uchar *page,
+ uchar *key, uint *return_key_length,
+ uchar **after_key)
{
uint keys,length,key_ref_length;
- byte *end,*lastpos;
+ uchar *end,*lastpos;
DBUG_ENTER("_ma_find_half_pos");
key_ref_length=2+nod_flag;
@@ -736,13 +736,13 @@ byte *_ma_find_half_pos(uint nod_flag, MARIA_KEYDEF *keyinfo, byte *page,
key will contain the last key
*/
-static byte *_ma_find_last_pos(MARIA_KEYDEF *keyinfo, byte *page,
- byte *key, uint *return_key_length,
- byte **after_key)
+static uchar *_ma_find_last_pos(MARIA_KEYDEF *keyinfo, uchar *page,
+ uchar *key, uint *return_key_length,
+ uchar **after_key)
{
uint keys,length,last_length,key_ref_length;
- byte *end,*lastpos,*prevpos;
- byte key_buff[HA_MAX_KEY_BUFF];
+ uchar *end,*lastpos,*prevpos;
+ uchar key_buff[HA_MAX_KEY_BUFF];
DBUG_ENTER("_ma_find_last_pos");
key_ref_length=2;
@@ -790,16 +790,16 @@ static byte *_ma_find_last_pos(MARIA_KEYDEF *keyinfo, byte *page,
/* returns 0 if balance was done */
static int _ma_balance_page(register MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- byte *key, byte *curr_buff, byte *father_buff,
- byte *father_key_pos, my_off_t father_page)
+ uchar *key, uchar *curr_buff, uchar *father_buff,
+ uchar *father_key_pos, my_off_t father_page)
{
my_bool right;
uint k_length,father_length,father_keylength,nod_flag,curr_keylength,
right_length,left_length,new_right_length,new_left_length,extra_length,
length,keys;
- byte *pos,*buff,*extra_buff;
+ uchar *pos,*buff,*extra_buff;
my_off_t next_page,new_pos;
- byte tmp_part_key[HA_MAX_KEY_BUFF];
+ uchar tmp_part_key[HA_MAX_KEY_BUFF];
DBUG_ENTER("_ma_balance_page");
k_length=keyinfo->keylength;
@@ -831,7 +831,7 @@ static int _ma_balance_page(register MARIA_HA *info, MARIA_KEYDEF *keyinfo,
if (!_ma_fetch_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,info->buff,0))
goto err;
- DBUG_DUMP("next",(byte*) info->buff,maria_data_on_page(info->buff));
+ DBUG_DUMP("next",(uchar*) info->buff,maria_data_on_page(info->buff));
/* Test if there is room to share keys */
@@ -850,23 +850,23 @@ static int _ma_balance_page(register MARIA_HA *info, MARIA_KEYDEF *keyinfo,
if (left_length < new_left_length)
{ /* Move keys buff -> leaf */
pos=curr_buff+left_length;
- memcpy((byte*) pos,(byte*) father_key_pos, (size_t) k_length);
- memcpy((byte*) pos+k_length, (byte*) buff+2,
+ memcpy((uchar*) pos,(uchar*) father_key_pos, (size_t) k_length);
+ memcpy((uchar*) pos+k_length, (uchar*) buff+2,
(size_t) (length=new_left_length - left_length - k_length));
pos=buff+2+length;
- memcpy((byte*) father_key_pos,(byte*) pos,(size_t) k_length);
- bmove((byte*) buff+2,(byte*) pos+k_length,new_right_length);
+ memcpy((uchar*) father_key_pos,(uchar*) pos,(size_t) k_length);
+ bmove((uchar*) buff+2,(uchar*) pos+k_length,new_right_length);
}
else
{ /* Move keys -> buff */
- bmove_upp((byte*) buff+new_right_length,(byte*) buff+right_length,
+ bmove_upp((uchar*) buff+new_right_length,(uchar*) buff+right_length,
right_length-2);
length=new_right_length-right_length-k_length;
- memcpy((byte*) buff+2+length,father_key_pos,(size_t) k_length);
+ memcpy((uchar*) buff+2+length,father_key_pos,(size_t) k_length);
pos=curr_buff+new_left_length;
- memcpy((byte*) father_key_pos,(byte*) pos,(size_t) k_length);
- memcpy((byte*) buff+2,(byte*) pos+k_length,(size_t) length);
+ memcpy((uchar*) father_key_pos,(uchar*) pos,(size_t) k_length);
+ memcpy((uchar*) buff+2,(uchar*) pos+k_length,(size_t) length);
}
if (_ma_write_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,info->buff) ||
@@ -893,22 +893,22 @@ static int _ma_balance_page(register MARIA_HA *info, MARIA_KEYDEF *keyinfo,
/* move first largest keys to new page */
pos=buff+right_length-extra_length;
- memcpy((byte*) extra_buff+2,pos,(size_t) extra_length);
+ memcpy((uchar*) extra_buff+2,pos,(size_t) extra_length);
/* Save new parting key */
memcpy(tmp_part_key, pos-k_length,k_length);
/* Make place for new keys */
- bmove_upp((byte*) buff+new_right_length,(byte*) pos-k_length,
+ bmove_upp((uchar*) buff+new_right_length,(uchar*) pos-k_length,
right_length-extra_length-k_length-2);
/* Copy keys from left page */
pos= curr_buff+new_left_length;
- memcpy((byte*) buff+2,(byte*) pos+k_length,
+ memcpy((uchar*) buff+2,(uchar*) pos+k_length,
(size_t) (length=left_length-new_left_length-k_length));
/* Copy old parting key */
- memcpy((byte*) buff+2+length,father_key_pos,(size_t) k_length);
+ memcpy((uchar*) buff+2+length,father_key_pos,(size_t) k_length);
/* Move new parting keys up to caller */
- memcpy((byte*) (right ? key : father_key_pos),pos,(size_t) k_length);
- memcpy((byte*) (right ? father_key_pos : key),tmp_part_key, k_length);
+ memcpy((uchar*) (right ? key : father_key_pos),pos,(size_t) k_length);
+ memcpy((uchar*) (right ? father_key_pos : key),tmp_part_key, k_length);
if ((new_pos= _ma_new(info,keyinfo,DFLT_INIT_HITS)) == HA_OFFSET_ERROR)
goto err;
@@ -935,7 +935,7 @@ typedef struct {
} bulk_insert_param;
-int _ma_ck_write_tree(register MARIA_HA *info, uint keynr, byte *key,
+int _ma_ck_write_tree(register MARIA_HA *info, uint keynr, uchar *key,
uint key_length)
{
int error;
@@ -951,7 +951,7 @@ int _ma_ck_write_tree(register MARIA_HA *info, uint keynr, byte *key,
/* typeof(_ma_keys_compare)=qsort_cmp2 */
-static int keys_compare(bulk_insert_param *param, byte *key1, byte *key2)
+static int keys_compare(bulk_insert_param *param, uchar *key1, uchar *key2)
{
uint not_used[2];
return ha_key_cmp(param->info->s->keyinfo[param->keynr].seg,
@@ -960,13 +960,13 @@ static int keys_compare(bulk_insert_param *param, byte *key1, byte *key2)
}
-static int keys_free(byte *key, TREE_FREE mode, bulk_insert_param *param)
+static int keys_free(uchar *key, TREE_FREE mode, bulk_insert_param *param)
{
/*
Probably I can use info->lastkey here, but I'm not sure,
and to be safe I'd better use local lastkey.
*/
- byte lastkey[HA_MAX_KEY_BUFF];
+ uchar lastkey[HA_MAX_KEY_BUFF];
uint keylen;
MARIA_KEYDEF *keyinfo;
diff --git a/storage/maria/maria_chk.c b/storage/maria/maria_chk.c
index 0b82a71f736..f8a51507624 100644
--- a/storage/maria/maria_chk.c
+++ b/storage/maria/maria_chk.c
@@ -76,13 +76,13 @@ static void get_options(int *argc,char * * *argv);
static void print_version(void);
static void usage(void);
static int maria_chk(HA_CHECK *param, char *filename);
-static void descript(HA_CHECK *param, register MARIA_HA *info, my_string name);
+static void descript(HA_CHECK *param, register MARIA_HA *info, char *name);
static int maria_sort_records(HA_CHECK *param, register MARIA_HA *info,
- my_string name, uint sort_key,
+ char *name, uint sort_key,
my_bool write_info, my_bool update_index);
static int sort_record_index(MARIA_SORT_PARAM *sort_param, MARIA_HA *info,
MARIA_KEYDEF *keyinfo,
- my_off_t page, byte *buff,uint sortkey,
+ my_off_t page, uchar *buff,uint sortkey,
File new_file, my_bool update_index);
HA_CHECK check_param;
@@ -178,7 +178,7 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory where character sets are.",
- (gptr*) &charsets_dir, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &charsets_dir, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"check", 'c',
"Check table for errors.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -198,8 +198,8 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"data-file-length", 'D',
"Max length of data file (when recreating data-file when it's full).",
- (gptr*) &check_param.max_data_file_length,
- (gptr*) &check_param.max_data_file_length,
+ (uchar**) &check_param.max_data_file_length,
+ (uchar**) &check_param.max_data_file_length,
0, GET_LL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"extend-check", 'e',
"If used when checking a table, ensure that the table is 100 percent consistent, which will take a long time. If used when repairing a table, try to recover every possible row from the data file. Normally this will also find a lot of garbage rows; Don't use this option with repair if you are not totally desperate.",
@@ -221,13 +221,13 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"keys-used", 'k',
"Tell MARIA to update only some specific keys. # is a bit mask of which keys to use. This can be used to get faster inserts.",
- (gptr*) &check_param.keys_in_use,
- (gptr*) &check_param.keys_in_use,
+ (uchar**) &check_param.keys_in_use,
+ (uchar**) &check_param.keys_in_use,
0, GET_ULL, REQUIRED_ARG, -1, 0, 0, 0, 0, 0},
{"max-record-length", OPT_MAX_RECORD_LENGTH,
"Skip rows bigger than this if maria_chk can't allocate memory to hold it",
- (gptr*) &check_param.max_record_length,
- (gptr*) &check_param.max_record_length,
+ (uchar**) &check_param.max_record_length,
+ (uchar**) &check_param.max_record_length,
0, GET_ULL, REQUIRED_ARG, LONGLONG_MAX, 0, LONGLONG_MAX, 0, 0, 0},
{"medium-check", 'm',
"Faster than extend-check, but only finds 99.99% of all errors. Should be good enough for most cases.",
@@ -256,12 +256,12 @@ static struct my_option my_long_options[] =
#endif
{"set-auto-increment", 'A',
"Force auto_increment to start at this or higher value. If no value is given, then sets the next auto_increment value to the highest used value for the auto key + 1.",
- (gptr*) &check_param.auto_increment_value,
- (gptr*) &check_param.auto_increment_value,
+ (uchar**) &check_param.auto_increment_value,
+ (uchar**) &check_param.auto_increment_value,
0, GET_ULL, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"set-collation", OPT_SET_COLLATION,
"Change the collation used by the index",
- (gptr*) &set_collation_name, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &set_collation_name, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"set-variable", 'O',
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -273,12 +273,12 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"sort-records", 'R',
"Sort records according to an index. This makes your data much more localized and may speed up things. (It may be VERY slow to do a sort the first time!)",
- (gptr*) &check_param.opt_sort_key,
- (gptr*) &check_param.opt_sort_key,
+ (uchar**) &check_param.opt_sort_key,
+ (uchar**) &check_param.opt_sort_key,
0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"tmpdir", 't',
"Path for temporary files.",
- (gptr*) &opt_tmpdir,
+ (uchar**) &opt_tmpdir,
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"update-state", 'U',
"Mark tables as crashed if any errors were found.",
@@ -296,45 +296,45 @@ static struct my_option my_long_options[] =
"Wait if table is locked.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{ "key_buffer_size", OPT_KEY_BUFFER_SIZE, "",
- (gptr*) &check_param.use_buffers, (gptr*) &check_param.use_buffers, 0,
+ (uchar**) &check_param.use_buffers, (uchar**) &check_param.use_buffers, 0,
GET_ULONG, REQUIRED_ARG, (long) USE_BUFFER_INIT, (long) MALLOC_OVERHEAD,
(long) ~0L, (long) MALLOC_OVERHEAD, (long) IO_SIZE, 0},
{ "read_buffer_size", OPT_READ_BUFFER_SIZE, "",
- (gptr*) &check_param.read_buffer_length,
- (gptr*) &check_param.read_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
+ (uchar**) &check_param.read_buffer_length,
+ (uchar**) &check_param.read_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
(long) READ_BUFFER_INIT, (long) MALLOC_OVERHEAD,
(long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
{ "write_buffer_size", OPT_WRITE_BUFFER_SIZE, "",
- (gptr*) &check_param.write_buffer_length,
- (gptr*) &check_param.write_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
+ (uchar**) &check_param.write_buffer_length,
+ (uchar**) &check_param.write_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
(long) READ_BUFFER_INIT, (long) MALLOC_OVERHEAD,
(long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
{ "sort_buffer_size", OPT_SORT_BUFFER_SIZE, "",
- (gptr*) &check_param.sort_buffer_length,
- (gptr*) &check_param.sort_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
+ (uchar**) &check_param.sort_buffer_length,
+ (uchar**) &check_param.sort_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
(long) SORT_BUFFER_INIT, (long) (MIN_SORT_BUFFER + MALLOC_OVERHEAD),
(long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
{ "sort_key_blocks", OPT_SORT_KEY_BLOCKS, "",
- (gptr*) &check_param.sort_key_blocks,
- (gptr*) &check_param.sort_key_blocks, 0, GET_ULONG, REQUIRED_ARG,
+ (uchar**) &check_param.sort_key_blocks,
+ (uchar**) &check_param.sort_key_blocks, 0, GET_ULONG, REQUIRED_ARG,
BUFFERS_WHEN_SORTING, 4L, 100L, 0L, 1L, 0},
- { "decode_bits", OPT_DECODE_BITS, "", (gptr*) &decode_bits,
- (gptr*) &decode_bits, 0, GET_UINT, REQUIRED_ARG, 9L, 4L, 17L, 0L, 1L, 0},
- { "ft_min_word_len", OPT_FT_MIN_WORD_LEN, "", (gptr*) &ft_min_word_len,
- (gptr*) &ft_min_word_len, 0, GET_ULONG, REQUIRED_ARG, 4, 1, HA_FT_MAXCHARLEN,
+ { "decode_bits", OPT_DECODE_BITS, "", (uchar**) &decode_bits,
+ (uchar**) &decode_bits, 0, GET_UINT, REQUIRED_ARG, 9L, 4L, 17L, 0L, 1L, 0},
+ { "ft_min_word_len", OPT_FT_MIN_WORD_LEN, "", (uchar**) &ft_min_word_len,
+ (uchar**) &ft_min_word_len, 0, GET_ULONG, REQUIRED_ARG, 4, 1, HA_FT_MAXCHARLEN,
0, 1, 0},
- { "ft_max_word_len", OPT_FT_MAX_WORD_LEN, "", (gptr*) &ft_max_word_len,
- (gptr*) &ft_max_word_len, 0, GET_ULONG, REQUIRED_ARG, HA_FT_MAXCHARLEN, 10,
+ { "ft_max_word_len", OPT_FT_MAX_WORD_LEN, "", (uchar**) &ft_max_word_len,
+ (uchar**) &ft_max_word_len, 0, GET_ULONG, REQUIRED_ARG, HA_FT_MAXCHARLEN, 10,
HA_FT_MAXCHARLEN, 0, 1, 0},
{ "maria_ft_stopword_file", OPT_FT_STOPWORD_FILE,
"Use stopwords from this file instead of built-in list.",
- (gptr*) &ft_stopword_file, (gptr*) &ft_stopword_file, 0, GET_STR,
+ (uchar**) &ft_stopword_file, (uchar**) &ft_stopword_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"stats_method", OPT_STATS_METHOD,
"Specifies how index statistics collection code should threat NULLs. "
"Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), "
"\"nulls_equal\" (emulate 4.0 behavior), and \"nulls_ignored\".",
- (gptr*) &maria_stats_method_str, (gptr*) &maria_stats_method_str, 0,
+ (uchar**) &maria_stats_method_str, (uchar**) &maria_stats_method_str, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -794,7 +794,7 @@ static void get_options(register int *argc,register char ***argv)
/* Check table */
-static int maria_chk(HA_CHECK *param, my_string filename)
+static int maria_chk(HA_CHECK *param, char *filename)
{
int error,lock_type,recreate;
int rep_quick= param->testflag & (T_QUICK | T_FORCE_UNIQUENESS);
@@ -1215,7 +1215,7 @@ end2:
/* Write info about table */
-static void descript(HA_CHECK *param, register MARIA_HA *info, my_string name)
+static void descript(HA_CHECK *param, register MARIA_HA *info, char *name)
{
uint key,keyseg_nr,field;
reg3 MARIA_KEYDEF *keyinfo;
@@ -1468,7 +1468,7 @@ static void descript(HA_CHECK *param, register MARIA_HA *info, my_string name)
/* Sort records according to one key */
static int maria_sort_records(HA_CHECK *param,
- register MARIA_HA *info, my_string name,
+ register MARIA_HA *info, char *name,
uint sort_key,
my_bool write_info,
my_bool update_index)
@@ -1477,7 +1477,7 @@ static int maria_sort_records(HA_CHECK *param,
uint key;
MARIA_KEYDEF *keyinfo;
File new_file;
- byte *temp_buff;
+ uchar *temp_buff;
ha_rows old_record_count;
MARIA_SHARE *share=info->s;
char llbuff[22],llbuff2[22];
@@ -1532,12 +1532,12 @@ static int maria_sort_records(HA_CHECK *param,
goto err;
info->opt_flag|=WRITE_CACHE_USED;
- if (!(temp_buff=(byte*) my_alloca((uint) keyinfo->block_length)))
+ if (!(temp_buff=(uchar*) my_alloca((uint) keyinfo->block_length)))
{
_ma_check_print_error(param,"Not enough memory for key block");
goto err;
}
- if (!(sort_param.record=(byte*) my_malloc((uint) share->base.pack_reclength,
+ if (!(sort_param.record=(uchar*) my_malloc((uint) share->base.pack_reclength,
MYF(0))))
{
_ma_check_print_error(param,"Not enough memory for record");
@@ -1630,7 +1630,7 @@ err:
}
if (temp_buff)
{
- my_afree((gptr) temp_buff);
+ my_afree((uchar*) temp_buff);
}
my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR));
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
@@ -1647,13 +1647,13 @@ err:
static int sort_record_index(MARIA_SORT_PARAM *sort_param,MARIA_HA *info,
MARIA_KEYDEF *keyinfo,
- my_off_t page, byte *buff, uint sort_key,
+ my_off_t page, uchar *buff, uint sort_key,
File new_file,my_bool update_index)
{
uint nod_flag,used_length,key_length;
- byte *temp_buff,*keypos,*endpos;
+ uchar *temp_buff,*keypos,*endpos;
my_off_t next_page,rec_pos;
- byte lastkey[HA_MAX_KEY_BUFF];
+ uchar lastkey[HA_MAX_KEY_BUFF];
char llbuff[22];
MARIA_SORT_INFO *sort_info= sort_param->sort_info;
HA_CHECK *param=sort_info->param;
@@ -1664,7 +1664,7 @@ static int sort_record_index(MARIA_SORT_PARAM *sort_param,MARIA_HA *info,
if (nod_flag)
{
- if (!(temp_buff= (byte*) my_alloca((uint) keyinfo->block_length)))
+ if (!(temp_buff= (uchar*) my_alloca((uint) keyinfo->block_length)))
{
_ma_check_print_error(param,"Not Enough memory");
DBUG_RETURN(-1);
@@ -1679,7 +1679,7 @@ static int sort_record_index(MARIA_SORT_PARAM *sort_param,MARIA_HA *info,
if (nod_flag)
{
next_page= _ma_kpos(nod_flag, keypos);
- if (my_pread(info->s->kfile.file, (byte*)temp_buff,
+ if (my_pread(info->s->kfile.file, (uchar*)temp_buff,
(uint) keyinfo->block_length, next_page,
MYF(MY_NABP+MY_WME)))
{
@@ -1719,19 +1719,19 @@ static int sort_record_index(MARIA_SORT_PARAM *sort_param,MARIA_HA *info,
goto err;
}
/* Clear end of block to get better compression if the table is backuped */
- bzero((byte*) buff+used_length,keyinfo->block_length-used_length);
- if (my_pwrite(info->s->kfile.file, (byte*)buff, (uint)keyinfo->block_length,
+ bzero((uchar*) buff+used_length,keyinfo->block_length-used_length);
+ if (my_pwrite(info->s->kfile.file, (uchar*)buff, (uint)keyinfo->block_length,
page,param->myf_rw))
{
_ma_check_print_error(param,"%d when updating keyblock",my_errno);
goto err;
}
if (temp_buff)
- my_afree((gptr) temp_buff);
+ my_afree((uchar*) temp_buff);
DBUG_RETURN(0);
err:
if (temp_buff)
- my_afree((gptr) temp_buff);
+ my_afree((uchar*) temp_buff);
DBUG_RETURN(1);
} /* sort_record_index */
diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h
index 740808c7bbe..6c735b745ea 100644
--- a/storage/maria/maria_def.h
+++ b/storage/maria/maria_def.h
@@ -227,7 +227,7 @@ typedef struct st_maria_share
char *data_file_name; /* Resolved path names from symlinks */
char *index_file_name;
char *open_file_name; /* parameter to open filename */
- byte *file_map; /* mem-map of file if possible */
+ uchar *file_map; /* mem-map of file if possible */
PAGECACHE *pagecache; /* ref to the current key cache */
MARIA_DECODE_TREE *decode_trees;
uint16 *decode_tables;
@@ -241,36 +241,36 @@ typedef struct st_maria_share
/* Is called for every close of the table */
void (*end)(struct st_maria_info *);
/* Called when we want to read a record from a specific position */
- int (*read_record)(struct st_maria_info *, byte *, MARIA_RECORD_POS);
+ int (*read_record)(struct st_maria_info *, uchar *, MARIA_RECORD_POS);
/* Initialize a scan */
my_bool (*scan_init)(struct st_maria_info *);
/* Read next record while scanning */
- int (*scan)(struct st_maria_info *, byte *, MARIA_RECORD_POS, my_bool);
+ int (*scan)(struct st_maria_info *, uchar *, MARIA_RECORD_POS, my_bool);
/* End scan */
void (*scan_end)(struct st_maria_info *);
/* Pre-write of row (some handlers may do the actual write here) */
- MARIA_RECORD_POS (*write_record_init)(struct st_maria_info *, const byte *);
+ MARIA_RECORD_POS (*write_record_init)(struct st_maria_info *, const uchar *);
/* Write record (or accept write_record_init) */
- my_bool (*write_record)(struct st_maria_info *, const byte *);
+ my_bool (*write_record)(struct st_maria_info *, const uchar *);
/* Called when write failed */
my_bool (*write_record_abort)(struct st_maria_info *);
my_bool (*update_record)(struct st_maria_info *, MARIA_RECORD_POS,
- const byte *, const byte *);
- my_bool (*delete_record)(struct st_maria_info *, const byte *record);
- my_bool (*compare_record)(struct st_maria_info *, const byte *);
+ const uchar *, const uchar *);
+ my_bool (*delete_record)(struct st_maria_info *, const uchar *record);
+ my_bool (*compare_record)(struct st_maria_info *, const uchar *);
/* calculate checksum for a row */
- ha_checksum(*calc_checksum)(struct st_maria_info *, const byte *);
+ ha_checksum(*calc_checksum)(struct st_maria_info *, const uchar *);
/*
Calculate checksum for a row during write. May be 0 if we calculate
the checksum in write_record_init()
*/
- ha_checksum(*calc_write_checksum) (struct st_maria_info *, const byte *);
+ ha_checksum(*calc_write_checksum) (struct st_maria_info *, const uchar *);
/* Compare a row in memory with a row on disk */
my_bool (*compare_unique)(struct st_maria_info *, MARIA_UNIQUEDEF *,
- const byte *record, MARIA_RECORD_POS pos);
+ const uchar *record, MARIA_RECORD_POS pos);
/* Mapings to read/write the data file */
- uint (*file_read)(MARIA_HA *, byte *, uint, my_off_t, myf);
- uint (*file_write)(MARIA_HA *, byte *, uint, my_off_t, myf);
+ uint (*file_read)(MARIA_HA *, uchar *, uint, my_off_t, myf);
+ uint (*file_write)(MARIA_HA *, uchar *, uint, my_off_t, myf);
invalidator_by_filename invalidator; /* query cache invalidator */
ulong this_process; /* processid */
ulong last_process; /* For table-change-check */
@@ -316,7 +316,7 @@ typedef struct st_maria_share
} MARIA_SHARE;
-typedef byte MARIA_BITMAP_BUFFER;
+typedef uchar MARIA_BITMAP_BUFFER;
typedef struct st_maria_bitmap_block
{
@@ -351,12 +351,12 @@ typedef struct st_maria_row
MARIA_RECORD_POS lastpos, nextpos;
MARIA_RECORD_POS *tail_positions;
ha_checksum checksum;
- byte *empty_bits, *field_lengths;
+ uchar *empty_bits, *field_lengths;
uint *null_field_lengths; /* All null field lengths */
ulong *blob_lengths; /* Length for each blob */
ulong base_length, normal_length, char_length, varchar_length, blob_length;
ulong head_length, total_length;
- my_size_t extents_buffer_length; /* Size of 'extents' buffer */
+ size_t extents_buffer_length; /* Size of 'extents' buffer */
uint field_lengths_length; /* Length of data in field_lengths */
uint extents_count; /* number of extents in 'extents' */
uint full_page_count, tail_count; /* For maria_chk */
@@ -365,8 +365,8 @@ typedef struct st_maria_row
/* Data to scan row in blocked format */
typedef struct st_maria_block_scan
{
- byte *bitmap_buff, *bitmap_pos, *bitmap_end, *page_buff;
- byte *dir, *dir_end;
+ uchar *bitmap_buff, *bitmap_pos, *bitmap_end, *page_buff;
+ uchar *dir, *dir_end;
ulong bitmap_page;
ulonglong bits;
uint number_of_rows, bit_pos;
@@ -392,17 +392,17 @@ struct st_maria_info
DYNAMIC_ARRAY *ft1_to_ft2; /* used only in ft1->ft2 conversion */
MEM_ROOT ft_memroot; /* used by the parser */
MYSQL_FTPARSER_PARAM *ftparser_param; /* share info between init/deinit */
- byte *buff; /* page buffer */
- byte *keyread_buff; /* Buffer for last key read */
- byte *lastkey, *lastkey2; /* Last used search key */
- byte *first_mbr_key; /* Searhed spatial key */
- byte *rec_buff; /* Temp buffer for recordpack */
- byte *int_keypos, /* Save position for next/previous */
+ uchar *buff; /* page buffer */
+ uchar *keyread_buff; /* Buffer for last key read */
+ uchar *lastkey, *lastkey2; /* Last used search key */
+ uchar *first_mbr_key; /* Searhed spatial key */
+ uchar *rec_buff; /* Temp buffer for recordpack */
+ uchar *int_keypos, /* Save position for next/previous */
*int_maxpos; /* -""- */
- byte *update_field_data; /* Used by update in rows-in-block */
+ uchar *update_field_data; /* Used by update in rows-in-block */
uint int_nod_flag; /* -""- */
uint32 int_keytree_version; /* -""- */
- int (*read_record) (struct st_maria_info *, byte*, MARIA_RECORD_POS);
+ int (*read_record) (struct st_maria_info *, uchar*, MARIA_RECORD_POS);
invalidator_by_filename invalidator; /* query cache invalidator */
ulong this_unique; /* uniq filenumber or thread */
ulong last_unique; /* last unique number */
@@ -419,7 +419,7 @@ struct st_maria_info
as they are not compatible with parallel repair
*/
ulong packed_length, blob_length; /* Length of found, packed record */
- my_size_t rec_buff_size;
+ size_t rec_buff_size;
PAGECACHE_FILE dfile; /* The datafile */
uint opt_flag; /* Optim. for space/speed */
uint update; /* If file changed since open */
@@ -543,7 +543,7 @@ struct st_maria_info
#define MARIA_DYN_MAX_BLOCK_LENGTH ((1L << 24)-4L)
#define MARIA_DYN_MAX_ROW_LENGTH (MARIA_DYN_MAX_BLOCK_LENGTH - MARIA_SPLIT_LENGTH)
#define MARIA_DYN_ALIGN_SIZE 4 /* Align blocks on this */
-#define MARIA_MAX_DYN_HEADER_BYTE 13 /* max header byte for dynamic rows */
+#define MARIA_MAX_DYN_HEADER_BYTE 13 /* max header uchar for dynamic rows */
#define MARIA_MAX_BLOCK_LENGTH ((((ulong) 1 << 24)-1) & (~ (ulong) (MARIA_DYN_ALIGN_SIZE-1)))
#define MARIA_REC_BUFF_OFFSET ALIGN_SIZE(MARIA_DYN_DELETE_BLOCK_HEADER+sizeof(uint32))
@@ -584,7 +584,7 @@ extern uchar NEAR maria_file_magic[], NEAR maria_pack_file_magic[];
extern uint NEAR maria_read_vec[], NEAR maria_readnext_vec[];
extern uint maria_quick_table_bits;
extern const char *maria_data_root;
-extern byte maria_zero_string[];
+extern uchar maria_zero_string[];
extern my_bool maria_inited;
@@ -593,8 +593,8 @@ typedef struct st_maria_s_param
{
uint ref_length, key_length, n_ref_length;
uint n_length, totlength, part_of_prev_key, prev_length, pack_marker;
- const byte *key;
- byte *prev_key, *next_key_pos;
+ const uchar *key;
+ uchar *prev_key, *next_key_pos;
bool store_not_null;
} MARIA_KEY_PARAM;
@@ -608,73 +608,73 @@ typedef struct st_pinned_page
/* Prototypes for intern functions */
-extern int _ma_read_dynamic_record(MARIA_HA *, byte *, MARIA_RECORD_POS);
-extern int _ma_read_rnd_dynamic_record(MARIA_HA *, byte *, MARIA_RECORD_POS,
+extern int _ma_read_dynamic_record(MARIA_HA *, uchar *, MARIA_RECORD_POS);
+extern int _ma_read_rnd_dynamic_record(MARIA_HA *, uchar *, MARIA_RECORD_POS,
my_bool);
-extern my_bool _ma_write_dynamic_record(MARIA_HA *, const byte *);
+extern my_bool _ma_write_dynamic_record(MARIA_HA *, const uchar *);
extern my_bool _ma_update_dynamic_record(MARIA_HA *, MARIA_RECORD_POS,
- const byte *, const byte *);
-extern my_bool _ma_delete_dynamic_record(MARIA_HA *info, const byte *record);
-extern my_bool _ma_cmp_dynamic_record(MARIA_HA *info, const byte *record);
-extern my_bool _ma_write_blob_record(MARIA_HA *, const byte *);
+ const uchar *, const uchar *);
+extern my_bool _ma_delete_dynamic_record(MARIA_HA *info, const uchar *record);
+extern my_bool _ma_cmp_dynamic_record(MARIA_HA *info, const uchar *record);
+extern my_bool _ma_write_blob_record(MARIA_HA *, const uchar *);
extern my_bool _ma_update_blob_record(MARIA_HA *, MARIA_RECORD_POS,
- const byte *, const byte *);
-extern int _ma_read_static_record(MARIA_HA *info, byte *, MARIA_RECORD_POS);
-extern int _ma_read_rnd_static_record(MARIA_HA *, byte *, MARIA_RECORD_POS,
+ const uchar *, const uchar *);
+extern int _ma_read_static_record(MARIA_HA *info, uchar *, MARIA_RECORD_POS);
+extern int _ma_read_rnd_static_record(MARIA_HA *, uchar *, MARIA_RECORD_POS,
my_bool);
-extern my_bool _ma_write_static_record(MARIA_HA *, const byte *);
+extern my_bool _ma_write_static_record(MARIA_HA *, const uchar *);
extern my_bool _ma_update_static_record(MARIA_HA *, MARIA_RECORD_POS,
- const byte *, const byte *);
-extern my_bool _ma_delete_static_record(MARIA_HA *info, const byte *record);
-extern my_bool _ma_cmp_static_record(MARIA_HA *info, const byte *record);
-extern int _ma_ck_write(MARIA_HA *info, uint keynr, byte *key,
+ const uchar *, const uchar *);
+extern my_bool _ma_delete_static_record(MARIA_HA *info, const uchar *record);
+extern my_bool _ma_cmp_static_record(MARIA_HA *info, const uchar *record);
+extern int _ma_ck_write(MARIA_HA *info, uint keynr, uchar *key,
uint length);
extern int _ma_ck_real_write_btree(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- byte *key, uint key_length,
+ uchar *key, uint key_length,
MARIA_RECORD_POS *root, uint comp_flag);
extern int _ma_enlarge_root(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- byte *key, MARIA_RECORD_POS *root);
-extern int _ma_insert(MARIA_HA *info, MARIA_KEYDEF *keyinfo, byte *key,
- byte *anc_buff, byte *key_pos, byte *key_buff,
- byte *father_buff, byte *father_keypos,
+ uchar *key, MARIA_RECORD_POS *root);
+extern int _ma_insert(MARIA_HA *info, MARIA_KEYDEF *keyinfo, uchar *key,
+ uchar *anc_buff, uchar *key_pos, uchar *key_buff,
+ uchar *father_buff, uchar *father_keypos,
my_off_t father_page, my_bool insert_last);
extern int _ma_split_page(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- byte *key, byte *buff, byte *key_buff,
+ uchar *key, uchar *buff, uchar *key_buff,
my_bool insert_last);
-extern byte *_ma_find_half_pos(uint nod_flag, MARIA_KEYDEF *keyinfo,
- byte *page, byte *key,
+extern uchar *_ma_find_half_pos(uint nod_flag, MARIA_KEYDEF *keyinfo,
+ uchar *page, uchar *key,
uint *return_key_length,
- byte ** after_key);
+ uchar ** after_key);
extern int _ma_calc_static_key_length(MARIA_KEYDEF *keyinfo, uint nod_flag,
- byte *key_pos, byte *org_key,
- byte *key_buff, const byte *key,
+ uchar *key_pos, uchar *org_key,
+ uchar *key_buff, const uchar *key,
MARIA_KEY_PARAM *s_temp);
extern int _ma_calc_var_key_length(MARIA_KEYDEF *keyinfo, uint nod_flag,
- byte *key_pos, byte *org_key,
- byte *key_buff, const byte *key,
+ uchar *key_pos, uchar *org_key,
+ uchar *key_buff, const uchar *key,
MARIA_KEY_PARAM *s_temp);
extern int _ma_calc_var_pack_key_length(MARIA_KEYDEF *keyinfo,
- uint nod_flag, byte *key_pos,
- byte *org_key, byte *prev_key,
- const byte *key,
+ uint nod_flag, uchar *key_pos,
+ uchar *org_key, uchar *prev_key,
+ const uchar *key,
MARIA_KEY_PARAM *s_temp);
extern int _ma_calc_bin_pack_key_length(MARIA_KEYDEF *keyinfo,
- uint nod_flag, byte *key_pos,
- byte *org_key, byte *prev_key,
- const byte *key,
+ uint nod_flag, uchar *key_pos,
+ uchar *org_key, uchar *prev_key,
+ const uchar *key,
MARIA_KEY_PARAM *s_temp);
-void _ma_store_static_key(MARIA_KEYDEF *keyinfo, byte *key_pos,
+void _ma_store_static_key(MARIA_KEYDEF *keyinfo, uchar *key_pos,
MARIA_KEY_PARAM *s_temp);
-void _ma_store_var_pack_key(MARIA_KEYDEF *keyinfo, byte *key_pos,
+void _ma_store_var_pack_key(MARIA_KEYDEF *keyinfo, uchar *key_pos,
MARIA_KEY_PARAM *s_temp);
#ifdef NOT_USED
-void _ma_store_pack_key(MARIA_KEYDEF *keyinfo, byte *key_pos,
+void _ma_store_pack_key(MARIA_KEYDEF *keyinfo, uchar *key_pos,
MARIA_KEY_PARAM *s_temp);
#endif
-void _ma_store_bin_pack_key(MARIA_KEYDEF *keyinfo, byte *key_pos,
+void _ma_store_bin_pack_key(MARIA_KEYDEF *keyinfo, uchar *key_pos,
MARIA_KEY_PARAM *s_temp);
-extern int _ma_ck_delete(MARIA_HA *info, uint keynr, byte *key,
+extern int _ma_ck_delete(MARIA_HA *info, uint keynr, uchar *key,
uint key_length);
extern int _ma_readinfo(MARIA_HA *info, int lock_flag, int check_keybuffer);
extern int _ma_writeinfo(MARIA_HA *info, uint options);
@@ -682,91 +682,91 @@ extern int _ma_test_if_changed(MARIA_HA *info);
extern int _ma_mark_file_changed(MARIA_HA *info);
extern int _ma_decrement_open_count(MARIA_HA *info);
extern int _ma_check_index(MARIA_HA *info, int inx);
-extern int _ma_search(MARIA_HA *info, MARIA_KEYDEF *keyinfo, byte *key,
+extern int _ma_search(MARIA_HA *info, MARIA_KEYDEF *keyinfo, uchar *key,
uint key_len, uint nextflag, my_off_t pos);
extern int _ma_bin_search(struct st_maria_info *info, MARIA_KEYDEF *keyinfo,
- byte *page, byte *key, uint key_len,
- uint comp_flag, byte **ret_pos, byte *buff,
+ uchar *page, uchar *key, uint key_len,
+ uint comp_flag, uchar **ret_pos, uchar *buff,
my_bool *was_last_key);
extern int _ma_seq_search(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- byte *page, byte *key, uint key_len,
- uint comp_flag, byte ** ret_pos, byte *buff,
+ uchar *page, uchar *key, uint key_len,
+ uint comp_flag, uchar ** ret_pos, uchar *buff,
my_bool *was_last_key);
extern int _ma_prefix_search(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- byte *page, byte *key, uint key_len,
- uint comp_flag, byte ** ret_pos, byte *buff,
+ uchar *page, uchar *key, uint key_len,
+ uint comp_flag, uchar ** ret_pos, uchar *buff,
my_bool *was_last_key);
-extern my_off_t _ma_kpos(uint nod_flag, byte *after_key);
-extern void _ma_kpointer(MARIA_HA *info, byte *buff, my_off_t pos);
+extern my_off_t _ma_kpos(uint nod_flag, uchar *after_key);
+extern void _ma_kpointer(MARIA_HA *info, uchar *buff, my_off_t pos);
extern MARIA_RECORD_POS _ma_dpos(MARIA_HA *info, uint nod_flag,
- const byte *after_key);
-extern MARIA_RECORD_POS _ma_rec_pos(MARIA_SHARE *info, byte *ptr);
-extern void _ma_dpointer(MARIA_HA *info, byte *buff, MARIA_RECORD_POS pos);
+ const uchar *after_key);
+extern MARIA_RECORD_POS _ma_rec_pos(MARIA_SHARE *info, uchar *ptr);
+extern void _ma_dpointer(MARIA_HA *info, uchar *buff, MARIA_RECORD_POS pos);
extern uint _ma_get_static_key(MARIA_KEYDEF *keyinfo, uint nod_flag,
- byte **page, byte *key);
+ uchar **page, uchar *key);
extern uint _ma_get_pack_key(MARIA_KEYDEF *keyinfo, uint nod_flag,
- byte **page, byte *key);
+ uchar **page, uchar *key);
extern uint _ma_get_binary_pack_key(MARIA_KEYDEF *keyinfo, uint nod_flag,
- byte ** page_pos, byte *key);
-extern byte *_ma_get_last_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- byte *keypos, byte *lastkey,
- byte *endpos, uint *return_key_length);
-extern byte *_ma_get_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- byte *page, byte *key, byte *keypos,
+ uchar ** page_pos, uchar *key);
+extern uchar *_ma_get_last_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
+ uchar *keypos, uchar *lastkey,
+ uchar *endpos, uint *return_key_length);
+extern uchar *_ma_get_key(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
+ uchar *page, uchar *key, uchar *keypos,
uint *return_key_length);
-extern uint _ma_keylength(MARIA_KEYDEF *keyinfo, const byte *key);
-extern uint _ma_keylength_part(MARIA_KEYDEF *keyinfo, register const byte *key,
+extern uint _ma_keylength(MARIA_KEYDEF *keyinfo, const uchar *key);
+extern uint _ma_keylength_part(MARIA_KEYDEF *keyinfo, register const uchar *key,
HA_KEYSEG *end);
-extern byte *_ma_move_key(MARIA_KEYDEF *keyinfo, byte *to, const byte *from);
+extern uchar *_ma_move_key(MARIA_KEYDEF *keyinfo, uchar *to, const uchar *from);
extern int _ma_search_next(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- byte *key, uint key_length, uint nextflag,
+ uchar *key, uint key_length, uint nextflag,
my_off_t pos);
extern int _ma_search_first(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
my_off_t pos);
extern int _ma_search_last(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
my_off_t pos);
-extern byte *_ma_fetch_keypage(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- my_off_t page, int level, byte *buff,
+extern uchar *_ma_fetch_keypage(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
+ my_off_t page, int level, uchar *buff,
int return_buffer);
extern int _ma_write_keypage(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
- my_off_t page, int level, byte *buff);
+ my_off_t page, int level, uchar *buff);
extern int _ma_dispose(MARIA_HA *info, MARIA_KEYDEF *keyinfo, my_off_t pos,
int level);
extern my_off_t _ma_new(MARIA_HA *info, MARIA_KEYDEF *keyinfo, int level);
-extern uint _ma_make_key(MARIA_HA *info, uint keynr, byte *key,
- const byte *record, MARIA_RECORD_POS filepos);
-extern uint _ma_pack_key(MARIA_HA *info, uint keynr, byte *key,
- const byte *old, uint key_length,
+extern uint _ma_make_key(MARIA_HA *info, uint keynr, uchar *key,
+ const uchar *record, MARIA_RECORD_POS filepos);
+extern uint _ma_pack_key(MARIA_HA *info, uint keynr, uchar *key,
+ const uchar *old, uint key_length,
HA_KEYSEG ** last_used_keyseg);
-extern int _ma_read_key_record(MARIA_HA *info, byte *buf, MARIA_RECORD_POS);
-extern int _ma_read_cache(IO_CACHE *info, byte *buff, MARIA_RECORD_POS pos,
+extern int _ma_read_key_record(MARIA_HA *info, uchar *buf, MARIA_RECORD_POS);
+extern int _ma_read_cache(IO_CACHE *info, uchar *buff, MARIA_RECORD_POS pos,
uint length, int re_read_if_possibly);
-extern ulonglong ma_retrieve_auto_increment(MARIA_HA *info, const byte *record);
+extern ulonglong ma_retrieve_auto_increment(MARIA_HA *info, const uchar *record);
-extern my_bool _ma_alloc_buffer(byte **old_addr, my_size_t *old_size,
- my_size_t new_size);
-extern ulong _ma_rec_unpack(MARIA_HA *info, byte *to, byte *from,
+extern my_bool _ma_alloc_buffer(uchar **old_addr, size_t *old_size,
+ size_t new_size);
+extern ulong _ma_rec_unpack(MARIA_HA *info, uchar *to, uchar *from,
ulong reclength);
extern my_bool _ma_rec_check(MARIA_HA *info, const char *record,
- byte *packpos, ulong packed_length,
+ uchar *packpos, ulong packed_length,
my_bool with_checkum);
extern int _ma_write_part_record(MARIA_HA *info, my_off_t filepos,
ulong length, my_off_t next_filepos,
- byte ** record, ulong *reclength,
+ uchar ** record, ulong *reclength,
int *flag);
extern void _ma_print_key(FILE *stream, HA_KEYSEG *keyseg,
- const byte *key, uint length);
+ const uchar *key, uint length);
extern my_bool _ma_once_init_pack_row(MARIA_SHARE *share, File dfile);
extern my_bool _ma_once_end_pack_row(MARIA_SHARE *share);
-extern int _ma_read_pack_record(MARIA_HA *info, byte *buf,
+extern int _ma_read_pack_record(MARIA_HA *info, uchar *buf,
MARIA_RECORD_POS filepos);
-extern int _ma_read_rnd_pack_record(MARIA_HA *, byte *, MARIA_RECORD_POS,
+extern int _ma_read_rnd_pack_record(MARIA_HA *, uchar *, MARIA_RECORD_POS,
my_bool);
extern int _ma_pack_rec_unpack(MARIA_HA *info, MARIA_BIT_BUFF *bit_buff,
- byte *to, byte *from, ulong reclength);
+ uchar *to, uchar *from, ulong reclength);
extern ulonglong _ma_safe_mul(ulonglong a, ulonglong b);
-extern int _ma_ft_update(MARIA_HA *info, uint keynr, byte *keybuf,
- const byte *oldrec, const byte *newrec,
+extern int _ma_ft_update(MARIA_HA *info, uint keynr, uchar *keybuf,
+ const uchar *oldrec, const uchar *newrec,
my_off_t pos);
/*
@@ -821,30 +821,30 @@ typedef struct st_maria_block_info
#define fast_ma_readinfo(INFO) ((INFO)->lock_type == F_UNLCK) && _ma_readinfo((INFO),F_RDLCK,1)
extern uint _ma_get_block_info(MARIA_BLOCK_INFO *, File, my_off_t);
-extern uint _ma_rec_pack(MARIA_HA *info, byte *to, const byte *from);
+extern uint _ma_rec_pack(MARIA_HA *info, uchar *to, const uchar *from);
extern uint _ma_pack_get_block_info(MARIA_HA *maria, MARIA_BIT_BUFF *bit_buff,
- MARIA_BLOCK_INFO *info, byte **rec_buff_p,
- my_size_t *rec_buff_size,
+ MARIA_BLOCK_INFO *info, uchar **rec_buff_p,
+ size_t *rec_buff_size,
File file, my_off_t filepos);
-extern void _ma_store_blob_length(byte *pos, uint pack_length, uint length);
+extern void _ma_store_blob_length(uchar *pos, uint pack_length, uint length);
extern void _ma_report_error(int errcode, const char *file_name);
extern my_bool _ma_memmap_file(MARIA_HA *info);
extern void _ma_unmap_file(MARIA_HA *info);
-extern uint _ma_save_pack_length(uint version, byte * block_buff,
+extern uint _ma_save_pack_length(uint version, uchar * block_buff,
ulong length);
extern uint _ma_calc_pack_length(uint version, ulong length);
-extern ulong _ma_calc_blob_length(uint length, const byte *pos);
-extern uint _ma_mmap_pread(MARIA_HA *info, byte *Buffer,
+extern ulong _ma_calc_blob_length(uint length, const uchar *pos);
+extern uint _ma_mmap_pread(MARIA_HA *info, uchar *Buffer,
uint Count, my_off_t offset, myf MyFlags);
-extern uint _ma_mmap_pwrite(MARIA_HA *info, byte *Buffer,
+extern uint _ma_mmap_pwrite(MARIA_HA *info, uchar *Buffer,
uint Count, my_off_t offset, myf MyFlags);
-extern uint _ma_nommap_pread(MARIA_HA *info, byte *Buffer,
+extern uint _ma_nommap_pread(MARIA_HA *info, uchar *Buffer,
uint Count, my_off_t offset, myf MyFlags);
-extern uint _ma_nommap_pwrite(MARIA_HA *info, byte *Buffer,
+extern uint _ma_nommap_pwrite(MARIA_HA *info, uchar *Buffer,
uint Count, my_off_t offset, myf MyFlags);
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 _ma_state_info_read_dsk(File file, MARIA_STATE_INFO *state,
my_bool pRead);
uint _ma_base_info_write(File file, MARIA_BASE_INFO *base);
@@ -856,18 +856,18 @@ uint _ma_uniquedef_write(File file, MARIA_UNIQUEDEF *keydef);
char *_ma_uniquedef_read(char *ptr, MARIA_UNIQUEDEF *keydef);
uint _ma_columndef_write(File file, MARIA_COLUMNDEF *columndef);
char *_ma_columndef_read(char *ptr, MARIA_COLUMNDEF *columndef);
-ulong _ma_calc_total_blob_length(MARIA_HA *info, const byte *record);
-ha_checksum _ma_checksum(MARIA_HA *info, const byte *buf);
-ha_checksum _ma_static_checksum(MARIA_HA *info, const byte *buf);
+ulong _ma_calc_total_blob_length(MARIA_HA *info, const uchar *record);
+ha_checksum _ma_checksum(MARIA_HA *info, const uchar *buf);
+ha_checksum _ma_static_checksum(MARIA_HA *info, const uchar *buf);
my_bool _ma_check_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def,
- byte *record, ha_checksum unique_hash,
+ uchar *record, ha_checksum unique_hash,
MARIA_RECORD_POS pos);
-ha_checksum _ma_unique_hash(MARIA_UNIQUEDEF *def, const byte *buf);
+ha_checksum _ma_unique_hash(MARIA_UNIQUEDEF *def, const uchar *buf);
my_bool _ma_cmp_static_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def,
- const byte *record, MARIA_RECORD_POS pos);
+ const uchar *record, MARIA_RECORD_POS pos);
my_bool _ma_cmp_dynamic_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def,
- const byte *record, MARIA_RECORD_POS pos);
-my_bool _ma_unique_comp(MARIA_UNIQUEDEF *def, const byte *a, const byte *b,
+ const uchar *record, MARIA_RECORD_POS pos);
+my_bool _ma_unique_comp(MARIA_UNIQUEDEF *def, const uchar *a, const uchar *b,
my_bool null_are_equal);
void _ma_get_status(void *param, int concurrent_insert);
void _ma_update_status(void *param);
@@ -883,7 +883,7 @@ void _ma_setup_functions(register MARIA_SHARE *share);
my_bool _ma_dynmap_file(MARIA_HA *info, my_off_t size);
void _ma_remap_file(MARIA_HA *info, my_off_t size);
-MARIA_RECORD_POS _ma_write_init_default(MARIA_HA *info, const byte *record);
+MARIA_RECORD_POS _ma_write_init_default(MARIA_HA *info, const uchar *record);
my_bool _ma_write_abort_default(MARIA_HA *info);
/* Functions needed by _ma_check (are overrided in MySQL) */
diff --git a/storage/maria/maria_ftdump.c b/storage/maria/maria_ftdump.c
index 8b0256344cb..9df86b50474 100644
--- a/storage/maria/maria_ftdump.c
+++ b/storage/maria/maria_ftdump.c
@@ -46,7 +46,7 @@ static struct my_option my_long_options[] =
{"stats", 's', "Report global stats.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"verbose", 'v', "Be verbose.",
- (gptr*) &verbose, (gptr*) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &verbose, (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/maria/maria_pack.c b/storage/maria/maria_pack.c
index f6e962191c2..987711a270d 100644
--- a/storage/maria/maria_pack.c
+++ b/storage/maria/maria_pack.c
@@ -69,8 +69,8 @@ typedef struct st_huff_counts {
my_off_t pre_space[8];
my_off_t tot_end_space,tot_pre_space,zero_fields,empty_fields,bytes_packed;
TREE int_tree; /* Tree for detecting distinct column values. */
- byte *tree_buff; /* Column values, 'field_length' each. */
- byte *tree_pos; /* Points to end of column values in 'tree_buff'. */
+ uchar *tree_buff; /* Column values, 'field_length' each. */
+ uchar *tree_pos; /* Points to end of column values in 'tree_buff'. */
} HUFF_COUNTS;
typedef struct st_huff_element HUFF_ELEMENT;
@@ -141,8 +141,8 @@ static int test_space_compress(HUFF_COUNTS *huff_counts,my_off_t records,
enum en_fieldtype field_type);
static HUFF_TREE* make_huff_trees(HUFF_COUNTS *huff_counts,uint trees);
static int make_huff_tree(HUFF_TREE *tree,HUFF_COUNTS *huff_counts);
-static int compare_huff_elements(void *not_used, byte *a,byte *b);
-static int save_counts_in_queue(byte *key,element_count count,
+static int compare_huff_elements(void *not_used, uchar *a,uchar *b);
+static int save_counts_in_queue(uchar *key,element_count count,
HUFF_TREE *tree);
static my_off_t calc_packed_length(HUFF_COUNTS *huff_counts,uint flag);
static uint join_same_trees(HUFF_COUNTS *huff_counts,uint trees);
@@ -171,7 +171,7 @@ static int save_state(MARIA_HA *isam_file,PACK_MRG_INFO *mrg,my_off_t new_length
static int save_state_mrg(File file,PACK_MRG_INFO *isam_file,my_off_t new_length,
ha_checksum crc);
static int mrg_close(PACK_MRG_INFO *mrg);
-static int mrg_rrnd(PACK_MRG_INFO *info,byte *buf);
+static int mrg_rrnd(PACK_MRG_INFO *info,uchar *buf);
static void mrg_reset(PACK_MRG_INFO *mrg);
#if !defined(DBUG_OFF)
static void fakebigcodes(HUFF_COUNTS *huff_counts, HUFF_COUNTS *end_count);
@@ -259,10 +259,10 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"backup", 'b', "Make a backup of the table as table_name.OLD.",
- (gptr*) &backup, (gptr*) &backup, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &backup, (uchar**) &backup, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR_MP,
- "Directory where character sets are.", (gptr*) &charsets_dir,
- (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Directory where character sets are.", (uchar**) &charsets_dir,
+ (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"force", 'f',
@@ -270,7 +270,7 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"join", 'j',
"Join all given tables into 'new_table_name'. All tables MUST have identical layouts.",
- (gptr*) &join_table, (gptr*) &join_table, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
+ (uchar**) &join_table, (uchar**) &join_table, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
{"help", '?', "Display this help and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -284,8 +284,8 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"wait", 'w', "Wait and retry if table is in use.", (gptr*) &opt_wait,
- (gptr*) &opt_wait, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"wait", 'w', "Wait and retry if table is in use.", (uchar**) &opt_wait,
+ (uchar**) &opt_wait, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -481,7 +481,7 @@ static bool open_isam_files(PACK_MRG_INFO *mrg,char **names,uint count)
error:
while (i--)
maria_close(mrg->file[i]);
- my_free((gptr) mrg->file,MYF(0));
+ my_free((uchar*) mrg->file,MYF(0));
return 1;
}
@@ -606,14 +606,14 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table)
/*
If the packed lengths of combined columns is less then the sum of
the non-combined columns, then create common Huffman trees for them.
- We do this only for byte compressed columns, not for distinct values
+ We do this only for uchar compressed columns, not for distinct values
compressed columns.
*/
if ((int) (used_trees=join_same_trees(huff_counts,trees)) < 0)
goto err;
/*
- Assign codes to all byte or column values.
+ Assign codes to all uchar or column values.
*/
if (make_huff_decode_table(huff_trees,fields))
goto err;
@@ -827,11 +827,11 @@ static void free_counts_and_tree_and_queue(HUFF_TREE *huff_trees, uint trees,
for (i=0 ; i < trees ; i++)
{
if (huff_trees[i].element_buffer)
- my_free((gptr) huff_trees[i].element_buffer,MYF(0));
+ my_free((uchar*) huff_trees[i].element_buffer,MYF(0));
if (huff_trees[i].code)
- my_free((gptr) huff_trees[i].code,MYF(0));
+ my_free((uchar*) huff_trees[i].code,MYF(0));
}
- my_free((gptr) huff_trees,MYF(0));
+ my_free((uchar*) huff_trees,MYF(0));
}
if (huff_counts)
{
@@ -839,11 +839,11 @@ static void free_counts_and_tree_and_queue(HUFF_TREE *huff_trees, uint trees,
{
if (huff_counts[i].tree_buff)
{
- my_free((gptr) huff_counts[i].tree_buff,MYF(0));
+ my_free((uchar*) huff_counts[i].tree_buff,MYF(0));
delete_tree(&huff_counts[i].int_tree);
}
}
- my_free((gptr) huff_counts,MYF(0));
+ my_free((uchar*) huff_counts,MYF(0));
}
delete_queue(&queue); /* This is safe to free */
return;
@@ -856,16 +856,16 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
int error;
uint length, null_bytes;
ulong reclength,max_blob_length;
- byte *record,*pos,*next_pos,*end_pos,*start_pos;
+ uchar *record,*pos,*next_pos,*end_pos,*start_pos;
ha_rows record_count;
HUFF_COUNTS *count,*end_count;
TREE_ELEMENT *element;
- ha_checksum(*calc_checksum) (struct st_maria_info *, const byte *);
+ ha_checksum(*calc_checksum) (struct st_maria_info *, const uchar *);
DBUG_ENTER("get_statistic");
reclength= mrg->file[0]->s->base.reclength;
null_bytes= mrg->file[0]->s->base.null_bytes;
- record=(byte*) my_alloca(reclength);
+ record=(uchar*) my_alloca(reclength);
end_count=huff_counts+mrg->file[0]->s->base.fields;
record_count=0; glob_crc=0;
max_blob_length=0;
@@ -1040,7 +1040,7 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
{
uint i;
/* Zero fields are just counted. Go to the next record. */
- if (!memcmp((byte*) start_pos,zero_string,count->field_length))
+ if (!memcmp((uchar*) start_pos,zero_string,count->field_length))
{
count->zero_fields++;
continue;
@@ -1063,7 +1063,7 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
continue;
/*
- Count the incidence of every byte value in the
+ Count the incidence of every uchar value in the
significant field value.
*/
for ( ; pos < end_pos ; pos++)
@@ -1102,10 +1102,10 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
DBUG_EXECUTE_IF("fakebigcodes", fakebigcodes(huff_counts, end_count););
DBUG_PRINT("info", ("Found the following number of incidents "
- "of the byte codes:"));
+ "of the uchar codes:"));
if (verbose >= 2)
VOID(printf("Found the following number of incidents "
- "of the byte codes:\n"));
+ "of the uchar codes:\n"));
for (count= huff_counts ; count < end_count; count++)
{
uint idx;
@@ -1149,12 +1149,12 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
mrg->records=record_count;
mrg->max_blob_length=max_blob_length;
- my_afree((gptr) record);
+ my_afree((uchar*) record);
DBUG_RETURN(error != HA_ERR_END_OF_FILE);
}
static int compare_huff_elements(void *not_used __attribute__((unused)),
- byte *a, byte *b)
+ uchar *a, uchar *b)
{
return *((my_off_t*) a) < *((my_off_t*) b) ? -1 :
(*((my_off_t*) a) == *((my_off_t*) b) ? 0 : 1);
@@ -1170,7 +1170,7 @@ static void check_counts(HUFF_COUNTS *huff_counts, uint trees,
my_off_t old_length,new_length,length;
DBUG_ENTER("check_counts");
- bzero((gptr) field_count,sizeof(field_count));
+ bzero((uchar*) field_count,sizeof(field_count));
space_fields=fill_zero_fields=0;
for (; trees-- ; huff_counts++)
@@ -1336,12 +1336,12 @@ static void check_counts(HUFF_COUNTS *huff_counts, uint trees,
}
else
{
- my_free((gptr) huff_counts->tree_buff,MYF(0));
+ my_free((uchar*) huff_counts->tree_buff,MYF(0));
delete_tree(&huff_counts->int_tree);
huff_counts->tree_buff=0;
}
if (tree.element_buffer)
- my_free((gptr) tree.element_buffer,MYF(0));
+ my_free((uchar*) tree.element_buffer,MYF(0));
}
if (huff_counts->pack_type & PACK_TYPE_SPACE_FIELDS)
space_fields++;
@@ -1459,8 +1459,8 @@ static HUFF_TREE* make_huff_trees(HUFF_COUNTS *huff_counts, uint trees)
if (make_huff_tree(huff_tree+tree,huff_counts+tree))
{
while (tree--)
- my_free((gptr) huff_tree[tree].element_buffer,MYF(0));
- my_free((gptr) huff_tree,MYF(0));
+ my_free((uchar*) huff_tree[tree].element_buffer,MYF(0));
+ my_free((uchar*) huff_tree,MYF(0));
DBUG_RETURN(0);
}
}
@@ -1502,7 +1502,7 @@ static int make_huff_tree(HUFF_TREE *huff_tree, HUFF_COUNTS *huff_counts)
}
else
{
- /* Count the number of byte codes found in the column. */
+ /* Count the number of uchar codes found in the column. */
for (i=found=0 ; i < 256 ; i++)
{
if (huff_counts->counts[i])
@@ -1535,7 +1535,7 @@ static int make_huff_tree(HUFF_TREE *huff_tree, HUFF_COUNTS *huff_counts)
{
HUFF_ELEMENT *temp;
if (!(temp=
- (HUFF_ELEMENT*) my_realloc((gptr) huff_tree->element_buffer,
+ (HUFF_ELEMENT*) my_realloc((uchar*) huff_tree->element_buffer,
found*2*sizeof(HUFF_ELEMENT),
MYF(MY_WME))))
return 1;
@@ -1570,7 +1570,7 @@ static int make_huff_tree(HUFF_TREE *huff_tree, HUFF_COUNTS *huff_counts)
*/
tree_walk(&huff_counts->int_tree,
(int (*)(void*, element_count,void*)) save_counts_in_queue,
- (gptr) huff_tree, left_root_right);
+ (uchar*) huff_tree, left_root_right);
}
else
{
@@ -1580,7 +1580,7 @@ static int make_huff_tree(HUFF_TREE *huff_tree, HUFF_COUNTS *huff_counts)
(huff_tree->offset_bits+1)*
(found-2)+7)/8;
/*
- Put a HUFF_ELEMENT into the queue for every byte code found in the column.
+ Put a HUFF_ELEMENT into the queue for every uchar code found in the column.
The elements are taken from the target trees element buffer.
Instead of using queue_insert(), we just place references to the
@@ -1596,11 +1596,11 @@ static int make_huff_tree(HUFF_TREE *huff_tree, HUFF_COUNTS *huff_counts)
new_huff_el->count=huff_counts->counts[i];
new_huff_el->a.leaf.null=0;
new_huff_el->a.leaf.element_nr=i;
- queue.root[found]=(byte*) new_huff_el;
+ queue.root[found]=(uchar*) new_huff_el;
}
}
/*
- If there is only a single byte value in this field in all records,
+ If there is only a single uchar value in this field in all records,
add a second element with zero incidence. This is required to enter
the loop, which builds the Huffman tree.
*/
@@ -1613,7 +1613,7 @@ static int make_huff_tree(HUFF_TREE *huff_tree, HUFF_COUNTS *huff_counts)
new_huff_el->a.leaf.element_nr=huff_tree->min_chr=last-1;
else
new_huff_el->a.leaf.element_nr=huff_tree->max_chr=last+1;
- queue.root[found]=(byte*) new_huff_el;
+ queue.root[found]=(uchar*) new_huff_el;
}
}
@@ -1650,7 +1650,7 @@ static int make_huff_tree(HUFF_TREE *huff_tree, HUFF_COUNTS *huff_counts)
The Huffman algorithm assigns another bit to the code for a byte
every time that bytes incidence is combined (directly or indirectly)
to a new element as one of the two least incidence elements.
- This means that one more bit per incidence of that byte is required
+ This means that one more bit per incidence of that uchar is required
in the resulting file. So we add the new combined incidence as the
number of bits by which the result grows.
*/
@@ -1663,7 +1663,7 @@ static int make_huff_tree(HUFF_TREE *huff_tree, HUFF_COUNTS *huff_counts)
Replace the copied top element by the new element and re-order the
queue.
*/
- queue.root[1]=(byte*) new_huff_el;
+ queue.root[1]=(uchar*) new_huff_el;
queue_replaced(&queue);
}
huff_tree->root=(HUFF_ELEMENT*) queue.root[1];
@@ -1702,7 +1702,7 @@ static int compare_tree(void* cmp_arg __attribute__((unused)),
0
*/
-static int save_counts_in_queue(byte *key, element_count count,
+static int save_counts_in_queue(uchar *key, element_count count,
HUFF_TREE *tree)
{
HUFF_ELEMENT *new_huff_el;
@@ -1712,7 +1712,7 @@ static int save_counts_in_queue(byte *key, element_count count,
new_huff_el->a.leaf.null=0;
new_huff_el->a.leaf.element_nr= (uint) (key- tree->counts->tree_buff) /
tree->counts->field_length;
- queue.root[tree->elements]=(byte*) new_huff_el;
+ queue.root[tree->elements]=(uchar*) new_huff_el;
return 0;
}
@@ -1727,7 +1727,7 @@ static int save_counts_in_queue(byte *key, element_count count,
DESCRIPTION
We need to follow the Huffman algorithm until we know, how many bits
- are required for each byte code. But we do not need the resulting
+ are required for each uchar code. But we do not need the resulting
Huffman tree. Hence, we can leave out some steps which are essential
in make_huff_tree().
@@ -1746,7 +1746,7 @@ static my_off_t calc_packed_length(HUFF_COUNTS *huff_counts,
/*
WARNING: We use a small hack for efficiency: Instead of placing
references to HUFF_ELEMENTs into the queue, we just insert
- references to the counts of the byte codes which appeared in this
+ references to the counts of the uchar codes which appeared in this
table column. During the Huffman algorithm they are successively
replaced by references to HUFF_ELEMENTs. This works, because
HUFF_ELEMENTs have the incidence count at their beginning.
@@ -1756,7 +1756,7 @@ static my_off_t calc_packed_length(HUFF_COUNTS *huff_counts,
same type.
Instead of using queue_insert(), we just copy the references into
- the buffer of the priority queue. We insert in byte value order, but
+ the buffer of the priority queue. We insert in uchar value order, but
the order is in fact irrelevant here. We will establish the correct
order later.
*/
@@ -1769,18 +1769,18 @@ static my_off_t calc_packed_length(HUFF_COUNTS *huff_counts,
first=i;
last=i;
/* We start with root[1], which is the queues top element. */
- queue.root[found]=(byte*) &huff_counts->counts[i];
+ queue.root[found]=(uchar*) &huff_counts->counts[i];
}
}
if (!found)
DBUG_RETURN(0); /* Empty tree */
/*
- If there is only a single byte value in this field in all records,
+ If there is only a single uchar value in this field in all records,
add a second element with zero incidence. This is required to enter
the loop, which follows the Huffman algorithm.
*/
if (found < 2)
- queue.root[++found]=(byte*) &huff_counts->counts[last ? 0 : 1];
+ queue.root[++found]=(uchar*) &huff_counts->counts[last ? 0 : 1];
/* Make a queue from the queue buffer. */
queue.elements=found;
@@ -1824,7 +1824,7 @@ static my_off_t calc_packed_length(HUFF_COUNTS *huff_counts,
The Huffman algorithm assigns another bit to the code for a byte
every time that bytes incidence is combined (directly or indirectly)
to a new element as one of the two least incidence elements.
- This means that one more bit per incidence of that byte is required
+ This means that one more bit per incidence of that uchar is required
in the resulting file. So we add the new combined incidence as the
number of bits by which the result grows.
*/
@@ -1835,7 +1835,7 @@ static my_off_t calc_packed_length(HUFF_COUNTS *huff_counts,
queue. This successively replaces the references to counts by
references to HUFF_ELEMENTs.
*/
- queue.root[1]=(byte*) new_huff_el;
+ queue.root[1]=(uchar*) new_huff_el;
queue_replaced(&queue);
}
DBUG_RETURN(bytes_packed+(bits_packed+7)/8);
@@ -1868,12 +1868,12 @@ static uint join_same_trees(HUFF_COUNTS *huff_counts, uint trees)
i->tree->tree_pack_length+j->tree->tree_pack_length+
ALLOWED_JOIN_DIFF)
{
- memcpy_fixed((byte*) i->counts,(byte*) count.counts,
+ memcpy_fixed((uchar*) i->counts,(uchar*) count.counts,
sizeof(count.counts[0])*256);
- my_free((gptr) j->tree->element_buffer,MYF(0));
+ my_free((uchar*) j->tree->element_buffer,MYF(0));
j->tree->element_buffer=0;
j->tree=i->tree;
- bmove((byte*) i->counts,(byte*) count.counts,
+ bmove((uchar*) i->counts,(uchar*) count.counts,
sizeof(count.counts[0])*256);
if (make_huff_tree(i->tree,i))
return (uint) -1;
@@ -2016,7 +2016,7 @@ static char *hexdigits(ulonglong value)
static int write_header(PACK_MRG_INFO *mrg,uint head_length,uint trees,
my_off_t tot_elements,my_off_t filelength)
{
- byte *buff= (byte*) file_buffer.pos;
+ uchar *buff= (uchar*) file_buffer.pos;
bzero(buff,HEAD_LENGTH);
memcpy_fixed(buff,maria_pack_file_magic,4);
@@ -2032,7 +2032,7 @@ static int write_header(PACK_MRG_INFO *mrg,uint head_length,uint trees,
if (test_only)
return 0;
VOID(my_seek(file_buffer.file,0L,MY_SEEK_SET,MYF(0)));
- return my_write(file_buffer.file,(const byte *) file_buffer.pos,HEAD_LENGTH,
+ return my_write(file_buffer.file,(const uchar *) file_buffer.pos,HEAD_LENGTH,
MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL)) != 0;
}
@@ -2168,7 +2168,7 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
{ /* This should be impossible */
VOID(fprintf(stderr, "Tree offset got too big: %d, aborted\n",
huff_tree->max_offset));
- my_afree((gptr) packed_tree);
+ my_afree((uchar*) packed_tree);
return 0;
}
@@ -2179,7 +2179,7 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
huff_tree->char_bits));
if (!huff_tree->counts->tree_buff)
{
- /* We do a byte compression on this column. Mark with bit 0. */
+ /* We do a uchar compression on this column. Mark with bit 0. */
write_bits(0,1);
write_bits(huff_tree->min_chr,8);
write_bits(huff_tree->elements,9);
@@ -2340,7 +2340,7 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
DBUG_PRINT("info", (" "));
if (verbose >= 2)
VOID(printf("\n"));
- my_afree((gptr) packed_tree);
+ my_afree((uchar*) packed_tree);
if (errors)
{
VOID(fprintf(stderr, "Error: Generated decode trees are corrupt. Stop.\n"));
@@ -2366,7 +2366,7 @@ static uint *make_offset_code_tree(HUFF_TREE *huff_tree, HUFF_ELEMENT *element,
*/
if (!element->a.nod.left->a.leaf.null)
{
- /* Store the byte code or the index of the column value. */
+ /* Store the uchar code or the index of the column value. */
prev_offset[0] =(uint) element->a.nod.left->a.leaf.element_nr;
offset+=2;
}
@@ -2374,7 +2374,7 @@ static uint *make_offset_code_tree(HUFF_TREE *huff_tree, HUFF_ELEMENT *element,
{
/*
Recursively traverse the tree to the left. Mark it as an offset to
- another tree node (in contrast to a byte code or column value index).
+ another tree node (in contrast to a uchar code or column value index).
*/
prev_offset[0]= IS_OFFSET+2;
offset=make_offset_code_tree(huff_tree,element->a.nod.left,offset+2);
@@ -2383,7 +2383,7 @@ static uint *make_offset_code_tree(HUFF_TREE *huff_tree, HUFF_ELEMENT *element,
/* Now, check the right child. */
if (!element->a.nod.right->a.leaf.null)
{
- /* Store the byte code or the index of the column value. */
+ /* Store the uchar code or the index of the column value. */
prev_offset[1]=element->a.nod.right->a.leaf.element_nr;
return offset;
}
@@ -2391,7 +2391,7 @@ static uint *make_offset_code_tree(HUFF_TREE *huff_tree, HUFF_ELEMENT *element,
{
/*
Recursively traverse the tree to the right. Mark it as an offset to
- another tree node (in contrast to a byte code or column value index).
+ another tree node (in contrast to a uchar code or column value index).
*/
uint temp=(uint) (offset-prev_offset-1);
prev_offset[1]= IS_OFFSET+ temp;
@@ -2421,7 +2421,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
my_off_t record_count;
char llbuf[32];
ulong length,pack_length;
- byte *record,*pos,*end_pos,*record_pos,*start_pos;
+ uchar *record,*pos,*end_pos,*record_pos,*start_pos;
HUFF_COUNTS *count,*end_count;
HUFF_TREE *tree;
MARIA_HA *isam_file=mrg->file[0];
@@ -2429,7 +2429,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
DBUG_ENTER("compress_isam_file");
/* Allocate a buffer for the records (excluding blobs). */
- if (!(record=(byte*) my_alloca(isam_file->s->base.reclength)))
+ if (!(record=(uchar*) my_alloca(isam_file->s->base.reclength)))
return -1;
end_count=huff_counts+isam_file->s->base.fields;
@@ -2482,7 +2482,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
{
if (flush_buffer((ulong) max_calc_length + (ulong) max_pack_length))
break;
- record_pos= (byte*) file_buffer.pos;
+ record_pos= (uchar*) file_buffer.pos;
file_buffer.pos+= max_pack_length;
if (null_bytes)
{
@@ -2527,7 +2527,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
switch (count->field_type) {
case FIELD_SKIP_ZERO:
- if (!memcmp((byte*) start_pos,zero_string,field_length))
+ if (!memcmp((uchar*) start_pos,zero_string,field_length))
{
DBUG_PRINT("fields", ("FIELD_SKIP_ZERO zeroes only, bits: 1"));
write_bits(1,1);
@@ -2656,7 +2656,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
break;
case FIELD_INTERVALL:
global_count=count;
- pos=(byte*) tree_search(&count->int_tree, start_pos,
+ pos=(uchar*) tree_search(&count->int_tree, start_pos,
count->int_tree.custom_arg);
intervall=(uint) (pos - count->tree_buff)/field_length;
DBUG_PRINT("fields", ("FIELD_INTERVALL"));
@@ -2679,7 +2679,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
}
else
{
- byte *blob,*blob_end;
+ uchar *blob,*blob_end;
DBUG_PRINT("fields", ("FIELD_BLOB not empty, bits: 1"));
write_bits(0,1);
/* Write the blob length. */
@@ -2720,7 +2720,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
}
else
{
- byte *end= start_pos + var_pack_length + col_length;
+ uchar *end= start_pos + var_pack_length + col_length;
DBUG_PRINT("fields", ("FIELD_VARCHAR not empty, bits: 1"));
write_bits(0,1);
/* Write the varchar length. */
@@ -2752,7 +2752,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
DBUG_PRINT("fields", ("---"));
}
flush_bits();
- length=(ulong) ((byte*) file_buffer.pos - record_pos) - max_pack_length;
+ length=(ulong) ((uchar*) file_buffer.pos - record_pos) - max_pack_length;
pack_length= _ma_save_pack_length(pack_version, record_pos, length);
if (pack_blob_length)
pack_length+= _ma_save_pack_length(pack_version,
@@ -2793,7 +2793,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
if (verbose >= 2)
VOID(printf("wrote %s records.\n", llstr((longlong) record_count, llbuf)));
- my_afree((gptr) record);
+ my_afree((uchar*) record);
mrg->ref_length=max_pack_length;
mrg->min_pack_length=max_record_length ? min_record_length : 0;
mrg->max_pack_length=max_record_length;
@@ -2843,7 +2843,7 @@ static int flush_buffer(ulong neaded_length)
/*
file_buffer.end is 8 bytes lower than the real end of the buffer.
This is done so that the end-of-buffer condition does not need to be
- checked for every byte (see write_bits()). Consequently,
+ checked for every uchar (see write_bits()). Consequently,
file_buffer.pos can become greater than file_buffer.end. The
algorithms in the other functions ensure that there will never be
more than 8 bytes written to the buffer without an end-of-buffer
@@ -2860,7 +2860,7 @@ static int flush_buffer(ulong neaded_length)
if (test_only)
return 0;
if (error_on_write|| my_write(file_buffer.file,
- (const byte*) file_buffer.buffer,
+ (const uchar*) file_buffer.buffer,
length,
MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL)))
{
@@ -2887,7 +2887,7 @@ static int flush_buffer(ulong neaded_length)
static void end_file_buffer(void)
{
- my_free((gptr) file_buffer.buffer,MYF(0));
+ my_free((uchar*) file_buffer.buffer,MYF(0));
}
/* output `bits` low bits of `value' */
@@ -3048,7 +3048,7 @@ static void mrg_reset(PACK_MRG_INFO *mrg)
}
}
-static int mrg_rrnd(PACK_MRG_INFO *info,byte *buf)
+static int mrg_rrnd(PACK_MRG_INFO *info,uchar *buf)
{
int error;
MARIA_HA *isam_info;
@@ -3095,7 +3095,7 @@ static int mrg_close(PACK_MRG_INFO *mrg)
for (i=0 ; i < mrg->count ; i++)
error|=maria_close(mrg->file[i]);
if (mrg->free_file)
- my_free((gptr) mrg->file,MYF(0));
+ my_free((uchar*) mrg->file,MYF(0));
DBUG_RETURN(error);
}
@@ -3127,8 +3127,8 @@ static int mrg_close(PACK_MRG_INFO *mrg)
To get 64(32)-bit codes, I sort the counts by decreasing incidence.
I assign counts of 1 to the two most frequent values, a count of 2
for the next one, then 4, 8, and so on until 2**64-1(2**30-1). All
- the remaining values get 1. That way every possible byte has an
- assigned code, though not all codes are used if not all byte values
+ the remaining values get 1. That way every possible uchar has an
+ assigned code, though not all codes are used if not all uchar values
are present in the column.
This strategy would work with distinct column values too, but
@@ -3158,7 +3158,7 @@ static void fakebigcodes(HUFF_COUNTS *huff_counts, HUFF_COUNTS *end_count)
*/
if (huff_counts->tree_buff)
{
- my_free((gptr) huff_counts->tree_buff, MYF(0));
+ my_free((uchar*) huff_counts->tree_buff, MYF(0));
delete_tree(&huff_counts->int_tree);
huff_counts->tree_buff= NULL;
DBUG_PRINT("fakebigcodes", ("freed distinct column values"));
diff --git a/storage/maria/tablockman.c b/storage/maria/tablockman.c
index 4634f60a085..b7e2d62e1ab 100644
--- a/storage/maria/tablockman.c
+++ b/storage/maria/tablockman.c
@@ -231,7 +231,7 @@ static inline
TABLE_LOCK *find_by_loid(LOCKED_TABLE *table, uint16 loid)
{
return (TABLE_LOCK *)hash_search(& table->latest_locks,
- (byte *)& loid, sizeof(loid));
+ (uchar *)& loid, sizeof(loid));
}
static inline
@@ -487,8 +487,8 @@ tablockman_getlock(TABLOCKMAN *lm, TABLE_LOCK_OWNER *lo,
/* update the latest_locks hash */
if (old)
- hash_delete(& table->latest_locks, (byte *)old);
- hash_insert(& table->latest_locks, (byte *)new);
+ hash_delete(& table->latest_locks, (uchar *)old);
+ hash_insert(& table->latest_locks, (uchar *)new);
new->upgraded_from= old;
@@ -571,7 +571,7 @@ void tablockman_release_locks(TABLOCKMAN *lm, TABLE_LOCK_OWNER *lo)
/* TODO ? group locks by table to reduce the number of mutex locks */
pthread_mutex_lock(mutex);
- hash_delete(& cur->table->latest_locks, (byte *)cur);
+ hash_delete(& cur->table->latest_locks, (uchar *)cur);
if (cur->prev)
cur->prev->next= cur->next;
diff --git a/storage/maria/trnman.c b/storage/maria/trnman.c
index 83249ab328f..4f009a7d5a8 100644
--- a/storage/maria/trnman.c
+++ b/storage/maria/trnman.c
@@ -94,11 +94,11 @@ static TRN *short_trid_to_TRN(uint16 short_trid)
}
#endif
-static byte *trn_get_hash_key(const byte *trn, uint* len,
+static uchar *trn_get_hash_key(const uchar *trn, uint* len,
my_bool unused __attribute__ ((unused)))
{
*len= sizeof(TrID);
- return (byte *) & ((*((TRN **)trn))->trid);
+ return (uchar *) & ((*((TRN **)trn))->trid);
}
int trnman_init()
diff --git a/storage/maria/trnman.h b/storage/maria/trnman.h
index 1a4423f2a11..fce02d9ab89 100644
--- a/storage/maria/trnman.h
+++ b/storage/maria/trnman.h
@@ -24,7 +24,7 @@ C_MODE_START
#include "ma_loghandler_lsn.h"
/*
- trid - 6 byte transaction identifier. Assigned when a transaction
+ trid - 6 uchar transaction identifier. Assigned when a transaction
is created. Transaction can always be identified by its trid,
even after transaction has ended.
diff --git a/storage/maria/unittest/ma_pagecache_consist.c b/storage/maria/unittest/ma_pagecache_consist.c
index 39170693573..54491a09c3b 100644
--- a/storage/maria/unittest/ma_pagecache_consist.c
+++ b/storage/maria/unittest/ma_pagecache_consist.c
@@ -125,7 +125,7 @@ uint check_page(uchar *buff, ulong offset, int page_locked, int page_no,
(page_locked ? "locked" : "unlocked"),
end, num, tag);
h= my_open("wrong_page", O_CREAT | O_TRUNC | O_RDWR, MYF(0));
- my_pwrite(h, (byte*) buff, PAGE_SIZE, 0, MYF(0));
+ my_pwrite(h, (uchar*) buff, PAGE_SIZE, 0, MYF(0));
my_close(h, MYF(0));
goto err;
}
@@ -264,7 +264,7 @@ static void *test_thread_reader(void *arg)
thread_count--;
VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */
pthread_mutex_unlock(&LOCK_thread_count);
- free((gptr) arg);
+ free((uchar*) arg);
my_thread_end();
DBUG_RETURN(0);
}
@@ -284,7 +284,7 @@ static void *test_thread_writer(void *arg)
thread_count--;
VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */
pthread_mutex_unlock(&LOCK_thread_count);
- free((gptr) arg);
+ free((uchar*) arg);
my_thread_end();
DBUG_RETURN(0);
}
diff --git a/storage/maria/unittest/ma_pagecache_single.c b/storage/maria/unittest/ma_pagecache_single.c
index 7b77315e18c..8add95e8a36 100644
--- a/storage/maria/unittest/ma_pagecache_single.c
+++ b/storage/maria/unittest/ma_pagecache_single.c
@@ -448,7 +448,7 @@ static void *test_thread(void *arg)
thread_count--;
VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */
pthread_mutex_unlock(&LOCK_thread_count);
- free((gptr) arg);
+ free((uchar*) arg);
my_thread_end();
DBUG_RETURN(0);
}
diff --git a/storage/maria/unittest/ma_test_loghandler-t.c b/storage/maria/unittest/ma_test_loghandler-t.c
index e31136d52ec..40f9e72c3b2 100644
--- a/storage/maria/unittest/ma_test_loghandler-t.c
+++ b/storage/maria/unittest/ma_test_loghandler-t.c
@@ -56,10 +56,10 @@ static TRN *trn= &dummy_transaction_object;
1 - Error
*/
-static my_bool check_content(byte *ptr, ulong length)
+static my_bool check_content(uchar *ptr, ulong length)
{
ulong i;
- byte buff[2];
+ uchar buff[2];
for (i= 0; i < length; i++)
{
if (i % 2 == 0)
@@ -107,7 +107,7 @@ void read_ok(TRANSLOG_HEADER_BUFFER *rec)
*/
static my_bool read_and_check_content(TRANSLOG_HEADER_BUFFER *rec,
- byte *buffer, uint skip)
+ uchar *buffer, uint skip)
{
DBUG_ASSERT(rec->record_length < LONG_BUFFER_SIZE * 2 + 7 * 2 + 2);
if (translog_read_record(rec->lsn, 0, rec->record_length, buffer, NULL) !=
@@ -122,14 +122,14 @@ int main(int argc __attribute__((unused)), char *argv[])
uint32 i;
uint32 rec_len;
uint pagen;
- byte long_tr_id[6];
- byte lsn_buff[23]=
+ uchar long_tr_id[6];
+ uchar lsn_buff[23]=
{
0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA,
0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA,
0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55
};
- byte long_buffer[LONG_BUFFER_SIZE * 2 + LSN_STORE_SIZE * 2 + 2];
+ uchar long_buffer[LONG_BUFFER_SIZE * 2 + LSN_STORE_SIZE * 2 + 2];
PAGECACHE pagecache;
LSN lsn, lsn_base, first_lsn;
TRANSLOG_HEADER_BUFFER rec;
diff --git a/storage/maria/unittest/ma_test_loghandler_multigroup-t.c b/storage/maria/unittest/ma_test_loghandler_multigroup-t.c
index 1281ee425d8..6a27321ec98 100644
--- a/storage/maria/unittest/ma_test_loghandler_multigroup-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_multigroup-t.c
@@ -44,10 +44,10 @@ static TRN *trn= &dummy_transaction_object;
1 - Error
*/
-static my_bool check_content(byte *ptr, ulong length)
+static my_bool check_content(uchar *ptr, ulong length)
{
ulong i;
- byte buff[4];
+ uchar buff[4];
DBUG_ENTER("check_content");
for (i= 0; i < length; i++)
{
@@ -81,7 +81,7 @@ static my_bool check_content(byte *ptr, ulong length)
*/
static my_bool read_and_check_content(TRANSLOG_HEADER_BUFFER *rec,
- byte *buffer, uint skip)
+ uchar *buffer, uint skip)
{
int res= 0;
translog_size_t len;
@@ -115,14 +115,14 @@ int main(int argc __attribute__((unused)), char *argv[])
uint32 i;
uint32 rec_len;
uint pagen;
- byte long_tr_id[6];
- byte lsn_buff[23]=
+ uchar long_tr_id[6];
+ uchar lsn_buff[23]=
{
0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA,
0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA,
0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55
};
- byte *long_buffer= malloc(LONG_BUFFER_SIZE + LSN_STORE_SIZE * 2 + 2);
+ uchar *long_buffer= malloc(LONG_BUFFER_SIZE + LSN_STORE_SIZE * 2 + 2);
PAGECACHE pagecache;
LSN lsn, lsn_base, first_lsn;
TRANSLOG_HEADER_BUFFER rec;
@@ -138,7 +138,7 @@ int main(int argc __attribute__((unused)), char *argv[])
exit(1);
{
- byte buff[4];
+ uchar buff[4];
for (i= 0; i < (LONG_BUFFER_SIZE + LSN_STORE_SIZE * 2 + 2); i++)
{
if (i % 4 == 0)
diff --git a/storage/maria/unittest/ma_test_loghandler_multithread-t.c b/storage/maria/unittest/ma_test_loghandler_multithread-t.c
index ff966160acc..bf3ede113c0 100644
--- a/storage/maria/unittest/ma_test_loghandler_multithread-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_multithread-t.c
@@ -30,7 +30,7 @@ static uint thread_count;
static ulong lens[WRITERS][ITERATIONS];
static LSN lsns1[WRITERS][ITERATIONS];
static LSN lsns2[WRITERS][ITERATIONS];
-static byte *long_buffer;
+static uchar *long_buffer;
/*
Get pseudo-random length of the field in
@@ -68,7 +68,7 @@ static uint32 get_len()
1 - Error
*/
-static my_bool check_content(byte *ptr, ulong length)
+static my_bool check_content(uchar *ptr, ulong length)
{
ulong i;
for (i= 0; i < length; i++)
@@ -100,7 +100,7 @@ static my_bool check_content(byte *ptr, ulong length)
static my_bool read_and_check_content(TRANSLOG_HEADER_BUFFER *rec,
- byte *buffer, uint skip)
+ uchar *buffer, uint skip)
{
int res= 0;
translog_size_t len;
@@ -120,7 +120,7 @@ void writer(int num)
{
LSN lsn;
TRN trn;
- byte long_tr_id[6];
+ uchar long_tr_id[6];
uint i;
trn.short_id= num;
@@ -186,7 +186,7 @@ static void *test_thread_writer(void *arg)
VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are
ready */
pthread_mutex_unlock(&LOCK_thread_count);
- free((gptr) arg);
+ free((uchar*) arg);
my_thread_end();
return(0);
}
@@ -292,7 +292,7 @@ int main(int argc __attribute__((unused)),
srandom(122334817L);
{
LEX_STRING parts[TRANSLOG_INTERNAL_PARTS + 1];
- byte long_tr_id[6]=
+ uchar long_tr_id[6]=
{
0x11, 0x22, 0x33, 0x44, 0x55, 0x66
};
diff --git a/storage/maria/unittest/ma_test_loghandler_pagecache-t.c b/storage/maria/unittest/ma_test_loghandler_pagecache-t.c
index 35e05f9c997..327b8300fbb 100644
--- a/storage/maria/unittest/ma_test_loghandler_pagecache-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_pagecache-t.c
@@ -22,7 +22,7 @@ static PAGECACHE_FILE file1;
int main(int argc __attribute__((unused)), char *argv[])
{
uint pagen;
- byte long_tr_id[6];
+ uchar long_tr_id[6];
PAGECACHE pagecache;
LSN lsn;
MY_STAT st, *stat;
diff --git a/storage/myisam/ft_myisam.c b/storage/myisam/ft_myisam.c
index 76c04ba4c0b..bef3fbfd5f5 100644
--- a/storage/myisam/ft_myisam.c
+++ b/storage/myisam/ft_myisam.c
@@ -23,8 +23,8 @@
#include "ftdefs.h"
FT_INFO *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)
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 3472bbcabd5..4f02705c18c 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -1244,7 +1244,7 @@ int ha_myisam::assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt)
if (error != HA_ADMIN_OK)
{
/* Send error to user */
- MI_CHECK param;
+ HA_CHECK param;
myisamchk_init(&param);
param.thd= thd;
param.op_name= "assign_to_keycache";
@@ -1415,7 +1415,7 @@ int ha_myisam::enable_indexes(uint mode)
else if (mode == HA_KEY_SWITCH_NONUNIQ_SAVE)
{
THD *thd=current_thd;
- MI_CHECK param;
+ HA_CHECK param;
const char *save_proc_info=thd->proc_info;
thd->proc_info="Creating index";
myisamchk_init(&param);
@@ -1424,7 +1424,8 @@ int ha_myisam::enable_indexes(uint mode)
T_CREATE_MISSING_KEYS);
param.myf_rw&= ~MY_WAIT_IF_FULL;
param.sort_buffer_length= thd->variables.myisam_sort_buff_size;
- param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method;
+ param.stats_method=
+ (enum_handler_stats_method)thd->variables.myisam_stats_method;
param.tmpdir=&mysql_tmpdir_list;
if ((error= (repair(thd,param,0) != HA_ADMIN_OK)) && param.retry_repair)
{
@@ -1922,7 +1923,7 @@ void ha_myisam::get_auto_increment(ulonglong offset, ulonglong increment,
{
ulonglong nr;
int error;
- uchar key[MI_MAX_KEY_LENGTH];
+ uchar key[HA_MAX_KEY_LENGTH];
if (!table->s->next_number_key_offset)
{ // Autoincrement at key-start
diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h
index 0daa6a7fc72..004e8cce8bb 100644
--- a/storage/myisam/myisamdef.h
+++ b/storage/myisam/myisamdef.h
@@ -550,8 +550,9 @@ extern int _mi_dispose(MI_INFO *info, MI_KEYDEF *keyinfo, my_off_t pos,
extern my_off_t _mi_new(MI_INFO *info, MI_KEYDEF *keyinfo, int level);
extern uint _mi_make_key(MI_INFO *info, uint keynr, uchar *key,
const uchar *record, my_off_t filepos);
-extern uint _mi_pack_key(MI_INFO *info, uint keynr, uchar *key, uchar *old,
- uint key_length, HA_KEYSEG ** last_used_keyseg);
+extern uint _mi_pack_key(MI_INFO *info, uint keynr, uchar *key,
+ uchar *old, key_part_map keypart_map,
+ HA_KEYSEG ** last_used_keyseg);
extern int _mi_read_key_record(MI_INFO *info, my_off_t filepos, uchar *buf);
extern int _mi_read_cache(IO_CACHE *info, uchar *buff, my_off_t pos,
uint length, int re_read_if_possibly);
@@ -566,7 +567,7 @@ extern uchar *mi_alloc_rec_buff(MI_INFO *, ulong, uchar **);
extern ulong _mi_rec_unpack(MI_INFO *info, uchar *to, uchar *from,
ulong reclength);
-extern my_bool _mi_rec_check(MI_INFO *info, const char *record, uchar *packpos,
+extern my_bool _mi_rec_check(MI_INFO *info,const uchar *record, uchar *packpos,
ulong packed_length, my_bool with_checkum);
extern int _mi_write_part_record(MI_INFO *info, my_off_t filepos, ulong length,
my_off_t next_filepos, uchar ** record,
diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c
index 2e2684230e7..3ab478682c6 100644
--- a/storage/myisam/sort.c
+++ b/storage/myisam/sort.c
@@ -831,7 +831,7 @@ static uint NEAR_F read_to_buffer_varlen(IO_CACHE *fromfile, BUFFPEK *buffpek,
register uint count;
uint16 length_of_key = 0;
uint idx;
- byte *buffp;
+ uchar *buffp;
if ((count=(uint) min((ha_rows) buffpek->max_keys,buffpek->count)))
{
@@ -918,7 +918,7 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
for (buffpek= Fb ; buffpek <= Tb ; buffpek++)
{
count+= buffpek->count;
- buffpek->base= (byte*) strpos;
+ buffpek->base= (uchar*) strpos;
buffpek->max_keys=maxcount;
strpos+= (uint) (error=(int) info->read_to_buffer(from_file,buffpek,
sort_length));
@@ -956,7 +956,7 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
{
if (!(error=(int) info->read_to_buffer(from_file,buffpek,sort_length)))
{
- byte *base= buffpek->base;
+ uchar *base= buffpek->base;
uint max_keys=buffpek->max_keys;
VOID(queue_remove(&queue,0));
@@ -988,7 +988,7 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
}
}
buffpek=(BUFFPEK*) queue_top(&queue);
- buffpek->base= (byte*) sort_keys;
+ buffpek->base= (uchar*) sort_keys;
buffpek->max_keys=keys;
do
{
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 551f12e4a8c..f3df1e82c4b 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -48,12 +48,12 @@ static const char *ha_myisammrg_exts[] = {
};
extern int table2myisam(TABLE *table_arg, MI_KEYDEF **keydef_out,
MI_COLUMNDEF **recinfo_out, uint *records_out);
-extern int myisam_check_definition(MI_KEYDEF *t1_keyinfo,
- MI_COLUMNDEF *t1_recinfo,
- uint t1_keys, uint t1_recs,
- MI_KEYDEF *t2_keyinfo,
- MI_COLUMNDEF *t2_recinfo,
- uint t2_keys, uint t2_recs, bool strict);
+extern int check_definition(MI_KEYDEF *t1_keyinfo,
+ MI_COLUMNDEF *t1_recinfo,
+ uint t1_keys, uint t1_recs,
+ MI_KEYDEF *t2_keyinfo,
+ MI_COLUMNDEF *t2_recinfo,
+ uint t2_keys, uint t2_recs, bool strict);
static void split_file_name(const char *file_name,
LEX_STRING *db, LEX_STRING *name);
@@ -137,10 +137,10 @@ int ha_myisammrg::open(const char *name, int mode, uint test_if_locked)
}
for (u_table= file->open_tables; u_table < file->end_table; u_table++)
{
- if (myisam_check_definition(keyinfo, recinfo, keys, recs,
- u_table->table->s->keyinfo, u_table->table->s->rec,
- u_table->table->s->base.keys,
- u_table->table->s->base.fields, false))
+ if (check_definition(keyinfo, recinfo, keys, recs,
+ u_table->table->s->keyinfo, u_table->table->s->rec,
+ u_table->table->s->base.keys,
+ u_table->table->s->base.fields, false))
{
error= HA_ERR_WRONG_MRG_TABLE_DEF;
if (test_if_locked & HA_OPEN_FOR_REPAIR)