Skip to content

Removed useless check#2129

Merged
tkyc merged 1 commit intomainfrom
issue#2124
May 18, 2023
Merged

Removed useless check#2129
tkyc merged 1 commit intomainfrom
issue#2124

Conversation

@tkyc
Copy link
Copy Markdown
Contributor

@tkyc tkyc commented May 17, 2023

@Jeffery-Wasty
Copy link
Copy Markdown
Contributor

Jeffery-Wasty commented May 17, 2023

Since ticksSinceMidnight is now only used in one place, can we skip defining a variable? Does SonarQube complain about this? If this suggestion too ugly, we can keep it as you already have it:

        case DATETIME:
            if (8 != decryptedValue.length) {
                MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_NormalizationErrorAE"));
                throw new SQLServerException(form.format(new Object[] {baseSSType}), null, 0, null);
            }

            // SQL datetime is 4 bytes for days since SQL Base Date
            // (January 1, 1900 00:00:00 GMT) and 4 bytes for
            // the number of three hundredths (1/300) of a second since midnight.
            return DDC.convertTemporalToObject(jdbcType, SSType.DATETIME, cal, Util.readInt(decryptedValue, 0),
                    (Util.readInt(decryptedValue, 4) * 10L + 1) / 3, 0);

@tkyc
Copy link
Copy Markdown
Contributor Author

tkyc commented May 17, 2023

Looks like it passed sonarqube. I'm ok with just leaving it as is.

@lilgreenbird lilgreenbird added this to the 12.3.1 milestone May 18, 2023
@lilgreenbird lilgreenbird linked an issue May 18, 2023 that may be closed by this pull request
@tkyc tkyc merged commit 8cc5805 into main May 18, 2023
@tkyc tkyc deleted the issue#2124 branch May 18, 2023 20:09
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.

Faulty DATETIME ticksSinceMidnight overflow check

3 participants