Skip to content

Commit

Permalink
pgcode: use XCR instead of CDB
Browse files Browse the repository at this point in the history
Release note (sql change): Change the pgerror code XCR instead of CDB
for CockroachDB specific errors. This is because the "C" class is
reserved for the SQL standard.
  • Loading branch information
otan committed Sep 17, 2021
1 parent 19b1766 commit 59f84d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/ccl/logictestccl/testdata/logic_test/as_of
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ SELECT * FROM t AS OF SYSTEM TIME with_max_staleness('1ms', false) WHERE i = 2
statement ok
SELECT * FROM t AS OF SYSTEM TIME with_min_timestamp(statement_timestamp() - '1ms', false) WHERE i = 2

statement error pgcode CDB00 bounded staleness read with minimum timestamp bound.*could not be satisfied by a local resolved timestamp
statement error pgcode XCR00 bounded staleness read with minimum timestamp bound.*could not be satisfied by a local resolved timestamp
SELECT * FROM t AS OF SYSTEM TIME with_max_staleness('1ms', true) WHERE i = 2

statement error pgcode CDB00 bounded staleness read with minimum timestamp bound.*could not be satisfied by a local resolved timestamp
statement error pgcode XCR00 bounded staleness read with minimum timestamp bound.*could not be satisfied by a local resolved timestamp
SELECT * FROM t AS OF SYSTEM TIME with_min_timestamp(statement_timestamp() - '1ms', true) WHERE i = 2

#
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/pgwire/pgcode/codes.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,10 @@ var (
// internally on a connection between different Cockroach nodes.
InternalConnectionFailure = MakeCode("58C01")

// Class CDB - cockroach extension.
// Class XCR - cockroach extension.
// CockroachDB distributed system related errors.

// UnsatisfiableBoundedStaleness signals that the bounded staleness query
// cannot be satisfied.
UnsatisfiableBoundedStaleness = MakeCode("CDB00")
UnsatisfiableBoundedStaleness = MakeCode("XCR00")
)

0 comments on commit 59f84d2

Please sign in to comment.