Skip to content

Commit

Permalink
sql: mark timezone(string, string) as VolatilityStable
Browse files Browse the repository at this point in the history
The `timezone(string, string)` function overload was incorrectly marked
as `VolatilityImmutable`. When the second argument a special string,
like 'now', 'today', 'tomorrow', or 'yesterday', the function is
non-immutable because those strings are cast to timestamps which are
dependent on the current clock time.

This commit correctly marks it as `VolatilityStable`.

Release note: None
  • Loading branch information
mgartner committed May 12, 2020
1 parent d630d85 commit 5266f74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/sql/sem/builtins/builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -2416,7 +2416,7 @@ may increase either contention or retry errors, or both.`,
return ts.EvalAtTimeZone(ctx, loc)
},
Info: "Convert given time stamp with time zone to the new time zone, with no time zone designation.",
Volatility: tree.VolatilityImmutable,
Volatility: tree.VolatilityStable,
},
tree.Overload{
Types: tree.ArgTypes{
Expand Down

0 comments on commit 5266f74

Please sign in to comment.