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:
parent
81fc036f0c
commit
beff6193e0
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user