Make charset and collation configurables
MariaDB 11.5 has introduced changes to default collation, switching to uca1400_ai_ci from general_ci [1] With that they've also introduced changes to default value of character-set-collations value, which now has precedence over collation-server/collation-connection if CHARSET is supplied in request leading to potential conflicts [3] when performing migrations. We introduce set of new variables to be able to control and potentially switch to new collation/charsets by default in the future, while enabling us to keep current behavior. [1] https://mariadb.com/docs/release-notes/community-server/old-releases/release-notes-mariadb-11-5-rolling-releases/what-is-mariadb-115#other [2] https://mariadb.com/docs/server/server-management/variables-and-modes/server-system-variables#character_set_collations [3] https://jira.mariadb.org/browse/MDEV-37544 Related-Bug: #2121797 Change-Id: I5adcd1f2d5160410fb9ded8e7f967e9773434e35 Signed-off-by: Dmitriy Rabotyagov <dmitriy.rabotyagov@cleura.com>
This commit is contained in:
@@ -127,6 +127,17 @@ galera_wait_timeout: "{{ openstack_db_connection_recycle_time | default('600') }
|
||||
# to timeout
|
||||
galera_startup_timeout: 1800
|
||||
|
||||
## charset options
|
||||
galera_default_charset: utf8mb3
|
||||
galera_default_collation: general_ci
|
||||
# NOTE: Default collation set will be updated with defined above defaults
|
||||
galera_default_collation_set:
|
||||
utf8mb3: utf8mb3_uca1400_ai_ci
|
||||
utf8mb4: utf8mb4_uca1400_ai_ci
|
||||
ucs2: ucs2_uca1400_ai_ci
|
||||
utf16: utf16_uca1400_ai_ci
|
||||
utf32: utf32_uca1400_ai_ci
|
||||
|
||||
## innodb options
|
||||
galera_innodb_buffer_pool_size: 4096M
|
||||
galera_innodb_log_file_size: 1024M
|
||||
|
@@ -0,0 +1,11 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Added new variables to control MariaDB default charset and collation:
|
||||
|
||||
* galera_default_charset
|
||||
* galera_default_collation
|
||||
* galera_default_collation_set
|
||||
|
||||
Variable ``galera_default_collation_set`` is defined in my.cnf only for
|
||||
MariaDB versions >= 11.5.
|
@@ -17,16 +17,17 @@ socket = "{{ galera_var_run_socket }}"
|
||||
socket = "{{ galera_var_run_socket }}"
|
||||
nice = 0
|
||||
|
||||
|
||||
[mysql]
|
||||
default-character-set = utf8
|
||||
|
||||
default-character-set = {{ galera_default_charset }}
|
||||
|
||||
[mysqld]
|
||||
user = mysql
|
||||
collation-server = utf8_general_ci
|
||||
init-connect = 'SET NAMES utf8'
|
||||
character-set-server = utf8
|
||||
collation-server = {{ _galera_collation }}
|
||||
init-connect = 'SET NAMES {{ galera_default_charset }} COLLATE {{ _galera_collation }}'
|
||||
character-set-server = {{ galera_default_charset }}
|
||||
{% if galera_major_version is version('11.5', '>=') and galera_install_method == 'external_repo' %}
|
||||
character-set-collations = {{ _galera_collation_set.items() | map('join', '=') | join(',') }}
|
||||
{% endif %}
|
||||
datadir = {{ galera_data_dir }}
|
||||
tmpdir = {{ galera_tmp_dir }}
|
||||
{% for ignored_db in galera_ignore_db_dirs %}
|
||||
|
@@ -12,6 +12,10 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
_galera_collation: "{{ [galera_default_charset, galera_default_collation] | join('_') }}"
|
||||
_galera_collation_set: "{{ galera_default_collation_set | combine({galera_default_charset: _galera_collation}) }}"
|
||||
|
||||
galera_init_defaults:
|
||||
Service:
|
||||
LimitNOFILE: "{{ galera_file_limits }}"
|
||||
|
Reference in New Issue
Block a user