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

mysql-5.5.22 merge

mysql-test/suite/innodb/t/group_commit_crash.test:
  remove autoincrement to avoid rbr being used for insert ... select
mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test:
  remove autoincrement to avoid rbr being used for insert ... select
mysys/my_addr_resolve.c:
  a pointer to a buffer is returned to the caller -> the buffer cannot be on the stack
mysys/stacktrace.c:
  my_vsnprintf() is ok here, in 5.5
This commit is contained in:
Sergei Golubchik
2012-03-28 01:04:46 +02:00
311 changed files with 4853 additions and 1848 deletions

View File

@@ -4398,11 +4398,20 @@ error:
}
/*
Sets which partitions to be used in the command
/**
Sets which partitions to be used in the command.
@param alter_info Alter_info pointer holding partition names and flags.
@param tab_part_info partition_info holding all partitions.
@param part_state Which state to set for the named partitions.
@return Operation status
@retval false Success
@retval true Failure
*/
uint set_part_state(Alter_info *alter_info, partition_info *tab_part_info,
enum partition_state part_state)
bool set_part_state(Alter_info *alter_info, partition_info *tab_part_info,
enum partition_state part_state)
{
uint part_count= 0;
uint num_parts_found= 0;
@@ -4428,7 +4437,21 @@ uint set_part_state(Alter_info *alter_info, partition_info *tab_part_info,
else
part_elem->part_state= PART_NORMAL;
} while (++part_count < tab_part_info->num_parts);
return num_parts_found;
if (num_parts_found != alter_info->partition_names.elements &&
!(alter_info->flags & ALTER_ALL_PARTITION))
{
/* Not all given partitions found, revert and return failure */
part_it.rewind();
part_count= 0;
do
{
partition_element *part_elem= part_it++;
part_elem->part_state= PART_NORMAL;
} while (++part_count < tab_part_info->num_parts);
return true;
}
return false;
}
@@ -4947,11 +4970,7 @@ that are reorganised.
}
else if (alter_info->flags & ALTER_REBUILD_PARTITION)
{
uint num_parts_found;
uint num_parts_opt= alter_info->partition_names.elements;
num_parts_found= set_part_state(alter_info, tab_part_info, PART_CHANGED);
if (num_parts_found != num_parts_opt &&
(!(alter_info->flags & ALTER_ALL_PARTITION)))
if (set_part_state(alter_info, tab_part_info, PART_CHANGED))
{
my_error(ER_DROP_PARTITION_NON_EXISTENT, MYF(0), "REBUILD");
goto err;