summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc43
1 files changed, 13 insertions, 30 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 9dcd57a5f82..4e7fccca3af 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -1,6 +1,6 @@
/*
- Copyright (c) 2005, 2017, Oracle and/or its affiliates.
- Copyright (c) 2009, 2018, MariaDB
+ Copyright (c) 2005, 2019, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2019, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
*/
/*
@@ -8197,8 +8197,9 @@ int ha_partition::info(uint flag)
stats.deleted= 0;
stats.data_file_length= 0;
stats.index_file_length= 0;
- stats.check_time= 0;
stats.delete_length= 0;
+ stats.check_time= 0;
+ stats.checksum= 0;
for (i= bitmap_get_first_set(&m_part_info->read_partitions);
i < m_tot_parts;
i= bitmap_get_next_set(&m_part_info->read_partitions, i))
@@ -8212,6 +8213,7 @@ int ha_partition::info(uint flag)
stats.delete_length+= file->stats.delete_length;
if (file->stats.check_time > stats.check_time)
stats.check_time= file->stats.check_time;
+ stats.checksum+= file->stats.checksum;
}
if (stats.records && stats.records < 2 &&
!(m_file[0]->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT))
@@ -8367,10 +8369,7 @@ void ha_partition::get_dynamic_partition_info(PARTITION_STATS *stat_info,
stat_info->create_time= file->stats.create_time;
stat_info->update_time= file->stats.update_time;
stat_info->check_time= file->stats.check_time;
- stat_info->check_sum= 0;
- if (file->ha_table_flags() & (HA_HAS_OLD_CHECKSUM | HA_HAS_NEW_CHECKSUM))
- stat_info->check_sum= file->checksum();
- return;
+ stat_info->check_sum= file->stats.checksum;
}
@@ -10112,7 +10111,12 @@ bool ha_partition::inplace_alter_table(TABLE *altered_table,
for (index= 0; index < m_tot_parts && !error; index++)
{
- ha_alter_info->handler_ctx= part_inplace_ctx->handler_ctx_array[index];
+ if ((ha_alter_info->handler_ctx=
+ part_inplace_ctx->handler_ctx_array[index]) != NULL
+ && index != 0)
+ ha_alter_info->handler_ctx->set_shared_data
+ (*part_inplace_ctx->handler_ctx_array[index - 1]);
+
if (m_file[index]->ha_inplace_alter_table(altered_table,
ha_alter_info))
error= true;
@@ -10595,27 +10599,6 @@ void ha_partition::init_table_handle_for_HANDLER()
}
-/**
- Return the checksum of the table (all partitions)
-*/
-
-uint ha_partition::checksum() const
-{
- ha_checksum sum= 0;
-
- DBUG_ENTER("ha_partition::checksum");
- if ((table_flags() & (HA_HAS_OLD_CHECKSUM | HA_HAS_NEW_CHECKSUM)))
- {
- handler **file= m_file;
- do
- {
- sum+= (*file)->checksum();
- } while (*(++file));
- }
- DBUG_RETURN(sum);
-}
-
-
/****************************************************************************
MODULE enable/disable indexes
****************************************************************************/