Skip to content

NIFI-3076: Fixed handling of 'medium' unsigned integers in JdbcCommon#1254

Closed
mattyb149 wants to merge 1 commit intoapache:masterfrom
mattyb149:NIFI-3076
Closed

NIFI-3076: Fixed handling of 'medium' unsigned integers in JdbcCommon#1254
mattyb149 wants to merge 1 commit intoapache:masterfrom
mattyb149:NIFI-3076

Conversation

@mattyb149
Copy link
Copy Markdown
Contributor

I tested with MySQL ("MEDIUMINT" is where the original issue was found) and on PostgreSQL and Oracle, although I couldn't find types that would reproduce the issue for the latter two. Rather I tested on all 3 (and Derby in the unit tests) to make sure the additional logic doesn't break existing behavior with respect to (signed and unsigned) integers, and verified that the fix does indeed correctly process unsigned MEDIUMINT columns in MySQL.


case INTEGER:
if (meta.isSigned(i)) {
if (meta.isSigned(i) || (meta.getPrecision(i) > 0 && meta.getPrecision(i) <= MAX_DIGITS_IN_INT)) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if the meta.getPrecision(i) > 0 check should be >=, or if it is needed at all. I can't find a type on any of my databases that returns 0 (or negative) for precision for INTEGER types

Copy link
Copy Markdown
Contributor

@bbende bbende left a comment

Choose a reason for hiding this comment

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

Looks good, will merge to master

@asfgit asfgit closed this in ba51344 Nov 30, 2016
dstreev pushed a commit to dstreev/nifi-1 that referenced this pull request Dec 9, 2016
This closes apache#1254.

Signed-off-by: Bryan Bende <bbende@apache.org>
dstreev pushed a commit to dstreev/nifi-1 that referenced this pull request Dec 9, 2016
This closes apache#1254.

Signed-off-by: Bryan Bende <bbende@apache.org>
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.

2 participants