MySQL: change default MySQL collate to utf8_general_ci

Install & configure MySQL database by using utf8_general_ci collation
which is the way documented in OpenStack [1] and already the default
in puppetlabs-mysql [2].

[1] http://goo.gl/GA5gyZ
[2] https://github.com/puppetlabs/puppetlabs-mysql/blob/master/manifests/db.pp#L7

Change-Id: I7ceecaa3e7fe964e53714cfd4c6fd2b8ff90fce0
Closes-bug: #1446375
This commit is contained in:
Emilien Macchi
2015-04-21 13:13:18 -04:00
parent 581d1ee95e
commit 6122ac4ebb
3 changed files with 7 additions and 7 deletions

View File

@@ -110,7 +110,7 @@ string; optional; default to 'utf8'
#####`collate` #####`collate`
The collate to use for the database; The collate to use for the database;
string; optional; default to 'utf8_unicode_ci' string; optional; default to 'utf8_general_ci'
#####`allowed_hosts` #####`allowed_hosts`
Additional hosts that are allowed to access this database; Additional hosts that are allowed to access this database;

View File

@@ -26,7 +26,7 @@
# #
# [*collate*] # [*collate*]
# The collate to use for the database; # The collate to use for the database;
# string; optional; default to 'utf8_unicode_ci' # string; optional; default to 'utf8_general_ci'
# #
# [*allowed_hosts*] # [*allowed_hosts*]
# Additional hosts that are allowed to access this database; # Additional hosts that are allowed to access this database;
@@ -42,7 +42,7 @@ define openstacklib::db::mysql (
$user = $title, $user = $title,
$host = '127.0.0.1', $host = '127.0.0.1',
$charset = 'utf8', $charset = 'utf8',
$collate = 'utf8_unicode_ci', $collate = 'utf8_general_ci',
$allowed_hosts = [], $allowed_hosts = [],
$privileges = 'ALL', $privileges = 'ALL',
) { ) {

View File

@@ -21,7 +21,7 @@ describe 'openstacklib::db::mysql' do
it { is_expected.to contain_mysql_database(title).with( it { is_expected.to contain_mysql_database(title).with(
:charset => 'utf8', :charset => 'utf8',
:collate => 'utf8_unicode_ci' :collate => 'utf8_general_ci'
)} )}
it { is_expected.to contain_openstacklib__db__mysql__host_access("#{title}_127.0.0.1").with( it { is_expected.to contain_openstacklib__db__mysql__host_access("#{title}_127.0.0.1").with(
:user => title, :user => title,
@@ -37,7 +37,7 @@ describe 'openstacklib::db::mysql' do
it { is_expected.to contain_mysql_database(params[:dbname]).with( it { is_expected.to contain_mysql_database(params[:dbname]).with(
:charset => 'utf8', :charset => 'utf8',
:collate => 'utf8_unicode_ci' :collate => 'utf8_general_ci'
)} )}
it { is_expected.to contain_openstacklib__db__mysql__host_access("#{params[:dbname]}_127.0.0.1").with( it { is_expected.to contain_openstacklib__db__mysql__host_access("#{params[:dbname]}_127.0.0.1").with(
:user => title, :user => title,
@@ -53,12 +53,12 @@ describe 'openstacklib::db::mysql' do
it { is_expected.to contain_mysql_database(title).with( it { is_expected.to contain_mysql_database(title).with(
:charset => 'utf8', :charset => 'utf8',
:collate => 'utf8_unicode_ci' :collate => 'utf8_general_ci'
)} )}
it { is_expected.to contain_openstacklib__db__mysql__host_access("#{title}_127.0.0.1").with( it { is_expected.to contain_openstacklib__db__mysql__host_access("#{title}_127.0.0.1").with(
:user => params[:user], :user => params[:user],
:database => title, :database => title,
:privileges => 'ALL' :privileges => 'ALL',
)} )}
end end