-
Notifications
You must be signed in to change notification settings - Fork 187
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
Force all usage of sql_last_value to be typed according to the settings #260
Conversation
Will rebase. |
sorry, i sniped |
Added three more tests to verify the jdbc_default_timezone behaviour when no tracking column is specified when a numeric column is specified when a timestamp column is specified
@guyboertje - yeah, |
@guyboertje - I am trying to manually test a scenario that fails with out this change, then works with this change. Could you help me to better understand exactly how to test this ? What I have done so far: Using MySQL
and the following config:
Tried different |
I will sent an email with a link to SFDC cases that describes the fault better. The original code for timezone support was committed in Dec 2015 when @yaauie very recently changed this in master to I did my investigations before the above change. However even with the above change in place Sequel does not perform the timezone adjustments correctly. This PR refactors to allow Sequel to do the TZ adjustments correctly while preserving Ry's intended fix. I hacked the new test at line 327 from the PR into master. The timestamps added to the DB reflects the Chicago timezone... This is what I see when I add print With Ry's change reverted.
NOTE: sub-seconds NOT preserved AND timestamp is UTC (+600) With Ry's change.
NOTE: sub-seconds IS preserved BUT timestamp is UTC (+600). With the PR:
NOTE: sub-seconds IS preserved BUT timestamp is 6 hours earlier than UTC. How to recreate with LS v5.5.2 (sub-seconds zeroed out): Add 1 record with a timestamp column (called say, Add 1 record with Delete the persisted sql last value and truncate the test table Add 1 record with Add 1 record with Try LS 6.2.1 (sub-seconds preserved, but same results) I think this no records vs duplicated records made it hard to track down and create a bug report. User can work around it by not specifying the jdbc_default_timezone, casting date/timestamps to string and using the date filter to adjust the time fields. |
The above should hold true when when not using a tracking column and sql_last_value is the time of run in UTC but the DB times are not UTC, i.e.: |
@guyboertje - thanks for the explanation, I think I get the changes here now. I confirmed that the timezone issue is fixed, but w/r/t the millisecond precision, it seems that the persisted datetime/time does indeed have the milliseconds, but when the For example the persisted timestamp is Is this just an artifact of sequel support and my testing (MySQL) ? Also, When Assuming This change fixes the conversion when sending the This change also refactors parts of the code for better readability and adds more tests. |
Answering my own question ... I dug into sequel a bit and found this magic is needed to enable fractional seconds on mysql 5.6.5+
The ms now show up
|
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.
Nice work @guyboertje !
Changes look good. The only suggestion I have is to beef up the commit message. Suggested wording is on #260 (comment)
EDIT:
Forgot the magic letters. LGTM
where did u add sequel_opts => { |
Added three more tests to verify the jdbc_default_timezone behaviour
when no tracking column is specified
when a numeric column is specified
when a timestamp column is specified
Fixes #140