[MDEV-7519] debian / ubuntu packaging creation of plugin table (if not exists) Created: 2015-01-28  Updated: 2015-02-08  Resolved: 2015-02-08

Status: Closed
Project: MariaDB Server
Component/s: Packaging
Affects Version/s: 10.0.16, 5.5
Fix Version/s: 5.5.42, 10.0.17

Type: Bug Priority: Major
Reporter: Daniel Black Assignee: Elena Stepanova
Resolution: Fixed Votes: 0
Labels: verified


 Description   

Debian has CREATE TABLE IF NOT EXISTS plugin and Ubuntu only has CREATE TABLE plugin.

Thinking Ubuntu should have IF NOT EXISTS too. It might fail otherwise.

--- debian/dist/Ubuntu/mariadb-server-10.0.postinst     2014-05-25 15:03:40.306600000 +1000
+++ debian/dist/Debian/mariadb-server-10.0.postinst     2014-05-25 15:03:40.306600000 +1000
@@ -213,7 +212,7 @@
     # admin might already have chosen to remove one or more plugins. Newlines are necessary.
     install_plugins=`/bin/echo -e \
         "USE mysql;\n" \
-        "CREATE TABLE plugin (name char(64) COLLATE utf8_bin NOT NULL DEFAULT '', " \
+        "CREATE TABLE IF NOT EXISTS plugin (name char(64) COLLATE utf8_bin NOT NULL DEFAULT '', " \
         "  dl char(128) COLLATE utf8_bin NOT NULL DEFAULT '', " \
         "  PRIMARY KEY (name)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='MySQL plugins';" `
 



 Comments   
Comment by Elena Stepanova [ 2015-01-29 ]

'IF NOT EXISTS' was added by Monty in this patch:

revno: 3543
revision-id: monty@askmonty.org-20121002132622-2iews7w28r5kp6fk
parent: sanja@montyprogram.com-20120925104511-okm43niqk8jkf9vc
committer: Michael Widenius <monty@askmonty.org>
branch nick: maria-5.5
timestamp: Tue 2012-10-02 16:26:22 +0300
message:
  Fixed installation issues on debian:
  - Don't abort if plugin table exists
  - Use longer timeout for start/stop of mysqld

Apparently, it should be applied to Ubuntu also.
Here is the whole patch (so it's the only change that's missing):

$ bzr diff -c 3543
=== modified file 'debian/dist/Debian/mariadb-server-5.5.postinst'
--- debian/dist/Debian/mariadb-server-5.5.postinst	2012-07-12 13:32:35 +0000
+++ debian/dist/Debian/mariadb-server-5.5.postinst	2012-10-02 13:26:22 +0000
@@ -212,7 +212,7 @@
     # admin might already have chosen to remove one or more plugins. Newlines are necessary.
     install_plugins=`/bin/echo -e \
         "USE mysql;\n" \
-        "CREATE TABLE plugin (name char(64) COLLATE utf8_bin NOT NULL DEFAULT '', " \
+        "CREATE TABLE IF NOT EXISTS plugin (name char(64) COLLATE utf8_bin NOT NULL DEFAULT '', " \
         "  dl char(128) COLLATE utf8_bin NOT NULL DEFAULT '', " \
         "  PRIMARY KEY (name)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='MySQL plugins';" `
 
 
=== modified file 'debian/mariadb-server-5.5.mysql.init'
--- debian/mariadb-server-5.5.mysql.init	2012-01-28 20:22:14 +0000
+++ debian/mariadb-server-5.5.mysql.init	2012-10-02 13:26:22 +0000
@@ -109,7 +109,7 @@
   	    /usr/bin/mysqld_safe > /dev/null 2>&1 &
 
 	    # 6s was reported in #352070 to be too few when using ndbcluster
-	    for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-14}"); do
+	    for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-30}"); do
                 sleep 1
 	        if mysqld_status check_alive nowarn ; then break; fi
 		log_progress_msg "."
@@ -142,7 +142,7 @@
 	    log_daemon_msg "Killing MariaDB database server by signal" "mysqld"
 	    killall -15 mysqld
             server_down=
-	    for i in 1 2 3 4 5 6 7 8 9 10; do
+	    for i in 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10; do
               sleep 1
               if mysqld_status check_dead nowarn; then server_down=1; break; fi
             done

Comment by Elena Stepanova [ 2015-02-08 ]

Pushed into 5.5 tree: http://bazaar.launchpad.net/~maria-captains/maria/5.5/revision/4423

Generated at Thu Feb 08 07:20:12 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.