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

addresses #1380

fix issue

git-svn-id: file:///svn/mysql/tokudb-engine/src@8700 c7de825b-a66e-492c-adef-691d508d4ae1
parent aa87d54b
......@@ -3329,7 +3329,7 @@ int ha_tokudb::info(uint flag) {
TOKUDB_DBUG_ENTER("ha_tokudb::info %p %d %lld", this, flag, share->rows);
if (flag & HA_STATUS_VARIABLE) {
// Just to get optimizations right
stats.records = share->rows;
stats.records = share->rows + share->rows_from_locked_table;
stats.deleted = 0;
}
if ((flag & HA_STATUS_CONST)) {
......@@ -3573,7 +3573,7 @@ int ha_tokudb::external_lock(THD * thd, int lock_type) {
pthread_mutex_unlock(&share->mutex);
added_rows = 0;
deleted_rows = 0;
share->rows_from_locked_table = 0;
if (!--trx->tokudb_lock_count) {
if (trx->stmt) {
/*
......@@ -3616,6 +3616,9 @@ int ha_tokudb::start_stmt(THD * thd, thr_lock_type lock_type) {
error = db_env->txn_begin(db_env, trx->sp_level, &trx->stmt, toku_iso_to_txn_flag(trx->iso_level));
trans_register_ha(thd, FALSE, tokudb_hton);
}
if (added_rows > deleted_rows) {
share->rows_from_locked_table = added_rows - deleted_rows;
}
transaction = trx->stmt;
TOKUDB_DBUG_RETURN(error);
}
......
......@@ -12,7 +12,15 @@ typedef struct st_tokudb_share {
ulonglong auto_ident;
ulonglong last_auto_increment, auto_inc_create_value;
//
// estimate on number of rows in table
//
ha_rows rows;
//
// estimate on number of rows added in the process of a locked tables
// this is so we can better estimate row count during a lock table
//
ha_rows rows_from_locked_table;
DB *status_block;
//
// DB that is indexed on the primary key
......
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