-
Notifications
You must be signed in to change notification settings - Fork 55
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
Fix convert_tz function in Postgresql #91
Open
mesolaries
wants to merge
6
commits into
oroinc:master
Choose a base branch
from
mesolaries:patch-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
53c7ee9
Fix wrong parameter order
mesolaries 907dbc9
Update tests
mesolaries 3e4143a
Update PostgreSQL test
mesolaries 139fccf
Remove xx:xx timezone tests
mesolaries a376dcd
Update convert_tz.yml
mesolaries 31e7484
Update MySQL test
mesolaries File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, check
expectedResult
. Query changed but result is still the same.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t0_.created_at
is 2014-01-04 05:06:07. When converting from +00:00 to +01:00 expected result should be 2014-01-04 06:06:07There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have applied your changes and run tests. Here is an output:
You may check MySQL version of tests. DQL and expectedResult must be the same for MySQL and PostgreSQL and tests should pass.
Check .travis.yml for details on how to execute tests for this project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is in timezone confusion. AT TIME ZONE supports timezones in POSIX style
https://github.com/eggert/tz/blob/2018g/etcetera#L38-L44
I suggest to replace '+xx:00' type timezones to locality based timezone 'UTC', 'Europe/Kiev' for example.
Thus, the tests will be passed and less confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with such change in tests if these changes will be applied for both DBs and will show that translated SQL produces same results for a given DQL.
Is
+01:00
behaves differently for MySQL and PostgreSQL? If so CONVERT_TZ should have logic to prevent confusion (may be added as a separate issue)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, +01:00 behaves differently. I will add necessary tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, do not forget about DST and issues it may bring to tests in different periods of year