-
Notifications
You must be signed in to change notification settings - Fork 19
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
Discrepancies in retrieved data of type DATETIME on Oracle and MySQL DBMS #15
Comments
This issue is not specific to MySQL, this issue exists even while retrieving data from Oracle, in all cases, minutes is off by exactly 30 minutes i.e in retrieved data, minutes is exactly 30 minutes less than the expected time. Here is an output from Oracle
|
I was able to reproduce this issue on following configuration too: OS = Windows 10, 64 bit |
What is the timezone of the machine running the queries, and the machine with the server? |
TimeZone was IST (Indian Standard Time) in all the cases (Both Server and Client were on IST). |
Can you try this on the aws server? My guess is that this won't be problem for non half hour time zones. I will fix this later today, but this may not be a problem for non-IST timezone. |
Actually, unfortunately I cannot replicate this at all. Even after changing my timezone to IST. mysql> select * from emp ;
+---------------------+
| l |
+---------------------+
| 2003-10-27 07:55:28 |
| 2003-08-21 02:50:29 |
+---------------------+
2 rows in set (0.00 sec) julia> JDBC_retrieved = readtable(rs)
2x1 DataFrames.DataFrame
| Row | l |
|-----|---------------------|
| 1 | 2003-10-27T07:55:28 |
| 2 | 2003-08-21T02:50:29 | |
Sure, I tried this on 64 bit Windows 2008 R2 server (AWS), DBMS was Oracle 11g Express Edition On AWS server, I wasn't able to reproduce this error on IST, but I was able to reproduce this error on following timezones (For your convenience, timezones are listed as per Windows naming convention)
NOTE:- This is not an exhaustive list, there might be more timezones that are getting affected by this bug, these (Pacific and Mountain Time) were just the first two I came across on AWS server. UTC-07:00 Mountain Time (US & Canada)Please observe there is a one hour difference in the second retrieved value
UTC-08:00 Pacific Time (US & Canada)Please observe there is a one hour difference in the second retrieved value
|
We found a workaround for this issue over Oracle, if we convert the DateTime column to a String (in our query) and explicitly specify the format for conversion, we do get the expected values (As a String)
Whereas, if we don't specify anything while retrieval, we will have discrepancies in the retrieved value
|
Actually, I don't think this is a bug. (The 1/2 hour thing was a bug, but I can't replicate it at all). Alternatively, this is a more complex issue that I'd initially guessed. This is a consequence of DST and the fact that Java turns all dates into local times. Notice that In other words, we adjust for local time based on the current timezone offset, but not the historical timezone offset, which is depenedent on the DST database, which Java has, but Julia doesn't. |
What's the current resolution? Are we ok to ship what we have? Do we need to make a note of some of this stuff? |
I think we are ok to ship with what we have. |
JDBC.jl is retrieving incorrect data when it comes to following values, this issue can be reproduced using following statements
Please observe, the retrieved minutes is incorrect , I inserted 55 and 50 respectively , whereas when retrieved, I got 25 and 20.
Insert seems to have occurred correctly because when I cross checked in MySQL, I did found correct values.
Configuration
DBMS = MySQL version 5.7.9 (Community Server edition)
Julia version 0.4.1
OS = CentOS 7
JDBC.jl is upto date with the version on MetaData.jl
The text was updated successfully, but these errors were encountered: