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

MDEV-16249 CHECKSUM TABLE for a spider table is not parallel and saves all data in memory in the spider head by default (#1328)

followup for be5c432a42

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).
This commit is contained in:
Sergei Golubchik
2019-06-11 17:51:09 +02:00
parent bb70d41932
commit 27fcdb161c
4 changed files with 17 additions and 19 deletions

View File

@@ -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);
}