File mariadb-5.1.50-upgrade-exit-status.patch of Package mariadb.import4830

PATCH-P0-FEATURE-SUSE: Returning 0 when already upgraded.

Returning non-zero exit status in this case is not nice to scripts using
mysql_upgrade (eg. our init script)

Maintainer: Michal Hrusecky <mhrusecky@suse.cz>

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
openSUSE Build Service is sponsored by