From 9bca94368a6968e83d3443ba536eb80cd87a8288 Mon Sep 17 00:00:00 2001 From: Tommy Reilly Date: Fri, 21 May 2021 14:40:46 +0000 Subject: [PATCH] sql: remove write to time.Local and use env var instead (#40336) Release note: none --- Makefile | 4 +++- build/variables.mk | 1 + pkg/sql/logictest/logic.go | 3 --- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 1d67d5f3bbe4..dc1a8712a08d 100644 --- a/Makefile +++ b/Makefile @@ -220,8 +220,10 @@ LDFLAGS ?= CGO_CFLAGS = $(filter-out -g%,$(CFLAGS)) CGO_CXXFLAGS = $(CXXFLAGS) CGO_LDFLAGS = $(filter-out -static,$(LDFLAGS)) +# certain time based fail if UTC isn't the default timezone +TZ="" -export CFLAGS CXXFLAGS LDFLAGS CGO_CFLAGS CGO_CXXFLAGS CGO_LDFLAGS +export CFLAGS CXXFLAGS LDFLAGS CGO_CFLAGS CGO_CXXFLAGS CGO_LDFLAGS TZ # We intentionally use LINKFLAGS instead of the more traditional LDFLAGS # because LDFLAGS has built-in semantics that don't make sense with the Go diff --git a/build/variables.mk b/build/variables.mk index 1f4ea56aca9b..224956e5059a 100644 --- a/build/variables.mk +++ b/build/variables.mk @@ -139,6 +139,7 @@ define VALID_VARS TESTTIMEOUT TSC TYPE + TZ UI_CCL_DLLS UI_CCL_MANIFESTS UI_JS_CCL diff --git a/pkg/sql/logictest/logic.go b/pkg/sql/logictest/logic.go index 95d4739332df..9d18661c31f2 100644 --- a/pkg/sql/logictest/logic.go +++ b/pkg/sql/logictest/logic.go @@ -3163,9 +3163,6 @@ func RunLogicTestWithDefaultConfig( globs = []string{*logictestdata} } - // Set time.Local to time.UTC to circumvent pq's timetz parsing flaw. - time.Local = time.UTC - // A new cluster is set up for each separate file in the test. var paths []string for _, g := range globs {