diff options
author | Ramil Kalimullin <ramil@mysql.com> | 2009-04-01 10:34:59 +0500 |
---|---|---|
committer | Ramil Kalimullin <ramil@mysql.com> | 2009-04-01 10:34:59 +0500 |
commit | 968069d845dc09c32458ebe593bfadfb8b1ea035 (patch) | |
tree | 9031ef85e89dc7c228046e8bd0b090b64331ac1e /sql/sql_partition.cc | |
parent | ab958ee0bd28986389d5c612af5821e8088c1104 (diff) | |
download | mariadb-git-968069d845dc09c32458ebe593bfadfb8b1ea035.tar.gz |
Fix for bug#42944: partition not pruned correctly
Problem: we don't prune a LESS THAN partition if MAXVALUE is given and
given value is equal to a LESS THAN value.
Fix: prune partitions in such cases.
mysql-test/r/partition.result:
Fix for bug#42944: partition not pruned correctly
- test result.
mysql-test/t/partition.test:
Fix for bug#42944: partition not pruned correctly
- test case.
sql/sql_partition.cc:
Fix for bug#42944: partition not pruned correctly
- prune partition if given value is equal to a LESS THAN value
and it's not a "PARTITION ... LESS THAN MAXVALUE" one.
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r-- | sql/sql_partition.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index ae55c194c3c..4a50650b6f4 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -2937,7 +2937,8 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info, the maximum value is in the current partition. */ if (part_func_value > bound || - (part_func_value == bound && !part_info->defined_max_value)) + (part_func_value == bound && + (!part_info->defined_max_value || loc_part_id < max_partition))) loc_part_id++; } else |