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

Fixes "ResultSet.getTime() returns null" bug #1

Merged
merged 5 commits into from
Jan 3, 2023

Conversation

margarit-h
Copy link

@margarit-h margarit-h commented Dec 21, 2022

Signed-off-by: Margarit Hakobyan [email protected]

Description

ResultSet.getTime() returns non-null value reflecting the retrieved time instead of null.

Issues Resolved

opensearch-project#20

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@margarit-h margarit-h requested a review from a team December 21, 2022 22:14
Signed-off-by: Margarit Hakobyan <[email protected]>
@margarit-h margarit-h changed the title Fixes ResultSet.getTime() returns null bug Fixes 'ResultSet.getTime() returns null' bug Dec 21, 2022
@margarit-h margarit-h changed the title Fixes 'ResultSet.getTime() returns null' bug Fixes "ResultSet.getTime() returns null" bug Dec 21, 2022
Signed-off-by: Margarit Hakobyan <[email protected]>
if (value instanceof Time) {
return asTime((Time) value);
return (Time) value;
Copy link

Choose a reason for hiding this comment

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

Should the returned value here be converted to localtime similar to the case where value is a string?

Copy link
Author

Choose a reason for hiding this comment

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

I don't see what adding that extra step will accomplish in this case, so I return value as java.sql.Time when the value is of type java.sql.Time. In case of string, value needs to be checked and converted correctly, so LocalTime is used to do so.

Copy link

Choose a reason for hiding this comment

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

Gocha, thanks!

cal == null ? "null" : "Calendar TZ= " + cal.getTimeZone()));
checkCursorOperationPossible();
Time value = getTimeX(columnIndex, cal);
log.debug(() -> logExit("getTime", value));

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Addressed in b1f8e06 and b1de4b8

Signed-off-by: Margarit Hakobyan <[email protected]>
Signed-off-by: Margarit Hakobyan <[email protected]>
@margarit-h margarit-h merged commit ac0070e into integ-fix-resultset-get-time Jan 3, 2023
Yury-Fridlyand pushed a commit that referenced this pull request Jan 11, 2023
…ject#41)

* Fixes ResultSet.getTime returns null bug

Signed-off-by: Margarit Hakobyan <[email protected]>

Signed-off-by: Margarit Hakobyan <[email protected]>
@Yury-Fridlyand Yury-Fridlyand deleted the dev-fix-resultset-get-time branch February 1, 2023 03:34
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.

3 participants