From 11e1172bac5091250cb80e958a30be0683b90c99 Mon Sep 17 00:00:00 2001 From: Ruslan Kamaldinov Date: Tue, 31 Jan 2017 16:43:47 +0400 Subject: [PATCH] Configure sql_mode options In order to get Gerrit working with Galera we need to modify sql_mode options. With default options following SQL query fails with "Invalid default value for 'added_on'": CREATE TABLE account_group_by_id_aud ( added_by INT DEFAULT 0 NOT NULL, removed_by INT, removed_on TIMESTAMP NULL DEFAULT NULL, group_id INT DEFAULT 0 NOT NULL, include_uuid VARCHAR(255) BINARY DEFAULT '' NOT NULL, added_on TIMESTAMP NOT NULL ,PRIMARY KEY(group_id,include_uuid,added_on) ) Change-Id: Ic44192712512bb824890285b27eb353e4a37f4f4 --- service/files/defaults.yaml | 1 + service/files/my.cnf.j2 | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/service/files/defaults.yaml b/service/files/defaults.yaml index 1af9da4..6deee0e 100644 --- a/service/files/defaults.yaml +++ b/service/files/defaults.yaml @@ -9,6 +9,7 @@ configs: xtrabackup_password: "password" monitor_password: "password" gcache_size: "1G" + sql_mode: null cluster_size: 3 force_bootstrap: enabled: false diff --git a/service/files/my.cnf.j2 b/service/files/my.cnf.j2 index 4dc5e4e..ebfc3ce 100644 --- a/service/files/my.cnf.j2 +++ b/service/files/my.cnf.j2 @@ -25,6 +25,10 @@ innodb_write_io_threads = 8 open_files_limit = 102400 +{% if percona.sql_mode %} +sql_mode = "{{ percona.sql_mode }}" +{% endif -%} + wsrep_slave_threads = 4 wsrep_cluster_address = gcomm:// wsrep_provider = /usr/lib/galera3/libgalera_smm.so