1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

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.
This commit is contained in:
Ramil Kalimullin
2009-04-01 10:34:59 +05:00
parent ab958ee0bd
commit 968069d845
3 changed files with 28 additions and 1 deletions

View File

@@ -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