Commit f4ef69d8 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:2012], make amount of data shown in show table status same as show in show...

[t:2012], make amount of data shown in show table status same as show in show engine tokudb user_data

git-svn-id: file:///svn/mysql/tokudb-engine/src@14681 c7de825b-a66e-492c-adef-691d508d4ae1
parent ace5fc7a
...@@ -4169,6 +4169,22 @@ int ha_tokudb::info(uint flag) { ...@@ -4169,6 +4169,22 @@ int ha_tokudb::info(uint flag) {
if (error) { goto cleanup; } if (error) { goto cleanup; }
stats.data_file_length = dict_stats.bt_dsize; stats.data_file_length = dict_stats.bt_dsize;
if (hidden_primary_key) {
//
// in this case, we have a hidden primary key, do not
// want to report space taken up by the hidden primary key to the user
//
u_int64_t hpk_space = TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH*dict_stats.bt_ndata;
stats.data_file_length = (hpk_space > stats.data_file_length) ? 0 : stats.data_file_length - hpk_space;
}
else {
//
// one infinity byte per key needs to be subtracted
//
u_int64_t inf_byte_space = dict_stats.bt_ndata;
stats.data_file_length = (inf_byte_space > stats.data_file_length) ? 0 : stats.data_file_length - inf_byte_space;
}
stats.mean_rec_length = stats.records ? (ulong)(stats.data_file_length/stats.records) : 0; stats.mean_rec_length = stats.records ? (ulong)(stats.data_file_length/stats.records) : 0;
stats.index_file_length = 0; stats.index_file_length = 0;
for (uint i = 0; i < curr_num_DBs; i++) { for (uint i = 0; i < curr_num_DBs; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment