Browse code

Use latin1 character set when creating the nova database

Nova expects the latin1 character set to be used in its database by
default and then alters the database to utf8 when upgrading the
database (in 082_essex.py).

Nova works this way to work around bug 829209 ("Specified key was too
long" errors) that will be hit with the dns_domains table.

Change-Id: I81e6ed476e8a310fe01809e9afcc2c8d5360e9df

Vincent Untz authored on 2012/06/14 17:07:42
Showing 1 changed files
... ...
@@ -1899,7 +1899,10 @@ fi
1899 1899
 if is_service_enabled mysql && is_service_enabled nova; then
1900 1900
     # (re)create nova database
1901 1901
     mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'DROP DATABASE IF EXISTS nova;'
1902
-    mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'CREATE DATABASE nova;'
1902
+    # Explicitly use latin1: to avoid lp#829209, nova expects the database to
1903
+    # use latin1 by default, and then upgrades the database to utf8 (see the
1904
+    # 082_essex.py in nova)
1905
+    mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'CREATE DATABASE nova CHARACTER SET latin1;'
1903 1906
 
1904 1907
     # (re)create nova database
1905 1908
     $NOVA_DIR/bin/nova-manage db sync