mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
BUG20733: Bug in partition pruning with zerofill field
Problem was with handling NULL values in ranges mysql-test/r/partition_hash.result: New partition pruning test cases mysql-test/r/partition_list.result: New partition pruning test cases mysql-test/r/partition_pruning.result: New partition pruning test cases mysql-test/r/partition_range.result: New partition pruning test cases mysql-test/t/partition_hash.test: New partition pruning test cases mysql-test/t/partition_list.test: New partition pruning test cases mysql-test/t/partition_pruning.test: New partition pruning test cases mysql-test/t/partition_range.test: New partition pruning test cases sql/opt_range.cc: Added comment sql/sql_partition.cc: Partition pruning didn't handle ranges with NULL values in a proper manner
This commit is contained in:
@@ -2415,6 +2415,10 @@ uint32 get_list_array_idx_for_endpoint(partition_info *part_info,
|
||||
bool unsigned_flag= part_info->part_expr->unsigned_flag;
|
||||
DBUG_ENTER("get_list_array_idx_for_endpoint");
|
||||
|
||||
if (part_info->part_expr->null_value)
|
||||
{
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
if (unsigned_flag)
|
||||
part_func_value-= 0x8000000000000000ULL;
|
||||
DBUG_ASSERT(part_info->no_list_values);
|
||||
@@ -2539,6 +2543,13 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info,
|
||||
bool unsigned_flag= part_info->part_expr->unsigned_flag;
|
||||
DBUG_ENTER("get_partition_id_range_for_endpoint");
|
||||
|
||||
if (part_info->part_expr->null_value)
|
||||
{
|
||||
uint32 ret_part_id= 0;
|
||||
if (!left_endpoint && include_endpoint)
|
||||
ret_part_id= 1;
|
||||
DBUG_RETURN(ret_part_id);
|
||||
}
|
||||
if (unsigned_flag)
|
||||
part_func_value-= 0x8000000000000000ULL;
|
||||
while (max_part_id > min_part_id)
|
||||
|
Reference in New Issue
Block a user