summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-06-11 17:51:09 +0200
committerSergei Golubchik <serg@mariadb.org>2019-06-11 18:42:45 +0200
commit27fcdb161c8bb1fd21d2706ba17a3326f8221b9c (patch)
tree5003d227d2e178d156867ea1b47ae1cc56748893 /sql/ha_partition.cc
parentbb70d41932a23669dedf108d1af8581a3e7813d8 (diff)
downloadmariadb-git-bb-10.4-MDEV-16249.tar.gz
MDEV-16249 CHECKSUM TABLE for a spider table is not parallel and saves all data in memory in the spider head by default (#1328)bb-10.4-MDEV-16249
followup for be5c432a42e ha_partition::calculate_checksum() has to invoke calculate_checksum() for partitions unconditionally, not under (HA_HAS_OLD_CHECKSUM | HA_HAS_NEW_CHECKSUM). Because the server uses ::info() to ask for a live checksum, while calculate_checksum() must, precisely, calculate it the slow way, also for tables that don't have the live checksum at all. Also, fix the compilation on Windows (ha_checksum/ulonglong type mix).
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc26
1 files changed, 12 insertions, 14 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index e47da94ab20..8a0b9822493 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -10645,22 +10645,20 @@ int ha_partition::calculate_checksum()
}
}
m_pre_calling= FALSE;
- if ((table_flags() & (HA_HAS_OLD_CHECKSUM | HA_HAS_NEW_CHECKSUM)))
+
+ handler **file= m_file;
+ do
{
- handler **file= m_file;
- do
+ if ((error= (*file)->calculate_checksum()))
{
- if ((error= (*file)->calculate_checksum()))
- {
- DBUG_RETURN(error);
- }
- if (!(*file)->stats.checksum_null)
- {
- stats.checksum+= (*file)->stats.checksum;
- stats.checksum_null= FALSE;
- }
- } while (*(++file));
- }
+ DBUG_RETURN(error);
+ }
+ if (!(*file)->stats.checksum_null)
+ {
+ stats.checksum+= (*file)->stats.checksum;
+ stats.checksum_null= FALSE;
+ }
+ } while (*(++file));
DBUG_RETURN(0);
}