-
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
sem/tree: fix LIKE ESCAPE when the pattern contains Unicode symbols #44633
Conversation
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @solongordon and @yuzefovich)
pkg/sql/sem/tree/testdata/eval/like, line 423 at r1 (raw file):
like_escape('a', '꧕', '�') ---- false
Would it be useful to add a positive test case here too?
Previously, we were incorrectly updating the pattern when the current character was Unicode symbol that had the width of more than a single byte. Release note (bug fix): Previously, running a query with LIKE operator using custom ESCAPE symbol when the pattern contained Unicode characters could result in an internal error in CockroachDB, and now this has been fixed.
24194b7
to
f25c845
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.
TFTR!
bors r+
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @solongordon)
pkg/sql/sem/tree/testdata/eval/like, line 423 at r1 (raw file):
Previously, solongordon (Solon) wrote…
Would it be useful to add a positive test case here too?
It can't hurt, done.
43047: client,kv: new savepoint API r=andreimatei a=knz This patch introduces the KV savepoint API as discussed in the savepoints RFC: ```go // CreateSavepoint establishes a savepoint. // This method is only valid when called on RootTxns. CreateSavepoint(context.Context) (SavepointToken, error) // RollbackToSavepoint rolls back to the given savepoint. The // savepoint must not have been rolled back or released already. // All savepoints "under" the savepoint being rolled back // are also rolled back and their token must not be used any more. // This method is only valid when called on RootTxns. RollbackToSavepoint(context.Context, SavepointToken) error // ReleaseSavepoint releases the given savepoint. The savepoint // must not have been rolled back or released already. // All savepoints "under" the savepoint being released // are also released and their token must not be used any more. // This method is only valid when called on RootTxns. ReleaseSavepoint(context.Context, SavepointToken) error ``` Ths initial implementation does not (yet) enable clients to roll back over errors. Release note: None 44626: workload/tpch: unskip query 12 r=yuzefovich a=yuzefovich Previously, query 12 was skipped because the results returned by lib/pq didn't match the expected output. The issue is that the driver returned []byte for decimals whereas we expected a string value and `fmt.Sprint` was giving us the ASCII codes of the digits instead of printing out the number. This is fixed by checking whether the returned value is []byte, and if so, converting it to string directly. Release note: None 44633: sem/tree: fix LIKE ESCAPE when the pattern contains Unicode symbols r=yuzefovich a=yuzefovich Previously, we were incorrectly updating the pattern when the current character was Unicode symbol that had the width of more than a single byte. Fixes: #44621. Release note (bug fix): Previously, running a query with LIKE operator using custom ESCAPE symbol when the pattern contained Unicode characters could result in an internal error in CockroachDB, and now this has been fixed. Co-authored-by: Raphael 'kena' Poss <knz@thaumogen.net> Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
Build succeeded |
Previously, we were incorrectly updating the pattern when the current
character was Unicode symbol that had the width of more than a single
byte.
Fixes: #44621.
Release note (bug fix): Previously, running a query with LIKE operator
using custom ESCAPE symbol when the pattern contained Unicode characters
could result in an internal error in CockroachDB, and now this has been
fixed.