returning non-zero exit status in this case is not nice to scripts using mysql_upgrade (eg. our init script) --- client/mysql_upgrade.c | 4 +++- mysql-test/t/mysql_upgrade.test | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) --- client/mysql_upgrade.c.orig +++ client/mysql_upgrade.c @@ -758,7 +758,9 @@ int main(int argc, char **argv) printf("This installation of MySQL is already upgraded to %s, " "use --force if you still need to run mysql_upgrade\n", MYSQL_SERVER_VERSION); - die(NULL); + free_used_memory(); + my_end(MY_CHECK_ERROR); + exit(0); } /* --- mysql-test/t/mysql_upgrade.test.orig +++ mysql-test/t/mysql_upgrade.test @@ -19,7 +19,7 @@ file_exists $MYSQLTEST_VARDIR/master-dat --echo Run it again - should say already completed --replace_result $MYSQL_SERVER_VERSION VERSION ---error 1 +--error 0 --exec $MYSQL_UPGRADE --skip-verbose 2>&1 # It should have created a file in the MySQL Servers datadir