Commit 24a9c87e authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:2033], add process info for queries

git-svn-id: file:///svn/mysql/tokudb-engine/src@14784 c7de825b-a66e-492c-adef-691d508d4ae1
parent d04d4f1a
This diff is collapsed.
......@@ -196,19 +196,6 @@ class ha_tokudb : public handler {
ulonglong deleted_rows;
//
// count on number of rows inserted by statement
// this is to help give user progress on what is happening
// the reason that the variables added_rows and deleted_rows
// are not used is that those variables are also used to help
// estimate the number of rows in the DB. There are tricky things that
// can happen with "lock tables", so I do not want to couple these
// two features together. There is a little duplicate work, but I think it is fine
//
ulonglong num_added_rows_in_stmt;
ulonglong num_deleted_rows_in_stmt;
ulonglong num_updated_rows_in_stmt;
uint last_dup_key;
//
// if set to 0, then the primary key is not hidden
......@@ -445,6 +432,8 @@ class ha_tokudb : public handler {
return tokudb_prefix_cmp_dbt_key(share->key_file[keynr], first_key, second_key);
}
void track_progress(THD* thd);
int heavi_ret_val;
//
......
......@@ -83,17 +83,33 @@ typedef enum {
typedef struct st_tokudb_stmt_progress {
ulonglong inserted;
ulonglong updated;
ulonglong deleted;
ulonglong queried;
} tokudb_stmt_progress;
typedef struct st_tokudb_trx_data {
DB_TXN *all;
DB_TXN *stmt;
DB_TXN *sp_level;
uint tokudb_lock_count;
HA_TOKU_ISO_LEVEL iso_level;
tokudb_stmt_progress stmt_progress;
} tokudb_trx_data;
extern char *tokudb_data_dir;
extern const char *ha_tokudb_ext;
static void reset_stmt_progress (tokudb_stmt_progress* val) {
val->deleted = 0;
val->inserted = 0;
val->updated = 0;
val->queried = 0;
}
static int get_name_length(const char *name) {
int n = 0;
const char *newname = name;
......
......@@ -442,6 +442,7 @@ static int tokudb_commit(handlerton * hton, THD * thd, bool all) {
if (all) {
trx->iso_level = hatoku_iso_not_set;
}
reset_stmt_progress(&trx->stmt_progress);
TOKUDB_DBUG_RETURN(error);
}
......@@ -467,6 +468,7 @@ static int tokudb_rollback(handlerton * hton, THD * thd, bool all) {
if (all) {
trx->iso_level = hatoku_iso_not_set;
}
reset_stmt_progress(&trx->stmt_progress);
TOKUDB_DBUG_RETURN(error);
}
......
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