summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@sun.com>2008-12-19 09:23:15 +0100
committerMattias Jonsson <mattias.jonsson@sun.com>2008-12-19 09:23:15 +0100
commitdc9c5440e357b1afde67ea43ad3e626835e55896 (patch)
treeb339539ba0b3aa07aaa9566b0701fc147701cfeb /sql/ha_partition.cc
parent0077ba49400a58e2b35181f8b9d6e78314a9b36f (diff)
downloadmariadb-git-dc9c5440e357b1afde67ea43ad3e626835e55896.tar.gz
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. 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.
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 47d2d36ac8d..c8b068ca2be 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -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)
{