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

importccl: upgrade int size when converting unsigned to signed #32481

Merged
merged 1 commit into from Nov 19, 2018

Conversation

Projects
None yet
3 participants
@dt
Copy link
Member

dt commented Nov 19, 2018

When converting mysql schemas to cockroach schemas, we convert unsigned ints to signed.
However a user using the full range of an unsigned 32 bit int may then be surprised when values > 2^31 are rejected.
To aviod this, when converting uint2 or uint3 to signed version, bump them up to int4 and int8 respectively.

Fixes #32150.

Release note (sql change): IMPORT uses larger integers sizes when converting unsigned mysql integer columns to their signed cockroach counterparts.

@dt dt requested a review from knz Nov 19, 2018

@dt dt requested a review from cockroachdb/sql-bulk-prs as a code owner Nov 19, 2018

@cockroach-teamcity

This comment has been minimized.

Copy link
Member

cockroach-teamcity commented Nov 19, 2018

This change is Reviewable

@dt dt requested a review from mjibson Nov 19, 2018

@mjibson

This comment has been minimized.

Copy link
Member

mjibson commented Nov 19, 2018

LGTM but I'd appreciate a test to make sure we don't regress.

importccl: upgrade int size when converting unsigned to signed
When converting mysql schemas to cockroach schemas, we convert unsigned ints to signed.
However a user using the full range of an unsigned 32 bit int may then be surprised when values > 2^31 are rejected.
To aviod this, when converting uint2 or uint3 to signed version, bump them up to int4 and int8 respectively.

Release note (sql change): IMPORT uses larger integers sizes when converting unsigned mysql integer columns to their signed cockroach counterparts.

@dt dt force-pushed the dt:mysql-uint branch from 7db41e3 to 5ef39a5 Nov 19, 2018

@dt

This comment has been minimized.

Copy link
Member

dt commented Nov 19, 2018

Done.

@dt

This comment has been minimized.

Copy link
Member

dt commented Nov 19, 2018

bors r+

craig bot pushed a commit that referenced this pull request Nov 19, 2018

Merge #32481
32481: importccl: upgrade int size when converting unsigned to signed r=dt a=dt

When converting mysql schemas to cockroach schemas, we convert unsigned ints to signed.
However a user using the full range of an unsigned 32 bit int may then be surprised when values > 2^31 are rejected.
To aviod this, when converting uint2 or uint3 to signed version, bump them up to int4 and int8 respectively.

Fixes #32150.

Release note (sql change): IMPORT uses larger integers sizes when converting unsigned mysql integer columns to their signed cockroach counterparts.

Co-authored-by: David Taylor <tinystatemachine@gmail.com>
@craig

This comment has been minimized.

Copy link

craig bot commented Nov 19, 2018

Build succeeded

@craig craig bot merged commit 5ef39a5 into cockroachdb:master Nov 19, 2018

3 checks passed

GitHub CI (Cockroach) TeamCity build finished
Details
bors Build succeeded
Details
license/cla Contributor License Agreement is signed.
Details

@dt dt deleted the dt:mysql-uint branch Nov 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment