#At file:///Users/mattiasj/clones/bzrroot/b36312-51-bugteam/ based on revid:mattias.jonsson@stripped
2739 Mattias Jonsson 2008-12-19
Bug#36312: InnoDB DATA_FREE BUG?
Problem is that DATA_FREE in SHOW TABLE STATUS
is not correct when not using innodb_file_per_table.
The solution is to use I_S.PARTITIONS instead.
This is only a small fix for correcting mean record length and
always return 0 if the table is empty.
modified:
sql/ha_partition.cc
per-file messages:
sql/ha_partition.cc
Bug#36312: InnoDB DATA_FREE BUG?
This is only a small fix for correcting mean record length and
always return 0 if the table is empty.
=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc 2008-12-16 11:44:18 +0000
+++ b/sql/ha_partition.cc 2008-12-19 08:23:15 +0000
@@ -4815,7 +4815,7 @@ int ha_partition::info(uint flag)
/*
Calculates statistical variables
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
deletes
We report sum
@@ -4854,13 +4854,13 @@ int ha_partition::info(uint flag)
stats.check_time= file->stats.check_time;
}
} while (*(++file_array));
- if (stats.records < 2 &&
+ if (stats.records && stats.records < 2 &&
!(m_file[0]->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT))
stats.records= 2;
if (stats.records > 0)
stats.mean_rec_length= (ulong) (stats.data_file_length / stats.records);
else
- stats.mean_rec_length= 1; //? What should we set here
+ stats.mean_rec_length= 0;
}
if (flag & HA_STATUS_CONST)
{
| Thread |
|---|
| • bzr commit into mysql-5.1-bugteam branch (mattias.jonsson:2739)Bug#36312 | Mattias Jonsson | 19 Dec |