Skip to content
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

sql: unwrap in CastToCollatedString #39681

Merged
merged 1 commit into from Aug 21, 2019

Conversation

@vazrupe
Copy link
Contributor

vazrupe commented Aug 15, 2019

Unwarp once in CastToCollatedString.
In the assert message, type the output as is.

Fixes #38865

Release note: None

@vazrupe vazrupe requested a review from cockroachdb/sql-opt-prs as a code owner Aug 15, 2019
@cockroach-teamcity

This comment has been minimized.

Copy link
Member

cockroach-teamcity commented Aug 15, 2019

This change is Reviewable

@CLAassistant

This comment has been minimized.

Copy link

CLAassistant commented Aug 15, 2019

CLA assistant check
All committers have signed the CLA.

@justinj

This comment has been minimized.

Copy link
Member

justinj commented Aug 15, 2019

Hi @vazrupe,

Thanks for the contribution! Would you mind including a test case that illustrates the problem in #38865? Probably in pkg/sql/logictest/testdata/logic_test/collatedstring.

Unwarp once in CastToCollatedString.
In the assert message, type the output as is.

Fixes #38865

Release note: None
@vazrupe vazrupe force-pushed the vazrupe:unwrap-in-cast branch from 959037f to 1bf3f99 Aug 15, 2019
@vazrupe

This comment has been minimized.

Copy link
Contributor Author

vazrupe commented Aug 15, 2019

@justinj
Thanks for a good guide.

Added a test that corresponds to the fix. ISERROR () is omitted because it is not necessary for testing.

Each test corresponds to the following:

  1. unwrapped, DString (existing)

    query T
    SELECT 'A' COLLATE en
    ----
    A

  2. unwrapped, DCollatedString

query T
SELECT ('A' COLLATE de) COLLATE en
----
A
  1. wrapped, DString
query T
SELECT NAME 'A' COLLATE en
----
A
  1. wrapped, DCollatedString
query T
SELECT (NAME 'A' COLLATE de) COLLATE en
----
A

Thank you

@justinj

This comment has been minimized.

Copy link
Member

justinj commented Aug 21, 2019

Looks great—thanks for fixing this!

bors r+

craig bot pushed a commit that referenced this pull request Aug 21, 2019
39681: sql: unwrap in CastToCollatedString r=justinj a=vazrupe

Unwarp once in CastToCollatedString.
In the assert message, type the output as is.

Fixes #38865

Release note: None

Co-authored-by: HyeonGyu Lee (Vazrupe) <vazrupe@naver.com>
@craig

This comment has been minimized.

Copy link

craig bot commented Aug 21, 2019

Build succeeded

@craig craig bot merged commit 1bf3f99 into cockroachdb:master Aug 21, 2019
3 checks passed
3 checks passed
GitHub CI (Cockroach) TeamCity build finished
Details
bors Build succeeded
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.