From 3ae1d54a85d8e6e5a5d0cf55df66d1ba8957b3b8 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Mon, 6 Jan 2020 07:58:28 +1100 Subject: [PATCH] dev/core#1143 Fix Upgrade tests on MySQL 8 by quoting reserved words --- CRM/Upgrade/Incremental/sql/4.3.4.mysql.tpl | 4 ++-- CRM/Upgrade/Incremental/sql/4.7.10.mysql.tpl | 2 +- CRM/Upgrade/Incremental/sql/4.7.25.mysql.tpl | 2 +- CRM/Upgrade/Incremental/sql/4.7.beta1.mysql.tpl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CRM/Upgrade/Incremental/sql/4.3.4.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.4.mysql.tpl index d564c44fb7..4da5c51ee8 100644 --- a/CRM/Upgrade/Incremental/sql/4.3.4.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.3.4.mysql.tpl @@ -9,8 +9,8 @@ VALUES SELECT @option_group_id_csgOpt := max(id) FROM civicrm_option_group WHERE name = 'contact_smart_group_display'; INSERT INTO -civicrm_option_value (option_group_id, {localize field='label'}label{/localize}, value, name, grouping, filter, -is_default, weight) +civicrm_option_value (`option_group_id`, {localize field='label'}label{/localize}, `value`, `name`, `grouping`, `filter`, +`is_default`, `weight`) VALUES (@option_group_id_csgOpt, {localize}'Show Smart Groups on Demand'{/localize}, 1, 'showondemand', NULL, 0, 0, 1), (@option_group_id_csgOpt, {localize}'Always Show Smart Groups'{/localize}, 2, 'alwaysshow', NULL, 0, 0, 2), diff --git a/CRM/Upgrade/Incremental/sql/4.7.10.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.7.10.mysql.tpl index 52e04cca5f..fb4220c755 100644 --- a/CRM/Upgrade/Incremental/sql/4.7.10.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.7.10.mysql.tpl @@ -3,7 +3,7 @@ SELECT @option_group_id_report := max(id) from civicrm_option_group where name = SELECT @contributeCompId := max(id) FROM civicrm_component where name = 'CiviContribute'; SELECT @option_group_id_report_wt := MAX(weight) FROM civicrm_option_value WHERE option_group_id = @option_group_id_report; INSERT INTO - civicrm_option_value (option_group_id, {localize field='label'}label{/localize}, value, name, grouping, filter, is_default, weight, {localize field='description'}description{/localize}, is_optgroup, is_reserved, is_active, component_id, visibility_id) + civicrm_option_value (`option_group_id`, {localize field='label'}label{/localize}, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, {localize field='description'}description{/localize}, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`) VALUES (@option_group_id_report, {localize}'{ts escape="sql"}Deferred Revenue Details{/ts}'{/localize}, 'contribute/deferredrevenue', 'CRM_Report_Form_Contribute_DeferredRevenue', NULL, 0, NULL, @option_group_id_report_wt+1, {localize}'{ts escape="sql"}Deferred Revenue Details Report{/ts}'{/localize}, 0, 0, 1, @contributeCompId, NULL); diff --git a/CRM/Upgrade/Incremental/sql/4.7.25.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.7.25.mysql.tpl index 7bb3bcebaa..d6d7aba13b 100644 --- a/CRM/Upgrade/Incremental/sql/4.7.25.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.7.25.mysql.tpl @@ -8,7 +8,7 @@ INSERT INTO civicrm_option_group (name, {localize field='title'}title{/localize}, is_reserved, is_active) VALUES ('environment', {localize}'{ts escape="sql"}Environment{/ts}'{/localize}, 0, 1); SELECT @option_group_id_env := max(id) from civicrm_option_group where name = 'environment'; -INSERT INTO civicrm_option_value (option_group_id, {localize field='label'}label{/localize}, value, name, grouping, filter, is_default, weight, {localize field='description'}description{/localize}, is_optgroup, is_reserved, is_active, component_id, visibility_id) +INSERT INTO civicrm_option_value (`option_group_id`, {localize field='label'}label{/localize}, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, {localize field='description'}description{/localize}, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`) VALUES (@option_group_id_env, {localize}'{ts escape="sql"}Production{/ts}'{/localize}, 'Production', 'Production', NULL, 0, 1, 1, {localize}'{ts escape="sql"}Production Environment{/ts}'{/localize}, 0, 0, 1, NULL, NULL), (@option_group_id_env, {localize}'{ts escape="sql"}Staging{/ts}'{/localize}, 'Staging', 'Staging', NULL, 0, NULL, 2, {localize}'{ts escape="sql"}Staging Environment{/ts}'{/localize}, 0, 0, 1, NULL, NULL), diff --git a/CRM/Upgrade/Incremental/sql/4.7.beta1.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.7.beta1.mysql.tpl index 47843e9ecc..1f3d76106b 100644 --- a/CRM/Upgrade/Incremental/sql/4.7.beta1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.7.beta1.mysql.tpl @@ -4,7 +4,7 @@ SELECT @option_group_id_report := max(id) from civicrm_option_group where name = 'report_template'; SELECT @contributeCompId := max(id) FROM civicrm_component where name = 'CiviContribute'; INSERT INTO - civicrm_option_value (option_group_id, {localize field='label'}label{/localize}, value, name, grouping, filter, is_default, weight, {localize field='description'}description{/localize}, is_optgroup, is_reserved, is_active, component_id, visibility_id) + civicrm_option_value (`option_group_id`, {localize field='label'}label{/localize}, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, {localize field='description'}description{/localize}, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`) VALUES (@option_group_id_report, {localize}'{ts escape="sql"}Recurring Contributions Summary{/ts}'{/localize}, 'contribute/recursummary', 'CRM_Report_Form_Contribute_RecurSummary', NULL, 0, NULL, 49, {localize}'{ts escape="sql"}Provides simple summary for each payment instrument for which there are recurring contributions (e.g. Credit Card, Standing Order, Direct Debit etc.), showing within a given date range.{/ts}'{/localize}, 0, 0, 1, @contributeCompId, NULL); -- 2.25.1