NIFI-3076: Fixed handling of 'medium' unsigned integers in JdbcCommon#1254
Closed
mattyb149 wants to merge 1 commit intoapache:masterfrom
Closed
NIFI-3076: Fixed handling of 'medium' unsigned integers in JdbcCommon#1254mattyb149 wants to merge 1 commit intoapache:masterfrom
mattyb149 wants to merge 1 commit intoapache:masterfrom
Conversation
mattyb149
commented
Nov 21, 2016
|
|
||
| case INTEGER: | ||
| if (meta.isSigned(i)) { | ||
| if (meta.isSigned(i) || (meta.getPrecision(i) > 0 && meta.getPrecision(i) <= MAX_DIGITS_IN_INT)) { |
Contributor
Author
There was a problem hiding this comment.
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
bbende
approved these changes
Nov 30, 2016
Contributor
bbende
left a comment
There was a problem hiding this comment.
Looks good, will merge to master
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.