From eab38b96697cdd102963493ebeef222609d2e48d Mon Sep 17 00:00:00 2001 From: Gabriel PREDA Date: Wed, 10 Jan 2024 11:32:20 +0200 Subject: [PATCH] skip query cache if it's not set, remove references where it is set to 0 --- templates/etc/my.cnf.d/server.cnf.j2 | 2 -- templates/etc/my.cnf.d/server.cnf.temp.j2 | 2 -- templates/etc/mysql/conf.d/galera.cnf.j2 | 2 -- templates/etc/mysql/conf.d/galera.cnf.temp.j2 | 2 -- templates/etc/mysql/my.cnf.j2 | 4 ++++ 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/templates/etc/my.cnf.d/server.cnf.j2 b/templates/etc/my.cnf.d/server.cnf.j2 index 686ddde..fd83374 100644 --- a/templates/etc/my.cnf.d/server.cnf.j2 +++ b/templates/etc/my.cnf.d/server.cnf.j2 @@ -2,8 +2,6 @@ binlog_format=ROW default_storage_engine=InnoDB innodb_autoinc_lock_mode=2 -query_cache_size=0 -query_cache_type=0 # # Allow server to accept connections on this interface diff --git a/templates/etc/my.cnf.d/server.cnf.temp.j2 b/templates/etc/my.cnf.d/server.cnf.temp.j2 index ac02234..a3658d5 100644 --- a/templates/etc/my.cnf.d/server.cnf.temp.j2 +++ b/templates/etc/my.cnf.d/server.cnf.temp.j2 @@ -2,8 +2,6 @@ binlog_format=ROW default_storage_engine=InnoDB innodb_autoinc_lock_mode=2 -query_cache_size=0 -query_cache_type=0 # # Allow server to accept connections on this interface diff --git a/templates/etc/mysql/conf.d/galera.cnf.j2 b/templates/etc/mysql/conf.d/galera.cnf.j2 index 686ddde..fd83374 100644 --- a/templates/etc/mysql/conf.d/galera.cnf.j2 +++ b/templates/etc/mysql/conf.d/galera.cnf.j2 @@ -2,8 +2,6 @@ binlog_format=ROW default_storage_engine=InnoDB innodb_autoinc_lock_mode=2 -query_cache_size=0 -query_cache_type=0 # # Allow server to accept connections on this interface diff --git a/templates/etc/mysql/conf.d/galera.cnf.temp.j2 b/templates/etc/mysql/conf.d/galera.cnf.temp.j2 index 879b41a..6dfaecb 100644 --- a/templates/etc/mysql/conf.d/galera.cnf.temp.j2 +++ b/templates/etc/mysql/conf.d/galera.cnf.temp.j2 @@ -2,8 +2,6 @@ binlog_format=ROW default_storage_engine=InnoDB innodb_autoinc_lock_mode=2 -query_cache_size=0 -query_cache_type=0 # # Allow server to accept connections on this interface diff --git a/templates/etc/mysql/my.cnf.j2 b/templates/etc/mysql/my.cnf.j2 index 1adba98..44c3360 100644 --- a/templates/etc/mysql/my.cnf.j2 +++ b/templates/etc/mysql/my.cnf.j2 @@ -18,8 +18,12 @@ max_allowed_packet = {{ mariadb_mysql_settings['max_allowed_packet'] }} max_binlog_size = {{ mariadb_mysql_settings['max_binlog_size'] }} myisam-recover = BACKUP port = {{ mariadb_mysql_port }} +{% if mariadb_mysql_settings['query_cache_limit'] is defined -%} query_cache_limit = {{ mariadb_mysql_settings['query_cache_limit'] }} +{%- endif %} +{% if mariadb_mysql_settings['query_cache_size'] is defined -%} query_cache_size = {{ mariadb_mysql_settings['query_cache_size'] }} +{%- endif %} skip-external-locking socket = {{ mariadb_login_unix_socket }} thread_cache_size = {{ mariadb_mysql_settings['thread_cache_size'] }}