Build fails due to test creation of test database that already exists

Bug #1423026 reported by Robie Basak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ruby-mysql2 (Debian)
Fix Released
Unknown
ruby-mysql2 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Rebuilding ruby-mysql2 0.3.16-2 fails on Vivid when against MySQL 5.6. This seems to be because debian/start_mysqld_and_auto_install.sh attempts to create a database called "test", except that the previous call to mysql_install_db already created it. Presumably this worked differently in MySQL 5.5.

As a workaround, I disabled the call, but this isn't a real fix, so leaving this bug open to do it properly.

How should it be done properly? I don't see the manpage for mysql_install_db in 5.6 even mention the creation of a database called test. Is this an omission in the manpage?

Revision history for this message
Robie Basak (racb) wrote :

Workaround in 0.3.16-2ubuntu1. Not sending this to Debian; I'd like to send a proper fix instead.

tags: added: mysql-5.6-transition
Revision history for this message
Norvald H. Ryeng (nryeng) wrote :

I did some detective work: mysql_install_db 5.5 was patched in Debian/Ubuntu to not create the test database. In 5.6 packaging, mysql_install_db isn't run during a normal install (the necessary lines are part of postinst instead), so it was never necessary to patch it to not create the test database.

If you need a line that works in both 5.5 and 5.6:

mysql --socket=${MYSQL_UNIX_PORT} --execute "CREATE DATABASE ${DO_MYSQL_DBNAME} IF NOT EXISTS;"

The last clause of the SQL string makes sure it doesn't fail if the database already exists.

Another option is to patch mysql_install_db in 5.6 packaging.

Robie Basak (racb)
Changed in ruby-mysql2 (Ubuntu):
status: New → Fix Released
Changed in ruby-mysql2 (Debian):
status: Unknown → New
Changed in ruby-mysql2 (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.