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

BUG#21339: Crash at EXPLAIN PARTITIONS

Caused by missing check for end of partitions in prune range check


mysql-test/r/partition.result:
  Added test case for duplicate bug#21388
mysql-test/r/partition_range.result:
  Added new test case for bug#21339
mysql-test/t/partition.test:
  Added test case for duplicate bug#21388
mysql-test/t/partition_range.test:
  Added new test case for bug#21339
sql/sql_partition.cc:
  Check so that we don't set outer range to be larger than max_partition
This commit is contained in:
unknown
2006-08-05 16:12:24 -04:00
parent 5e2babfe62
commit d6c2a6daec
5 changed files with 76 additions and 4 deletions

View File

@@ -2573,10 +2573,13 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info,
}
else
{
if (part_func_value == range_array[loc_part_id])
loc_part_id += test(include_endpoint);
else if (part_func_value > range_array[loc_part_id])
loc_part_id++;
if (loc_part_id < max_partition)
{
if (part_func_value == range_array[loc_part_id])
loc_part_id += test(include_endpoint);
else if (part_func_value > range_array[loc_part_id])
loc_part_id++;
}
loc_part_id++;
}
DBUG_RETURN(loc_part_id);