SHA256
1
0
forked from pool/mariadb
mariadb/mysql_upgrade-exit-status.patch
2010-09-29 10:17:50 +00:00

36 lines
1.2 KiB
Diff

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(-)
Index: client/mysql_upgrade.c
===================================================================
--- client/mysql_upgrade.c.orig
+++ client/mysql_upgrade.c
@@ -878,7 +878,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);
}
/*
Index: mysql-test/t/mysql_upgrade.test
===================================================================
--- mysql-test/t/mysql_upgrade.test.orig
+++ mysql-test/t/mysql_upgrade.test
@@ -41,7 +41,7 @@ file_exists $MYSQLD_DATADIR/mysql_upgrad
--echo Run it again - should say already completed
--replace_result $MYSQL_SERVER_VERSION VERSION
---error 1
+--error 0
--exec $MYSQL_UPGRADE 2>&1
# It should have created a file in the MySQL Servers datadir