Index: mysql-test/r/mysqlcheck.result =================================================================== --- mysql-test/r/mysqlcheck.result (revision 1) +++ mysql-test/r/mysqlcheck.result (working copy) @@ -158,6 +158,9 @@ test.t 1 OK test.t`1 OK drop table `t``1`, `t 1`; +create table `t.1`(a int) engine=myisam; +test.t.1 OK +drop table `t.1`; create database d_bug25347; use d_bug25347; create table t_bug25347 (a int) engine=myisam; Index: mysql-test/t/mysqlcheck.test =================================================================== --- mysql-test/t/mysqlcheck.test (revision 1) +++ mysql-test/t/mysqlcheck.test (working copy) @@ -57,6 +57,14 @@ drop table `t``1`, `t 1`; # +# Bug #68015: mysqlcheck fails during upgrade of tables whose names include dot +# +create table `t.1`(a int) engine=myisam; +--replace_result 'Table is already up to date' OK +--exec $MYSQL_CHECK --databases test -a +drop table `t.1`; + +# # Bug#25347: mysqlcheck -A -r doesn't repair table marked as crashed # create database d_bug25347; Index: client/mysqlcheck.c =================================================================== --- client/mysqlcheck.c (revision 1) +++ client/mysqlcheck.c (working copy) @@ -224,6 +224,7 @@ static void print_result(); static uint fixed_name_length(const char *name); static char *fix_table_name(char *dest, char *src); +static char *fix_pure_table_name(char *dest, char *src); int what_to_do = 0; @@ -537,6 +538,18 @@ return dest; } +static char *fix_pure_table_name(char *dest, char *src) +{ + *dest++= '`'; + for (; *src; src++) + { + if (*src == '`') + *dest++= '`'; + *dest++= *src; + } + *dest++= '`'; + return dest; +} static int process_all_tables_in_db(char *database) { @@ -755,7 +768,9 @@ char *ptr; ptr= strmov(strmov(query, op), " TABLE "); - ptr= fix_table_name(ptr, tables); + + ptr= fix_pure_table_name(ptr, tables); + ptr= strxmov(ptr, " ", options, NullS); query_length= (uint) (ptr - query); } @@ -804,10 +819,10 @@ if (prev_alter[0]) insert_dynamic(&alter_table_cmds, (uchar*) prev_alter); else - insert_dynamic(&tables4rebuild, (uchar*) prev); + insert_dynamic(&tables4rebuild, (uchar*) ((strchr(prev, '.') + 1))); } else - insert_dynamic(&tables4repair, prev); + insert_dynamic(&tables4repair, ((strchr(prev, '.') + 1))); } found_error=0; table_rebuild=0; @@ -859,10 +874,10 @@ if (prev_alter[0]) insert_dynamic(&alter_table_cmds, (uchar*) prev_alter); else - insert_dynamic(&tables4rebuild, (uchar*) prev); + insert_dynamic(&tables4rebuild, (uchar*) ((strchr(prev, '.') + 1))); } else - insert_dynamic(&tables4repair, prev); + insert_dynamic(&tables4repair, ((strchr(prev, '.') + 1))); } mysql_free_result(res); }