-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
collatedstring: support default, C, and POSIX in expressions #96828
Conversation
Move the small amount of code from tree/collatedstring.go Release note: None
095263e
to
4bdb998
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two broader questions:
- does
pg_catalog.pg_collation
need an update? - should we add a linter that prevents usage of
collate.Supported()
? can usecockroach/pkg/testutils/lint/lint_test.go
Line 729 in 1b79102
t.Run("TestTimeutil", func(t *testing.T) {
// modified. | ||
const PosixCollationTag = "POSIX" | ||
|
||
var supportedTagNames []string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use language.Tag
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, maybe we can't because language.Tag
has metadata in it. oh well!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i had tried to get it to work with Tag
, but it can't. there's no way to even make a "custom" Tag
.
4bdb998
to
b8a80ca
Compare
that's done as part of this
added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah the logic tests only mention information_schema.collations
. i can see the code tho - feel free to add the test if you feel it's worth.
Release note (sql change): Expressions of the form `COLLATE "default"`, `COLLATE "C"`, and `COLLATE "POSIX"` are now supported. Since the default collation cannot be changed currently, these expressions are all equivalent. The expressions are evaluated by treating the input as a normal string, and ignoring the collation. This means that comparisons between strings and collated strings that use "default", "C", or "POSIX" are now supported. Creating a column with the "C" or "POSIX" collations is still not supported.
b8a80ca
to
a7e9c4a
Compare
tftr! bors r=otan |
Build failed (retrying...): |
Build succeeded: |
fixes #50734
fixes #95667
informs #57255
collatedstring: create new package
Move the small amount of code from tree/collatedstring.go
collatedstring: support C and POSIX in expressions
Release note (sql change): Expressions of the form
COLLATE "default"
,COLLATE "C"
, andCOLLATE "POSIX"
are now supported. Since thedefault collation cannot be changed currently, these expressions are all
equivalent. The expressions are evaluated by treating the input as a
normal string, and ignoring the collation.
This means that comparisons between strings and collated strings that
use "default", "C", or "POSIX" are now supported.
Creating a column with the "C" or "POSIX" collations is still not
supported.