Commit 5af2fb7b authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:2435], display amount of data_free in show table status

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@18267 c7de825b-a66e-492c-adef-691d508d4ae1
parent 06111418
...@@ -4708,6 +4708,8 @@ int ha_tokudb::info(uint flag) { ...@@ -4708,6 +4708,8 @@ int ha_tokudb::info(uint flag) {
stats.deleted = 0; stats.deleted = 0;
if (!(flag & HA_STATUS_NO_LOCK)) { if (!(flag & HA_STATUS_NO_LOCK)) {
u_int64_t num_rows = 0; u_int64_t num_rows = 0;
TOKU_DB_FRAGMENTATION_S frag_info = {0};
u_int64_t num_deleted_bytes = 0;
error = db_env->txn_begin(db_env, NULL, &txn, DB_READ_UNCOMMITTED); error = db_env->txn_begin(db_env, NULL, &txn, DB_READ_UNCOMMITTED);
if (error) { goto cleanup; } if (error) { goto cleanup; }
...@@ -4719,6 +4721,12 @@ int ha_tokudb::info(uint flag) { ...@@ -4719,6 +4721,12 @@ int ha_tokudb::info(uint flag) {
else { else {
goto cleanup; goto cleanup;
} }
error = share->file->get_fragmentation(
share->file,
&frag_info
);
if (error) { goto cleanup; }
stats.delete_length = frag_info.unused_bytes;
error = share->file->stat64( error = share->file->stat64(
share->file, share->file,
...@@ -4757,6 +4765,13 @@ int ha_tokudb::info(uint flag) { ...@@ -4757,6 +4765,13 @@ int ha_tokudb::info(uint flag) {
); );
if (error) { goto cleanup; } if (error) { goto cleanup; }
stats.index_file_length += dict_stats.bt_dsize; stats.index_file_length += dict_stats.bt_dsize;
error = share->file->get_fragmentation(
share->file,
&frag_info
);
if (error) { goto cleanup; }
stats.delete_length += frag_info.unused_bytes;
} }
} }
} }
......
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