summaryrefslogtreecommitdiff
path: root/sql/sql_partition.cc
diff options
context:
space:
mode:
authorkostja@bodhi.(none) <>2007-06-01 12:12:06 +0400
committerkostja@bodhi.(none) <>2007-06-01 12:12:06 +0400
commit16633169e4ab381126388f1bb2a014e9423c8f86 (patch)
tree2c2de88de3152746bd0ffaea698446ff1cede244 /sql/sql_partition.cc
parent685293b98584b36c568bd6a4fa6ded69f6ce5844 (diff)
parent2c8f4f97910bec416fc9a375cf1c74be2ca395cc (diff)
downloadmariadb-git-16633169e4ab381126388f1bb2a014e9423c8f86.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into bodhi.(none):/opt/local/work/mysql-5.1-runtime
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r--sql/sql_partition.cc80
1 files changed, 40 insertions, 40 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index fda15a613a0..d47aacee924 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -123,23 +123,23 @@ uint32 get_partition_id_hash_sub(partition_info *part_info);
uint32 get_partition_id_key_sub(partition_info *part_info);
uint32 get_partition_id_linear_hash_sub(partition_info *part_info);
uint32 get_partition_id_linear_key_sub(partition_info *part_info);
-#endif
-
static uint32 get_next_partition_via_walking(PARTITION_ITERATOR*);
+static void set_up_range_analysis_info(partition_info *part_info);
static uint32 get_next_subpartition_via_walking(PARTITION_ITERATOR*);
+#endif
+
uint32 get_next_partition_id_range(PARTITION_ITERATOR* part_iter);
uint32 get_next_partition_id_list(PARTITION_ITERATOR* part_iter);
int get_part_iter_for_interval_via_mapping(partition_info *part_info,
bool is_subpart,
- char *min_value, char *max_value,
+ uchar *min_value, uchar *max_value,
uint flags,
PARTITION_ITERATOR *part_iter);
int get_part_iter_for_interval_via_walking(partition_info *part_info,
bool is_subpart,
- char *min_value, char *max_value,
+ uchar *min_value, uchar *max_value,
uint flags,
PARTITION_ITERATOR *part_iter);
-static void set_up_range_analysis_info(partition_info *part_info);
#ifdef WITH_PARTITION_STORAGE_ENGINE
/*
@@ -294,8 +294,8 @@ bool check_reorganise_list(partition_info *new_part_info,
> 0 Error code
*/
-int get_parts_for_update(const byte *old_data, byte *new_data,
- const byte *rec0, partition_info *part_info,
+int get_parts_for_update(const uchar *old_data, uchar *new_data,
+ const uchar *rec0, partition_info *part_info,
uint32 *old_part_id, uint32 *new_part_id,
longlong *new_func_value)
{
@@ -368,7 +368,7 @@ int get_parts_for_update(const byte *old_data, byte *new_data,
calculate the partition id.
*/
-int get_part_for_delete(const byte *buf, const byte *rec0,
+int get_part_for_delete(const uchar *buf, const uchar *rec0,
partition_info *part_info, uint32 *part_id)
{
int error;
@@ -907,7 +907,7 @@ bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
context->table_list= &tables;
context->first_name_resolution_table= &tables;
context->last_name_resolution_table= NULL;
- func_expr->walk(&Item::change_context_processor, 0, (byte*) context);
+ func_expr->walk(&Item::change_context_processor, 0, (uchar*) context);
save_where= thd->where;
thd->where= "partition function";
/*
@@ -1673,7 +1673,7 @@ end:
static int add_write(File fptr, const char *buf, uint len)
{
- uint len_written= my_write(fptr, (const byte*)buf, len, MYF(0));
+ uint len_written= my_write(fptr, (const uchar*)buf, len, MYF(0));
if (likely(len == len_written))
return 0;
@@ -2120,13 +2120,13 @@ char *generate_partition_syntax(partition_info *part_info,
goto close_file;
*buf_length= (uint)buffer_length;
if (use_sql_alloc)
- buf= sql_alloc(*buf_length+1);
+ buf= (char*) sql_alloc(*buf_length+1);
else
- buf= my_malloc(*buf_length+1, MYF(MY_WME));
+ buf= (char*) my_malloc(*buf_length+1, MYF(MY_WME));
if (!buf)
goto close_file;
- if (unlikely(my_read(fptr, (byte*)buf, *buf_length, MYF(MY_FNABP))))
+ if (unlikely(my_read(fptr, (uchar*)buf, *buf_length, MYF(MY_FNABP))))
{
if (!use_sql_alloc)
my_free(buf, MYF(0));
@@ -2389,8 +2389,8 @@ static uint32 get_part_id_linear_key(partition_info *part_info,
*/
static void copy_to_part_field_buffers(Field **ptr,
- char **field_bufs,
- char **restore_ptr)
+ uchar **field_bufs,
+ uchar **restore_ptr)
{
Field *field;
while ((field= *(ptr++)))
@@ -2401,7 +2401,7 @@ static void copy_to_part_field_buffers(Field **ptr,
{
CHARSET_INFO *cs= ((Field_str*)field)->charset();
uint len= field->pack_length();
- char *field_buf= *field_bufs;
+ uchar *field_buf= *field_bufs;
/*
We only use the field buffer for VARCHAR and CHAR strings
which isn't of a binary collation. We also only use the
@@ -2412,17 +2412,17 @@ static void copy_to_part_field_buffers(Field **ptr,
if (field->type() == MYSQL_TYPE_VARCHAR)
{
uint len_bytes= ((Field_varstring*)field)->length_bytes;
- my_strnxfrm(cs, (uchar*)(field_buf + len_bytes), (len - len_bytes),
- (uchar*)(field->ptr + len_bytes), field->field_length);
+ my_strnxfrm(cs, field_buf + len_bytes, (len - len_bytes),
+ field->ptr + len_bytes, field->field_length);
if (len_bytes == 1)
- *field_buf= (uchar)field->field_length;
+ *field_buf= (uchar) field->field_length;
else
int2store(field_buf, field->field_length);
}
else
{
- my_strnxfrm(cs, (uchar*)field_buf, len,
- (uchar*)field->ptr, field->field_length);
+ my_strnxfrm(cs, field_buf, len,
+ field->ptr, field->field_length);
}
field->ptr= field_buf;
}
@@ -2441,7 +2441,7 @@ static void copy_to_part_field_buffers(Field **ptr,
RETURN VALUES
*/
-static void restore_part_field_pointers(Field **ptr, char **restore_ptr)
+static void restore_part_field_pointers(Field **ptr, uchar **restore_ptr)
{
Field *field;
while ((field= *(ptr++)))
@@ -3283,16 +3283,16 @@ static bool check_part_func_bound(Field **ptr)
get the partition identity and restore field pointers afterwards.
*/
-static uint32 get_sub_part_id_from_key(const TABLE *table,byte *buf,
+static uint32 get_sub_part_id_from_key(const TABLE *table,uchar *buf,
KEY *key_info,
const key_range *key_spec)
{
- byte *rec0= table->record[0];
+ uchar *rec0= table->record[0];
partition_info *part_info= table->part_info;
uint32 part_id;
DBUG_ENTER("get_sub_part_id_from_key");
- key_restore(buf, (byte*)key_spec->key, key_info, key_spec->length);
+ key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length);
if (likely(rec0 == buf))
part_id= part_info->get_subpartition_id(part_info);
else
@@ -3326,16 +3326,16 @@ static uint32 get_sub_part_id_from_key(const TABLE *table,byte *buf,
get the partition identity and restore field pointers afterwards.
*/
-bool get_part_id_from_key(const TABLE *table, byte *buf, KEY *key_info,
+bool get_part_id_from_key(const TABLE *table, uchar *buf, KEY *key_info,
const key_range *key_spec, uint32 *part_id)
{
bool result;
- byte *rec0= table->record[0];
+ uchar *rec0= table->record[0];
partition_info *part_info= table->part_info;
longlong func_value;
DBUG_ENTER("get_part_id_from_key");
- key_restore(buf, (byte*)key_spec->key, key_info, key_spec->length);
+ key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length);
if (likely(rec0 == buf))
result= part_info->get_part_partition_id(part_info, part_id,
&func_value);
@@ -3371,18 +3371,18 @@ bool get_part_id_from_key(const TABLE *table, byte *buf, KEY *key_info,
get the partition identity and restore field pointers afterwards.
*/
-void get_full_part_id_from_key(const TABLE *table, byte *buf,
+void get_full_part_id_from_key(const TABLE *table, uchar *buf,
KEY *key_info,
const key_range *key_spec,
part_id_range *part_spec)
{
bool result;
partition_info *part_info= table->part_info;
- byte *rec0= table->record[0];
+ uchar *rec0= table->record[0];
longlong func_value;
DBUG_ENTER("get_full_part_id_from_key");
- key_restore(buf, (byte*)key_spec->key, key_info, key_spec->length);
+ key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length);
if (likely(rec0 == buf))
result= part_info->get_partition_id(part_info, &part_spec->start_part,
&func_value);
@@ -3470,7 +3470,7 @@ void prune_partition_set(const TABLE *table, part_id_range *part_spec)
RETURN VALUE
part_spec
*/
-void get_partition_set(const TABLE *table, byte *buf, const uint index,
+void get_partition_set(const TABLE *table, uchar *buf, const uint index,
const key_range *key_spec, part_id_range *part_spec)
{
partition_info *part_info= table->part_info;
@@ -3806,9 +3806,9 @@ bool mysql_unpack_partition(THD *thd,
char *part_func_string= NULL;
char *subpart_func_string= NULL;
if ((part_func_len &&
- !((part_func_string= thd->alloc(part_func_len)))) ||
+ !((part_func_string= (char*) thd->alloc(part_func_len)))) ||
(subpart_func_len &&
- !((subpart_func_string= thd->alloc(subpart_func_len)))))
+ !((subpart_func_string= (char*) thd->alloc(subpart_func_len)))))
{
mem_alloc_error(part_func_len);
thd->free_items();
@@ -6374,8 +6374,8 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
also for other programs.
*/
-void set_field_ptr(Field **ptr, const byte *new_buf,
- const byte *old_buf)
+void set_field_ptr(Field **ptr, const uchar *new_buf,
+ const uchar *old_buf)
{
my_ptrdiff_t diff= (new_buf - old_buf);
DBUG_ENTER("set_field_ptr");
@@ -6408,8 +6408,8 @@ void set_field_ptr(Field **ptr, const byte *new_buf,
also for other programs.
*/
-void set_key_field_ptr(KEY *key_info, const byte *new_buf,
- const byte *old_buf)
+void set_key_field_ptr(KEY *key_info, const uchar *new_buf,
+ const uchar *old_buf)
{
KEY_PART_INFO *key_part= key_info->key_part;
uint key_parts= key_info->key_parts;
@@ -6660,7 +6660,7 @@ typedef uint32 (*get_endpoint_func)(partition_info*, bool left_endpoint,
int get_part_iter_for_interval_via_mapping(partition_info *part_info,
bool is_subpart,
- char *min_value, char *max_value,
+ uchar *min_value, uchar *max_value,
uint flags,
PARTITION_ITERATOR *part_iter)
{
@@ -6816,7 +6816,7 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
int get_part_iter_for_interval_via_walking(partition_info *part_info,
bool is_subpart,
- char *min_value, char *max_value,
+ uchar *min_value, uchar *max_value,
uint flags,
PARTITION_ITERATOR *part_iter)
{