=== modified file 'client/mysqladmin.cc' --- client/mysqladmin.cc 2011-02-11 14:38:34 +0000 +++ client/mysqladmin.cc 2011-04-18 20:45:59 +0000 @@ -869,11 +869,28 @@ } case ADMIN_FLUSH_LOGS: { - if (mysql_refresh(mysql,REFRESH_LOG)) - { - my_printf_error(0, "refresh failed; error: '%s'", error_flags, - mysql_error(mysql)); - return -1; + if ((argc == 2) && ((strcasecmp(argv[1],"binary") == 0) + || (strcasecmp(argv[1],"engine") == 0) + || (strcasecmp(argv[1],"error") == 0) + || (strcasecmp(argv[1],"general") == 0) + || (strcasecmp(argv[1],"relay") == 0) + || (strcasecmp(argv[1],"slow") == 0))) { + char buff[42]; + sprintf(buff,"FLUSH /*!50503 %s */ LOGS",argv[1]); + if (mysql_query(mysql,buff)) + { + my_printf_error(0, "refresh failed; error: '%s'", error_flags, + mysql_error(mysql)); + return -1; + } + argc--; argv++; + } else { + if (mysql_refresh(mysql,REFRESH_LOG)) + { + my_printf_error(0, "refresh failed; error: '%s'", error_flags, + mysql_error(mysql)); + return -1; + } } break; } @@ -1104,7 +1121,7 @@ drop databasename Delete a database and all its tables\n\ extended-status Gives an extended status message from the server\n\ flush-hosts Flush all cached hosts\n\ - flush-logs Flush all logs\n\ + flush-logs logtype Flush all logs or logs of just one logtype\n\ flush-status Clear status variables\n\ flush-tables Flush all tables\n\ flush-threads Flush the thread cache\n\