From ef128eb9d81f256883e9dd6e615c08fedeb5dcad Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Nov 2006 17:11:53 +0400 Subject: [PATCH] Fix for bug #23762: partition.test fails (partition_hash, partition_pruning as well) When partition pruning is used we have to initialize key_part->flag in the create_partition_index_descr() as it's checked in the get_mm_leaf(). sql/opt_range.cc: Fix for bug #23762: partition.test fails (partition_hash, partition_pruning as well) - set key_part->flag to 0. sql/opt_range.h: Fix for bug #23762: partition.test fails (partition_hash, partition_pruning as well) - comment added. --- sql/opt_range.cc | 5 +++++ sql/opt_range.h | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 4b7d65c8ae7..79b3e023a5f 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -3237,6 +3237,11 @@ static bool create_partition_index_description(PART_PRUNE_PARAM *ppar) key_part->field= (*field); key_part->image_type = Field::itRAW; + /* + We set keypart flag to 0 here as the only HA_PART_KEY_SEG is checked + in the RangeAnalysisModule. + */ + key_part->flag= 0; /* We don't set key_parts->null_bit as it will not be used */ ppar->is_part_keypart[part]= !in_subpart_fields; diff --git a/sql/opt_range.h b/sql/opt_range.h index 6f9c053cda2..170766c7c10 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -26,7 +26,9 @@ typedef struct st_key_part { uint16 key,part, store_length, length; - uint8 null_bit, flag; + uint8 null_bit; + /* Keypart flags (0 if partition pruning is used) */ + uint8 flag; Field *field; Field::imagetype image_type; } KEY_PART;