1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-10763: Wrong result - server does not return NULL values from default list partition after ALTER table

Fixed partition pruning for NULL value.
This commit is contained in:
Oleksandr Byelkin
2016-09-08 16:36:23 +02:00
parent b22ed66c6b
commit 19d24f011c
3 changed files with 62 additions and 2 deletions

View File

@@ -7960,8 +7960,19 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
/* col = x and F(x) = NULL -> only search NULL partition */
part_iter->part_nums.cur= part_iter->part_nums.start= 0;
part_iter->part_nums.end= 0;
part_iter->ret_null_part= part_iter->ret_null_part_orig= TRUE;
DBUG_RETURN(1);
/*
if NULL partition exists:
for RANGE it is the first partition (always exists);
for LIST should be indicator that it is present
*/
if (part_info->part_type == RANGE_PARTITION ||
part_info->has_null_value)
{
part_iter->ret_null_part= part_iter->ret_null_part_orig= TRUE;
DBUG_RETURN(1);
}
// If no NULL partition look up in DEFAULT or there is no such value
goto not_found;
}
part_iter->part_nums.cur= part_iter->part_nums.start;
if (check_zero_dates && !part_info->part_expr->null_value)