mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge MySQL 5.1.46 into MariaDB.
Still two test failures to be solved: main.myisam and main.subselect.
This commit is contained in:
@@ -2876,6 +2876,7 @@ int get_partition_id_range(partition_info *part_info,
|
||||
*func_value= part_func_value;
|
||||
if (unsigned_flag)
|
||||
part_func_value-= 0x8000000000000000ULL;
|
||||
/* Search for the partition containing part_func_value */
|
||||
while (max_part_id > min_part_id)
|
||||
{
|
||||
loc_part_id= (max_part_id + min_part_id) / 2;
|
||||
@@ -3015,13 +3016,18 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info,
|
||||
part_end_val= range_array[loc_part_id];
|
||||
if (left_endpoint)
|
||||
{
|
||||
DBUG_ASSERT(part_func_value > part_end_val ?
|
||||
(loc_part_id == max_partition &&
|
||||
!part_info->defined_max_value) :
|
||||
1);
|
||||
/*
|
||||
In case of PARTITION p VALUES LESS THAN MAXVALUE
|
||||
the maximum value is in the current partition.
|
||||
the maximum value is in the current (last) partition.
|
||||
If value is equal or greater than the endpoint,
|
||||
the range starts from the next partition.
|
||||
*/
|
||||
if (part_func_value > part_end_val ||
|
||||
(part_func_value == part_end_val &&
|
||||
(loc_part_id < max_partition || !part_info->defined_max_value)))
|
||||
if (part_func_value >= part_end_val &&
|
||||
(loc_part_id < max_partition || !part_info->defined_max_value))
|
||||
loc_part_id++;
|
||||
}
|
||||
else
|
||||
@@ -4274,6 +4280,12 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
|
||||
{
|
||||
DBUG_ENTER("prep_alter_part_table");
|
||||
|
||||
/* Foreign keys on partitioned tables are not supported, waits for WL#148 */
|
||||
if (table->part_info && (alter_info->flags & ALTER_FOREIGN_KEY))
|
||||
{
|
||||
my_error(ER_FOREIGN_KEY_ON_PARTITIONED, MYF(0));
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
/*
|
||||
We are going to manipulate the partition info on the table object
|
||||
so we need to ensure that the data structure of the table object
|
||||
|
Reference in New Issue
Block a user