This commit is contained in:
Mattias Jonsson 2009-01-07 23:30:10 +01:00
commit 5b6829ac6e

View file

@ -4815,7 +4815,7 @@ int ha_partition::info(uint flag)
/* /*
Calculates statistical variables Calculates statistical variables
records: Estimate of number records in table records: Estimate of number records in table
We report sum (always at least 2) We report sum (always at least 2 if not empty)
deleted: Estimate of number holes in the table due to deleted: Estimate of number holes in the table due to
deletes deletes
We report sum We report sum
@ -4854,13 +4854,13 @@ int ha_partition::info(uint flag)
stats.check_time= file->stats.check_time; stats.check_time= file->stats.check_time;
} }
} while (*(++file_array)); } while (*(++file_array));
if (stats.records < 2 && if (stats.records && stats.records < 2 &&
!(m_file[0]->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT)) !(m_file[0]->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT))
stats.records= 2; stats.records= 2;
if (stats.records > 0) if (stats.records > 0)
stats.mean_rec_length= (ulong) (stats.data_file_length / stats.records); stats.mean_rec_length= (ulong) (stats.data_file_length / stats.records);
else else
stats.mean_rec_length= 1; //? What should we set here stats.mean_rec_length= 0;
} }
if (flag & HA_STATUS_CONST) if (flag & HA_STATUS_CONST)
{ {