Surgical port of core logic improvements: Date, DSQL, and Sort#8978
Open
laBobberto wants to merge 1 commit intoFirebirdSQL:masterfrom
Open
Surgical port of core logic improvements: Date, DSQL, and Sort#8978laBobberto wants to merge 1 commit intoFirebirdSQL:masterfrom
laBobberto wants to merge 1 commit intoFirebirdSQL:masterfrom
Conversation
61e555a to
8cea0c0
Compare
Member
Do you say that current algorithm is not accurate or doesn't comply with ISO 8601 standard ?
What exactly it optimizes ?
Why block indentation of lines 493-532 is wrong (at least on github view) ? |
AlexPeshkoff
reviewed
Apr 3, 2026
| int yearNumber, weekNumber; | ||
|
|
||
| if ((dayOfYearNumber <= (8 - jan1Weekday)) && (jan1Weekday > 4)) | ||
| if ((dayOfYear <= (8 - jan1Weekday)) & (jan1Weekday > 4)) |
Member
There was a problem hiding this comment.
Changing logical && to bitwise & here is plain bug.
AlexPeshkoff
reviewed
Apr 3, 2026
| weekNumber = ((jan1Weekday == 5) || ((jan1Weekday == 6) && | ||
| isLeapYear(yearNumber))) ? 53 : 52; | ||
| const int prevYearLeap = (!(y_1 % 4) && ((y_1 % 100) || !(y_1 % 400))); | ||
| const int is53 = (jan1Weekday == 5) | ((jan1Weekday == 6) & prevYearLeap); |
Member
There was a problem hiding this comment.
Are you sure that operator | always returns 1 (assigned to int is53), not for example -1?
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.
This PR is part of the closed parent PR #8938, which has been split into smaller, more targeted merge requests.
The PR includes: