Commit a4c7c03e authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#3185 use ctime_r in ::check. dont put timestamps into the result set, so...

#3185 use ctime_r in ::check.  dont put timestamps into the result set, so that the mysql tests have a chance of passing refs[t:3185]

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@27839 c7de825b-a66e-492c-adef-691d508d4ae1
parent 0764d6b3
...@@ -7294,8 +7294,10 @@ ha_tokudb_check_progress(void *extra, float progress) { ...@@ -7294,8 +7294,10 @@ ha_tokudb_check_progress(void *extra, float progress) {
} }
static void static void
ha_tokudb_check_info(THD *thd, const char *tablename, const char *msg) { ha_tokudb_check_info(THD *thd, TABLE *table, const char *msg) {
if (thd->vio_ok()) { if (thd->vio_ok()) {
char tablename[256];
snprintf(tablename, sizeof tablename, "%s.%s", table->s->db.str, table->s->table_name.str);
thd->protocol->prepare_for_resend(); thd->protocol->prepare_for_resend();
thd->protocol->store(tablename, strlen(tablename), system_charset_info); thd->protocol->store(tablename, strlen(tablename), system_charset_info);
thd->protocol->store("check", 5, system_charset_info); thd->protocol->store("check", 5, system_charset_info);
...@@ -7334,34 +7336,39 @@ ha_tokudb::check(THD *thd, HA_CHECK_OPT *check_opt) { ...@@ -7334,34 +7336,39 @@ 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); time_t now;
char timebuf[32];
snprintf(write_status_msg, sizeof write_status_msg, snprintf(write_status_msg, sizeof write_status_msg,
"%.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); "ha_tokudb::check %s %s primary=%d num=%d", table->s->db.str, table->s->table_name.str, primary_key, num_DBs);
if (verbose) ha_tokudb_check_info(thd, table, write_status_msg);
fprintf(stderr, "%s\n", write_status_msg); if (verbose) {
ha_tokudb_check_info(thd, share->table_name, write_status_msg); now = time(0);
fprintf(stderr, "%.24s %s\n", ctime_r(&now, timebuf), 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 = "primary"; // hidden primary key does not set name kname = "primary"; // hidden primary key does not set name
now = time(0);
snprintf(write_status_msg, sizeof write_status_msg, snprintf(write_status_msg, sizeof write_status_msg,
"%.24s ha_tokudb::check %s %s key=%s %u", ctime(&now), table->s->db.str, table->s->table_name.str, kname, i); "ha_tokudb::check %s %s key=%s %u", 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) ha_tokudb_check_info(thd, table, write_status_msg);
fprintf(stderr, "%s\n", write_status_msg); if (verbose) {
ha_tokudb_check_info(thd, share->table_name, write_status_msg); now = time(0);
fprintf(stderr, "%.24s %s\n", ctime_r(&now, timebuf), 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);
snprintf(write_status_msg, sizeof write_status_msg, snprintf(write_status_msg, sizeof write_status_msg,
"%.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); "ha_tokudb::check %s %s key=%s %u result=%d", 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) ha_tokudb_check_info(thd, table, write_status_msg);
fprintf(stderr, "%s\n", write_status_msg); if (verbose) {
ha_tokudb_check_info(thd, share->table_name, write_status_msg); now = time(0);
fprintf(stderr, "%.24s %s\n", ctime_r(&now, timebuf), 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