From 19107288e470fed4b01577bc5c0d3a6b71601840 Mon Sep 17 00:00:00 2001 From: "iggy@alf.(none)" <> Date: Mon, 8 Oct 2007 22:30:41 -0400 Subject: [PATCH] Bug#28774 mysql_upgrade creates tempfiles in root-dir (C:\) and doesn't clean them up - Make sure to cleanup temporary files after use. --- client/mysql_upgrade.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 1646f2baf51..02829cd2178 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -456,7 +456,11 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res, if (my_write(fd, query, strlen(query), MYF(MY_FNABP | MY_WME))) + { + my_close(fd, MYF(0)); + my_delete(query_file_path, MYF(0)); die("Failed to write to '%s'", query_file_path); + } ret= run_tool(mysql_path, ds_res,