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

Invalid timestamp errors with RDB$TIME_ZONE_UTIL.TRANSITIONS [CORE6281] #6523

Closed
firebird-issue-importer opened this issue Apr 12, 2020 · 4 comments

Comments

@firebird-issue-importer

Submitted by: @asfernandes

The way ticks are internaly calculated from timestamps causes problems with RDB$TIME_ZONE_UTIL.TRANSITIONS, as well possible (but unlikely) problems with timers.

Test case:
select * from RDB$TIME_ZONE_UTIL.TRANSITIONS('Asia/Calcutta', date '0001-01-01', date '9999-01-01');

The problem is that old timestamps ticks are negative and the time field is unsigned. When a negative field is used with % operator it produces negative result that is stored in time. In ExprNodes.cpp that is somewhat workarounded, but the code is also weird.

Timers are unlikely to be affected because from this moment to the future the current_timestamp is positive, but if clock is reverted it may be problematic.

Commits: 471cc13

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 12, 2020

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 12, 2020

Modified by: @asfernandes

Component: Engine [ 10000 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 14, 2020

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 2 [ 10888 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 15, 2020

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants