-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
55071: sql: fix displaying second zone offsets r=rafiss a=otan For casting timestamptz->text, only display the second offset if there is one for timestamptz, to maintain compatibility with older versions. Otherwise, for other outputs (e.g. CLI, pgwire), always show the full zone offset including the seconds. Note the timezone zone offset doesn't actually fully appear in the CRDB CLI due to lib/pq, but will successfully display on postgresql connecting to CockroachDB. Resolves #54294. Release note (bug fix): Fix a bug where the seconds offset zone offset of a timestamptz was not displayed. Co-authored-by: Oliver Tan <[email protected]>
- Loading branch information
Showing
8 changed files
with
75 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
send | ||
Query {"String": "SET TIME ZONE \"America/Chicago\""} | ||
---- | ||
|
||
until | ||
ReadyForQuery | ||
---- | ||
{"Type":"ParameterStatus","Name":"TimeZone","Value":"America/Chicago"} | ||
{"Type":"CommandComplete","CommandTag":"SET"} | ||
{"Type":"ReadyForQuery","TxStatus":"I"} | ||
|
||
send | ||
Query {"String": "SELECT '1882-05-23T00:00:00-05:51'::\"timestamptz\""} | ||
---- | ||
|
||
until | ||
ReadyForQuery | ||
---- | ||
{"Type":"RowDescription","Fields":[{"Name":"timestamptz","TableOID":0,"TableAttributeNumber":0,"DataTypeOID":1184,"DataTypeSize":24,"TypeModifier":-1,"Format":0}]} | ||
{"Type":"DataRow","Values":[{"text":"1882-05-23 00:00:24-05:50:36"}]} | ||
{"Type":"CommandComplete","CommandTag":"SELECT 1"} | ||
{"Type":"ReadyForQuery","TxStatus":"I"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2020 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package timeutil | ||
|
||
// FullTimeFormat is the time format used to display any timestamp | ||
// with date, time and time zone data. | ||
const FullTimeFormat = "2006-01-02 15:04:05.999999-07:00:00" |