Skip to content

Commit

Permalink
sql/sem/tree: Add assertion against upgrading collation package
Browse files Browse the repository at this point in the history
Upgrading golang.org/x/text to a newere collate.CLDRVersion
will require a lot of work for compatibility (described in
issue #63738). Add an assertion to make sure such an upgrade
is not made accidentally.

Release note: None
  • Loading branch information
bdarnell committed Apr 15, 2021
1 parent bce4485 commit 036898f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/sql/sem/tree/collatedstring.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,14 @@

package tree

import "golang.org/x/text/collate"

// DefaultCollationTag is the "default" collation for strings.
const DefaultCollationTag = "default"

func init() {
if collate.CLDRVersion != "23" {
panic("This binary was built with an incompatible version of golang.org/x/text. " +
"See https://github.com/cockroachdb/cockroach/issues/63738 for details")
}
}

0 comments on commit 036898f

Please sign in to comment.