-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
handle InvalidCodePointException and add a testcase #7734
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to [email protected]. For more information, see https://github.com/trinodb/cla. |
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to [email protected]. For more information, see https://github.com/trinodb/cla. |
3 similar comments
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to [email protected]. For more information, see https://github.com/trinodb/cla. |
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to [email protected]. For more information, see https://github.com/trinodb/cla. |
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to [email protected]. For more information, see https://github.com/trinodb/cla. |
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.
Looks good.
Please rewrite commit message to something like "Handle InvalidCodePointException in CharacterStringCasts". No need to specify that tests are added.
@@ -67,6 +67,12 @@ public void testVarcharToCharSaturatedFloorCast() | |||
String maxCodePoint = new String(Character.toChars(Character.MAX_CODE_POINT)); | |||
String codePointBeforeSpace = new String(Character.toChars(' ' - 1)); | |||
|
|||
// Keep decreasing until valid again |
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.
That comment seems unnecessary. The test is pretty straightforward
* Since the codePoint is originally valid, so the only case will be 0XE00 - 1 | ||
* So we let it go through this range and become 0xD7FF | ||
*/ | ||
if (lastCodePoint == 0xDFFF) { |
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.
Use Character.MIN_SURROGATE
and Character.MAX_SURROGATE
constants
codePoints.set(codePoints.size() - 1, codePoints.get(codePoints.size() - 1) - 1); | ||
int lastCodePoint = codePoints.get(codePoints.size() - 1) - 1; | ||
/* | ||
* UTF-8 reserve codepoint from 0xD800 to 0xDFFF for encoding UTF-16 |
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.
codepoint -> codepoints
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.
ok, I will fix it later
@JoJoBizarreAdventure please sign cla form |
LGTM overall % @skrzypo987 's comments. Would be good to update the commit message. Maybe
|
Ok, I will squash the commit and update the commit message later |
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to [email protected]. For more information, see https://github.com/trinodb/cla. |
1 similar comment
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to [email protected]. For more information, see https://github.com/trinodb/cla. |
I have updated the commit and changed the commit message. |
I'd leave the test case as it is. |
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.
Please fill out the CLA, and send a photo/scan to [email protected]. Without that we are unable to merge the PR.
I have sent one these days and waiting for reply now. |
I have sent a CLA request but the recent commit doesn't add me to the contributors. Shall I send it again? In usual case how long will the response take? |
@cla-bot check |
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to [email protected]. For more information, see https://github.com/trinodb/cla. |
The cla-bot has been summoned, and re-checked this pull request! |
@JoJoBizarreAdventure, can you try re-sending your CLA? We never received it. |
Ok,I will re-sending one with gmail, maybe changing the email will work. |
|
@cla-bot check |
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to [email protected]. For more information, see https://github.com/trinodb/cla. |
The cla-bot has been summoned, and re-checked this pull request! |
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
I have cla-signed now, please check. |
core/trino-main/src/main/java/io/trino/operator/scalar/CharacterStringCasts.java
Show resolved
Hide resolved
All checks pass now, it seems my work is done. |
@martint - do we want a release note for this? |
Inherit changes in https://github.com/trinodb/trino/pull/7731/commits
Merge all changes and testcase in one file
handling this issue #7597
fixes #7597