We use InnoDB everywhere, so there should be no issues with long unicode
keys. Dropped charset parameter for recreate_database since it's not
needed anymore.
Change-Id: Ib768402a9337c918309030a92ab81da17269f4f6
| ... | ... |
@@ -262,7 +262,7 @@ function init_ceilometer {
|
| 262 | 262 |
|
| 263 | 263 |
if is_service_enabled mysql postgresql; then |
| 264 | 264 |
if [ "$CEILOMETER_BACKEND" = 'mysql' ] || [ "$CEILOMETER_BACKEND" = 'postgresql' ] ; then |
| 265 |
- recreate_database ceilometer utf8 |
|
| 265 |
+ recreate_database ceilometer |
|
| 266 | 266 |
$CEILOMETER_BIN_DIR/ceilometer-dbsync |
| 267 | 267 |
fi |
| 268 | 268 |
fi |
| ... | ... |
@@ -376,7 +376,7 @@ function init_cinder {
|
| 376 | 376 |
|
| 377 | 377 |
if is_service_enabled $DATABASE_BACKENDS; then |
| 378 | 378 |
# (Re)create cinder database |
| 379 |
- recreate_database cinder utf8 |
|
| 379 |
+ recreate_database cinder |
|
| 380 | 380 |
|
| 381 | 381 |
# Migrate cinder database |
| 382 | 382 |
$CINDER_BIN_DIR/cinder-manage db sync |
| ... | ... |
@@ -98,11 +98,9 @@ function initialize_database_backends {
|
| 98 | 98 |
|
| 99 | 99 |
# Recreate a given database |
| 100 | 100 |
# $1 The name of the database |
| 101 |
-# $2 The character set/encoding of the database |
|
| 102 | 101 |
function recreate_database {
|
| 103 | 102 |
local db=$1 |
| 104 |
- local charset=$2 |
|
| 105 |
- recreate_database_$DATABASE_TYPE $db $charset |
|
| 103 |
+ recreate_database_$DATABASE_TYPE $db |
|
| 106 | 104 |
} |
| 107 | 105 |
|
| 108 | 106 |
# Install the database |
| ... | ... |
@@ -43,9 +43,8 @@ function cleanup_database_mysql {
|
| 43 | 43 |
|
| 44 | 44 |
function recreate_database_mysql {
|
| 45 | 45 |
local db=$1 |
| 46 |
- local charset=$2 |
|
| 47 | 46 |
mysql -u$DATABASE_USER -p$DATABASE_PASSWORD -h$MYSQL_HOST -e "DROP DATABASE IF EXISTS $db;" |
| 48 |
- mysql -u$DATABASE_USER -p$DATABASE_PASSWORD -h$MYSQL_HOST -e "CREATE DATABASE $db CHARACTER SET $charset;" |
|
| 47 |
+ mysql -u$DATABASE_USER -p$DATABASE_PASSWORD -h$MYSQL_HOST -e "CREATE DATABASE $db CHARACTER SET utf8;" |
|
| 49 | 48 |
} |
| 50 | 49 |
|
| 51 | 50 |
function configure_database_mysql {
|
| ... | ... |
@@ -37,10 +37,9 @@ function cleanup_database_postgresql {
|
| 37 | 37 |
|
| 38 | 38 |
function recreate_database_postgresql {
|
| 39 | 39 |
local db=$1 |
| 40 |
- local charset=$2 |
|
| 41 | 40 |
# Avoid unsightly error when calling dropdb when the database doesn't exist |
| 42 | 41 |
psql -h$DATABASE_HOST -U$DATABASE_USER -dtemplate1 -c "DROP DATABASE IF EXISTS $db" |
| 43 |
- createdb -h $DATABASE_HOST -U$DATABASE_USER -l C -T template0 -E $charset $db |
|
| 42 |
+ createdb -h $DATABASE_HOST -U$DATABASE_USER -l C -T template0 -E utf8 $db |
|
| 44 | 43 |
} |
| 45 | 44 |
|
| 46 | 45 |
function configure_database_postgresql {
|
| ... | ... |
@@ -380,7 +380,7 @@ function create_ironic_accounts {
|
| 380 | 380 |
# init_ironic() - Initialize databases, etc. |
| 381 | 381 |
function init_ironic {
|
| 382 | 382 |
# (Re)create ironic database |
| 383 |
- recreate_database ironic utf8 |
|
| 383 |
+ recreate_database ironic |
|
| 384 | 384 |
|
| 385 | 385 |
# Migrate ironic database |
| 386 | 386 |
$IRONIC_BIN_DIR/ironic-dbsync --config-file=$IRONIC_CONF_FILE |
| ... | ... |
@@ -592,7 +592,7 @@ function create_neutron_initial_network {
|
| 592 | 592 |
|
| 593 | 593 |
# init_neutron() - Initialize databases, etc. |
| 594 | 594 |
function init_neutron {
|
| 595 |
- recreate_database $Q_DB_NAME utf8 |
|
| 595 |
+ recreate_database $Q_DB_NAME |
|
| 596 | 596 |
# Run Neutron db migrations |
| 597 | 597 |
$NEUTRON_BIN_DIR/neutron-db-manage --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE upgrade head |
| 598 | 598 |
} |
| ... | ... |
@@ -623,16 +623,13 @@ function init_nova {
|
| 623 | 623 |
# Only do this step once on the API node for an entire cluster. |
| 624 | 624 |
if is_service_enabled $DATABASE_BACKENDS && is_service_enabled n-api; then |
| 625 | 625 |
# (Re)create nova database |
| 626 |
- # Explicitly use latin1: to avoid lp#829209, nova expects the database to |
|
| 627 |
- # use latin1 by default, and then upgrades the database to utf8 (see the |
|
| 628 |
- # 082_essex.py in nova) |
|
| 629 |
- recreate_database nova latin1 |
|
| 626 |
+ recreate_database nova |
|
| 630 | 627 |
|
| 631 | 628 |
# Migrate nova database |
| 632 | 629 |
$NOVA_BIN_DIR/nova-manage db sync |
| 633 | 630 |
|
| 634 | 631 |
if is_service_enabled n-cell; then |
| 635 |
- recreate_database $NOVA_CELLS_DB latin1 |
|
| 632 |
+ recreate_database $NOVA_CELLS_DB |
|
| 636 | 633 |
fi |
| 637 | 634 |
fi |
| 638 | 635 |
|
| ... | ... |
@@ -143,7 +143,7 @@ function configure_sahara {
|
| 143 | 143 |
setup_colorized_logging $SAHARA_CONF_FILE DEFAULT |
| 144 | 144 |
fi |
| 145 | 145 |
|
| 146 |
- recreate_database sahara utf8 |
|
| 146 |
+ recreate_database sahara |
|
| 147 | 147 |
$SAHARA_BIN_DIR/sahara-db-manage --config-file $SAHARA_CONF_FILE upgrade head |
| 148 | 148 |
} |
| 149 | 149 |
|
| ... | ... |
@@ -201,7 +201,7 @@ function install_trove {
|
| 201 | 201 |
# init_trove() - Initializes Trove Database as a Service |
| 202 | 202 |
function init_trove {
|
| 203 | 203 |
# (Re)Create trove db |
| 204 |
- recreate_database trove utf8 |
|
| 204 |
+ recreate_database trove |
|
| 205 | 205 |
|
| 206 | 206 |
# Initialize the trove database |
| 207 | 207 |
$TROVE_BIN_DIR/trove-manage db_sync |