diff --git a/include/mysql_com.h b/include/mysql_com.h index 27307b690b9..a874034ba46 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -31,7 +31,7 @@ #if defined(__WIN__) && !defined( _CUSTOMCONFIG_) #define MYSQL_NAMEDPIPE "MySQL" -#define MYSQL_SERVICENAME "mysqld" +#define MYSQL_SERVICENAME "MySQL" #endif /* __WIN__ */ enum enum_server_command { diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index b7627fc59fd..f1deda41f8b 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -401,7 +401,9 @@ static void usage(void) Change the character set used by the index\n\ -q, --quick Faster repair by not modifying the data file.\n\ One can give a second '-q' to force myisamchk to\n\ - modify the original datafile in case of duplicate keys\n\ + modify the original datafile in case of duplicate keys.\n\ + NOTE: Tables where the data file is currupted can't be\n\ + fixed with this option.\n\ -u, --unpack Unpack file packed with myisampack.\n\ "); @@ -1094,7 +1096,7 @@ end2: filename)); if (param->testflag & T_REP_ANY) VOID(fprintf(stderr, - "Try fixing it by using the --safe-recover (-o) or the --force (-f) option\n")); + "Try fixing it by using the --safe-recover (-o), the --force (-f) option or by not using the --quick (-q) flag\n")); } else if (!(param->error_printed & 2) && !(param->testflag & T_FORCE_CREATE)) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 5073f8e1c40..cdcf13ca7bf 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2615,10 +2615,16 @@ int main(int argc, char **argv) if (!default_service_handling(argv, MYSQL_SERVICENAME, MYSQL_SERVICENAME, file_path, "")) return 0; - if (Service.IsService(argv[1])) + if (Service.IsService(argv[1])) /* Start an optional service */ { - /* start an optional service */ - load_default_groups[3]= argv[1]; + /* + Only add the service name to the groups read from the config file + if it's not "MySQL". (The default service name should be 'mysqld' + but we started a bad tradition by calling it MySQL from the start + and we are now stuck with it. + */ + if (my_strcasecmp(argv[1],"mysql")) + load_default_groups[3]= argv[1]; start_mode= 1; Service.Init(argv[1], mysql_service); return 0; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e63e85e99c6..0789a1768d1 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1013,14 +1013,17 @@ bool dispatch_command(enum enum_server_command command, THD *thd, char *save_user= thd->user; char *save_priv_user= thd->priv_user; char *save_db= thd->db; - thd->user=0; - USER_CONN *save_uc= thd->user_connect; + USER_CONN *save_user_connect= thd->user_connect; if ((uint) ((uchar*) db - net->read_pos) > packet_length) { // Check if protocol is ok send_error(net, ER_UNKNOWN_COM_ERROR); break; } + + /* Clear variables that are allocated */ + thd->user= 0; + thd->user_connect= 0; if (check_user(thd, COM_CHANGE_USER, user, passwd, db, 0)) { // Restore old user x_free(thd->user); @@ -1030,10 +1033,11 @@ bool dispatch_command(enum enum_server_command command, THD *thd, thd->db_length=save_db_length; thd->user=save_user; thd->priv_user=save_priv_user; + thd->user_connect= save_user_connect; break; } - if (save_uc) - decrease_user_connections(save_uc); + if (save_user_connect) + decrease_user_connections(save_user_connect); x_free((gptr) save_db); x_free((gptr) save_user); break;