summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
authorJoerg Bruehe <joerg.bruehe@oracle.com>2012-03-20 22:27:49 +0100
committerJoerg Bruehe <joerg.bruehe@oracle.com>2012-03-20 22:27:49 +0100
commita70c8c4b208096c376de065fc7e2d036256f3306 (patch)
tree090ea3ae9b50973297879fb1882004bcd4ea5c6c /sql/ha_partition.cc
parent4320a81f925585855b43a40da6bb81ef9e47c644 (diff)
parenta9f3b2f5703e477bd60a1d917ff9e108470b7503 (diff)
downloadmariadb-git-a70c8c4b208096c376de065fc7e2d036256f3306.tar.gz
Merge the 5.5.22 release build into main 5.5,
conflict in "sql/filesort.cc" solved manually.
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index d82e4999d59..5b25bd26298 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -3619,14 +3619,14 @@ int ha_partition::truncate_partition(Alter_info *alter_info, bool *binlog_stmt)
uint num_parts= m_part_info->num_parts;
uint num_subparts= m_part_info->num_subparts;
uint i= 0;
- uint num_parts_set= alter_info->partition_names.elements;
- uint num_parts_found= set_part_state(alter_info, m_part_info,
- PART_ADMIN);
DBUG_ENTER("ha_partition::truncate_partition");
/* Only binlog when it starts any call to the partitions handlers */
*binlog_stmt= false;
+ if (set_part_state(alter_info, m_part_info, PART_ADMIN))
+ DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND);
+
/*
TRUNCATE also means resetting auto_increment. Hence, reset
it so that it will be initialized again at the next use.
@@ -3636,10 +3636,6 @@ int ha_partition::truncate_partition(Alter_info *alter_info, bool *binlog_stmt)
table_share->ha_part_data->auto_inc_initialized= FALSE;
unlock_auto_increment();
- if (num_parts_set != num_parts_found &&
- (!(alter_info->flags & ALTER_ALL_PARTITION)))
- DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND);
-
*binlog_stmt= true;
do
@@ -6098,7 +6094,7 @@ int ha_partition::extra(enum ha_extra_function operation)
0 Success
DESCRIPTION
- Called at end of each statement to reste buffers
+ Called at end of each statement to reset buffers
*/
int ha_partition::reset(void)