diff options
author | unknown <mikael@dator6.(none)> | 2007-06-13 16:03:18 +0200 |
---|---|---|
committer | unknown <mikael@dator6.(none)> | 2007-06-13 16:03:18 +0200 |
commit | 43fb390959fab00de4b5fa29a9c027e5cd64278a (patch) | |
tree | 653b319560f6cfefe911b91ef0a72ab1abbc4ec9 /sql/sql_partition.cc | |
parent | 73016f8f90edecb433e7ebbf09f0b261c19dce84 (diff) | |
parent | e0c0cdc3faa34546479dd7d81099bc90126484d3 (diff) | |
download | mariadb-git-43fb390959fab00de4b5fa29a9c027e5cd64278a.tar.gz |
Merge dator6.(none):/home/mikael/mysql_clones/clean-mysql-5.1
into dator6.(none):/home/mikael/mysql_clones/bug18198
mysql-test/t/partition_hash.test:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/item.h:
manual merge
sql/item_cmpfunc.h:
manual merge
sql/item_func.h:
manual merge
sql/item_strfunc.h:
manual merge
sql/item_timefunc.h:
manual merge
sql/item_xmlfunc.h:
manual merge
sql/partition_info.cc:
manual merge
sql/sql_partition.cc:
manual merge
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r-- | sql/sql_partition.cc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index d47aacee924..799127995bd 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -2869,6 +2869,8 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info, } if (unsigned_flag) part_func_value-= 0x8000000000000000ULL; + if (left_endpoint && !include_endpoint) + part_func_value++; while (max_part_id > min_part_id) { loc_part_id= (max_part_id + min_part_id + 1) >> 1; @@ -3292,13 +3294,16 @@ static uint32 get_sub_part_id_from_key(const TABLE *table,uchar *buf, uint32 part_id; DBUG_ENTER("get_sub_part_id_from_key"); - key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length); if (likely(rec0 == buf)) + { + key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length); part_id= part_info->get_subpartition_id(part_info); + } else { Field **part_field_array= part_info->subpart_field_array; set_field_ptr(part_field_array, buf, rec0); + key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length); part_id= part_info->get_subpartition_id(part_info); set_field_ptr(part_field_array, rec0, buf); } @@ -3335,14 +3340,17 @@ bool get_part_id_from_key(const TABLE *table, uchar *buf, KEY *key_info, longlong func_value; DBUG_ENTER("get_part_id_from_key"); - key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length); if (likely(rec0 == buf)) + { + key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length); result= part_info->get_part_partition_id(part_info, part_id, &func_value); + } else { Field **part_field_array= part_info->part_field_array; set_field_ptr(part_field_array, buf, rec0); + key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length); result= part_info->get_part_partition_id(part_info, part_id, &func_value); set_field_ptr(part_field_array, rec0, buf); @@ -3382,14 +3390,17 @@ void get_full_part_id_from_key(const TABLE *table, uchar *buf, longlong func_value; DBUG_ENTER("get_full_part_id_from_key"); - key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length); if (likely(rec0 == buf)) + { + key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length); result= part_info->get_partition_id(part_info, &part_spec->start_part, &func_value); + } else { Field **part_field_array= part_info->full_part_field_array; set_field_ptr(part_field_array, buf, rec0); + key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length); result= part_info->get_partition_id(part_info, &part_spec->start_part, &func_value); set_field_ptr(part_field_array, rec0, buf); |