1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

BUG#18198

Added new test cases, fixed bugs in relation to those
This commit is contained in:
mikael@dator3.(none)
2007-04-20 18:35:16 +02:00
parent 647ca9f09a
commit 81db111e24
5 changed files with 24 additions and 4 deletions

View File

@ -3315,13 +3315,16 @@ static uint32 get_sub_part_id_from_key(const TABLE *table,byte *buf,
uint32 part_id;
DBUG_ENTER("get_sub_part_id_from_key");
key_restore(buf, (byte*)key_spec->key, key_info, key_spec->length);
if (likely(rec0 == buf))
{
key_restore(buf, (byte*)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, (byte*)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);
}
@ -3358,14 +3361,17 @@ bool get_part_id_from_key(const TABLE *table, byte *buf, KEY *key_info,
longlong func_value;
DBUG_ENTER("get_part_id_from_key");
key_restore(buf, (byte*)key_spec->key, key_info, key_spec->length);
if (likely(rec0 == buf))
{
key_restore(buf, (byte*)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, (byte*)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);
@ -3405,14 +3411,17 @@ void get_full_part_id_from_key(const TABLE *table, byte *buf,
longlong func_value;
DBUG_ENTER("get_full_part_id_from_key");
key_restore(buf, (byte*)key_spec->key, key_info, key_spec->length);
if (likely(rec0 == buf))
{
key_restore(buf, (byte*)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, (byte*)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);