1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Fix for bug #29258: Partitions: search fails for maximum unsigned bigint

Problems: 
  1. looking for a matching partition we miss the fact that the maximum 
     allowed value is in the PARTITION p LESS THAN MAXVALUE.
  2. one can insert maximum value if numeric maximum value is the last range.
     (should only work if LESS THAN MAXVALUE).
  3. one cannot have both numeric maximum value and MAXVALUE string as ranges 
    (the same value, but different meanings).

Fix: consider the maximum value as a supremum.
This commit is contained in:
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
2007-11-26 10:28:25 +04:00
parent 81fc036f0c
commit beff6193e0
4 changed files with 102 additions and 3 deletions

View File

@@ -2834,8 +2834,8 @@ int get_partition_id_range(partition_info *part_info,
loc_part_id++;
*part_id= (uint32)loc_part_id;
if (loc_part_id == max_partition &&
range_array[loc_part_id] != LONGLONG_MAX &&
part_func_value >= range_array[loc_part_id])
part_func_value >= range_array[loc_part_id] &&
!part_info->defined_max_value)
DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND);
DBUG_PRINT("exit",("partition: %d", *part_id));
@@ -2941,7 +2941,13 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info,
}
if (left_endpoint)
{
if (part_func_value >= range_array[loc_part_id])
longlong bound= range_array[loc_part_id];
/*
In case of PARTITION p VALUES LESS THAN MAXVALUE
the maximum value is in the current partition.
*/
if (part_func_value > bound ||
(part_func_value == bound && !part_info->defined_max_value))
loc_part_id++;
}
else