Ubuntu Pastebin

Paste from robie at Thu, 7 Apr 2016 11:18:00 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
diff -Nru mysql-5.7-5.7.11/debian/changelog mysql-5.7-5.7.11/debian/changelog
--- mysql-5.7-5.7.11/debian/changelog	2016-04-06 12:49:45.000000000 +0100
+++ mysql-5.7-5.7.11/debian/changelog	2016-04-07 12:15:45.000000000 +0100
@@ -1,3 +1,11 @@
+mysql-5.7 (5.7.11-0ubuntu5) xenial; urgency=medium
+
+  * d/mysql-server-5.7.postinst: ignore mysql_upgrade's exit status when
+    it is one that includes the indication that there is nothing to do
+    (LP: #1566406).
+
+ -- Robie Basak <robie.basak@ubuntu.com>  Thu, 07 Apr 2016 11:58:28 +0100
+
 mysql-5.7 (5.7.11-0ubuntu4) xenial; urgency=medium
 
   * d/p/allowemptyport.patch: update corresponding test.
diff -Nru mysql-5.7-5.7.11/debian/mysql-server-5.7.postinst mysql-5.7-5.7.11/debian/mysql-server-5.7.postinst
--- mysql-5.7-5.7.11/debian/mysql-server-5.7.postinst	2016-04-04 12:51:22.000000000 +0100
+++ mysql-5.7-5.7.11/debian/mysql-server-5.7.postinst	2016-04-07 12:14:45.000000000 +0100
@@ -225,7 +225,14 @@
       set_mysql_pw "debian-sys-maint" "$pass"
       invoke start
     fi
-    mysql_upgrade --defaults-file=/etc/mysql/debian.cnf
+    # mysql_upgrade returns exit status 2 if the database is already upgraded
+    # (LP: #1566406) so ignore its exit status if it is 2.
+    result=0
+    mysql_upgrade --defaults-file=/etc/mysql/debian.cnf || result=$?
+    if [ $result -ne 0 -a $result -ne 2 ]; then
+      echo "mysql_upgrade failed with exit status $result" >&2
+      exit 1
+    fi
   fi
   # Here we check to see if we can connect as root without a password
   # this should catch upgrades from previous versions where the root
Download as text