summaryrefslogtreecommitdiff
path: root/storage/myisam/ha_myisam.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/myisam/ha_myisam.cc')
-rw-r--r--storage/myisam/ha_myisam.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 2ba62d03c6b..c4bb6d7dbd4 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -1499,8 +1499,6 @@ bool ha_myisam::check_and_repair(THD *thd)
{
int error=0;
int marked_crashed;
- char *old_query;
- uint old_query_length;
HA_CHECK_OPT check_opt;
DBUG_ENTER("ha_myisam::check_and_repair");
@@ -1511,10 +1509,9 @@ bool ha_myisam::check_and_repair(THD *thd)
check_opt.flags|=T_QUICK;
sql_print_warning("Checking table: '%s'",table->s->path.str);
- old_query= thd->query();
- old_query_length= thd->query_length();
+ const CSET_STRING query_backup= thd->query_string;
thd->set_query(table->s->table_name.str,
- (uint) table->s->table_name.length);
+ (uint) table->s->table_name.length, system_charset_info);
if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt))
{
@@ -1527,7 +1524,7 @@ bool ha_myisam::check_and_repair(THD *thd)
if (repair(thd, &check_opt))
error=1;
}
- thd->set_query(old_query, old_query_length);
+ thd->set_query(query_backup);
DBUG_RETURN(error);
}