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: null array element in cast is null #28860

Merged
merged 1 commit into from
Aug 20, 2018

Conversation

justinj
Copy link
Contributor

@justinj justinj commented Aug 20, 2018

Prior, ARRAY[NULL]::STRING[] would be ARRAY['NULL'], rather than
ARRAY[NULL]. This was because the evaluation of a CastExpr prior would
handle nulls by itself and so the extra case in the switch statement
went unnoticed.

Release note (bug fix): Casting arrays now correctly preserves NULL
values.

@justinj justinj requested review from knz and a team August 20, 2018 20:13
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: nice find! 💯

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)

@justinj
Copy link
Contributor Author

justinj commented Aug 20, 2018

TFTR!

bors r+

@justinj
Copy link
Contributor Author

justinj commented Aug 20, 2018

bors r-

need to update some tests

@craig
Copy link
Contributor

craig bot commented Aug 20, 2018

Canceled

Prior, `ARRAY[NULL]::STRING[]` would be `ARRAY['NULL']`, rather than
`ARRAY[NULL]`. This was because the evaluation of a CastExpr prior would
handle nulls by itself and so the extra case in the switch statement
went unnoticed.

Release note (bug fix): Casting arrays now correctly preserves NULL
values.
@justinj
Copy link
Contributor Author

justinj commented Aug 20, 2018

bors r+

craig bot pushed a commit that referenced this pull request Aug 20, 2018
28860: sql: null array element in cast is null r=justinj a=justinj

Prior, `ARRAY[NULL]::STRING[]` would be `ARRAY['NULL']`, rather than
`ARRAY[NULL]`. This was because the evaluation of a CastExpr prior would
handle nulls by itself and so the extra case in the switch statement
went unnoticed.

Release note (bug fix): Casting arrays now correctly preserves NULL
values.

Co-authored-by: Justin Jaffray <justin@cockroachlabs.com>
@craig
Copy link
Contributor

craig bot commented Aug 20, 2018

Build succeeded

@craig craig bot merged commit 554a34c into cockroachdb:master Aug 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants