From d7100c58200aaf1d538156ace533585d4fda473b Mon Sep 17 00:00:00 2001 From: Oliver Tan Date: Tue, 31 Aug 2021 16:42:24 +1000 Subject: [PATCH] builtins: block gateway_region from DistSQL It is not safe to execute this in DistSQL as we always want the region of the gateway to be the return value here. Release justification: safety change Release note: None --- pkg/sql/sem/builtins/builtins.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/sql/sem/builtins/builtins.go b/pkg/sql/sem/builtins/builtins.go index 723484d6ffd4..44febd8ad0c8 100644 --- a/pkg/sql/sem/builtins/builtins.go +++ b/pkg/sql/sem/builtins/builtins.go @@ -5751,7 +5751,11 @@ value if you rely on the HLC for accuracy.`, ), GatewayRegionBuiltinName: makeBuiltin( - tree.FunctionProperties{Category: categoryMultiRegion}, + tree.FunctionProperties{ + Category: categoryMultiRegion, + // We should always evaluate this built-in at the gateway. + DistsqlBlocklist: true, + }, tree.Overload{ Types: tree.ArgTypes{}, ReturnType: tree.FixedReturnType(types.String),