From de4e510a0e2085279fae57fadcb9d4f0164a7789 Mon Sep 17 00:00:00 2001 From: Rafi Shamim Date: Fri, 13 Nov 2020 13:51:37 -0500 Subject: [PATCH] sql: handle bool values for compat-only session vars Release note (bug fix): Some boolean session variables would only accept string ("true" or "false") values. Now they accept unquoted true or false values too. --- pkg/sql/logictest/testdata/logic_test/set | 9 +++++++++ pkg/sql/vars.go | 1 + 2 files changed, 10 insertions(+) diff --git a/pkg/sql/logictest/testdata/logic_test/set b/pkg/sql/logictest/testdata/logic_test/set index 2dd650731bf5..f0f53699de22 100644 --- a/pkg/sql/logictest/testdata/logic_test/set +++ b/pkg/sql/logictest/testdata/logic_test/set @@ -424,3 +424,12 @@ SET TRANSACTION DEFERRABLE statement ok rollback + +statement ok +SET standard_conforming_strings=true + +statement ok +SET standard_conforming_strings='true' + +statement ok +SET standard_conforming_strings='on' diff --git a/pkg/sql/vars.go b/pkg/sql/vars.go index 9695b93a9f6f..2c3f86deb20e 100644 --- a/pkg/sql/vars.go +++ b/pkg/sql/vars.go @@ -1234,6 +1234,7 @@ func makeCompatBoolVar(varName string, displayValue, anyValAllowed bool) session return err }, GlobalDefault: func(sv *settings.Values) string { return displayValStr }, + GetStringVal: makePostgresBoolGetStringValFn(varName), } }