Commit 44e228f8 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#3185 fix the check status messages refs[t:3185]

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@27809 c7de825b-a66e-492c-adef-691d508d4ae1
parent b83baf30
...@@ -7334,32 +7334,33 @@ ha_tokudb::check(THD *thd, HA_CHECK_OPT *check_opt) { ...@@ -7334,32 +7334,33 @@ ha_tokudb::check(THD *thd, HA_CHECK_OPT *check_opt) {
result = HA_ADMIN_INTERNAL_ERROR; result = HA_ADMIN_INTERNAL_ERROR;
if (result == HA_ADMIN_OK) { if (result == HA_ADMIN_OK) {
uint32_t num_DBs = table_share->keys + test(hidden_primary_key); uint32_t num_DBs = table_share->keys + test(hidden_primary_key);
time_t now = time(0);
snprintf(write_status_msg, sizeof write_status_msg, snprintf(write_status_msg, sizeof write_status_msg,
"check table %s primary=%d num=%d\n", share->table_name, primary_key, num_DBs); "%.24s ha_tokudb::check %s %s primary=%d num=%d", ctime(&now), table->s->db.str, table->s->table_name.str, primary_key, num_DBs);
if (verbose) if (verbose)
fprintf(stderr, write_status_msg); fprintf(stderr, "%s\n", write_status_msg);
ha_tokudb_check_info(thd, share->table_name, write_status_msg); ha_tokudb_check_info(thd, share->table_name, write_status_msg);
for (uint i = 0; i < num_DBs; i++) { for (uint i = 0; i < num_DBs; i++) {
time_t now; time_t now;
DB *db = share->key_file[i]; DB *db = share->key_file[i];
const char *kname = table_share->key_info[i].name; const char *kname = table_share->key_info[i].name;
if (i == primary_key) if (i == primary_key)
kname = "main"; // hidden primary key does not set name kname = "primary"; // hidden primary key does not set name
now = time(0); now = time(0);
snprintf(write_status_msg, sizeof write_status_msg, snprintf(write_status_msg, sizeof write_status_msg,
"%.24s %u: check key=%s\n", ctime(&now), i, kname); "%.24s ha_tokudb::check %s %s key=%s %u", ctime(&now), table->s->db.str, table->s->table_name.str, kname, i);
thd_proc_info(thd, write_status_msg); thd_proc_info(thd, write_status_msg);
if (verbose) if (verbose)
fprintf(stderr, write_status_msg); fprintf(stderr, "%s\n", write_status_msg);
ha_tokudb_check_info(thd, share->table_name, write_status_msg); ha_tokudb_check_info(thd, share->table_name, write_status_msg);
struct check_context check_context = { thd }; struct check_context check_context = { thd };
r = db->verify_with_progress(db, ha_tokudb_check_progress, &check_context, verbose, keep_going); r = db->verify_with_progress(db, ha_tokudb_check_progress, &check_context, verbose, keep_going);
now = time(0); now = time(0);
snprintf(write_status_msg, sizeof write_status_msg, snprintf(write_status_msg, sizeof write_status_msg,
"%.24s %u: check key=%s result=%d\n", ctime(&now), i, kname, r); "%.24s ha_tokudb::check %s %s key=%s %u result=%d", ctime(&now), table->s->db.str, table->s->table_name.str, kname, i, r);
thd_proc_info(thd, write_status_msg); thd_proc_info(thd, write_status_msg);
if (verbose) if (verbose)
fprintf(stderr, write_status_msg); fprintf(stderr, "%s\n", write_status_msg);
ha_tokudb_check_info(thd, share->table_name, write_status_msg); ha_tokudb_check_info(thd, share->table_name, write_status_msg);
if (result == HA_ADMIN_OK && r != 0) if (result == HA_ADMIN_OK && r != 0)
result = HA_ADMIN_CORRUPT; result = HA_ADMIN_CORRUPT;
......
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