[MDEV-8234] CONNECT fails for TIMESTAMP Created: 2015-05-26 Updated: 2015-06-02 Resolved: 2015-05-30 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Connect |
| Affects Version/s: | 10.0.17 |
| Fix Version/s: | 10.0.20 |
| Type: | Bug | Priority: | Major |
| Reporter: | Takuya Aoki (Inactive) | Assignee: | Olivier Bertrand |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | connect-engine | ||
| Environment: |
CentOS release 6.5 (X86_64), PureData Release 7.0 (P-3) , NetezzaSQL ODBCDriver |
||
| Description |
|
I am trying to make a CONNECT table to a table on an IBM database. Below is the official manual describing netezza TIMESTAMP, it is a replacement for DATETIME in the other database. Since TIMESTAMP in MariaDB can hold only limited values, '1970-01-01 00:00:01' (UTC) to '2038-01-09 03:14:07' (UTC) I made a CONNECT table defining the column definition as DATETIME which supports values, '1000-01-01 00:00:00.000000' to '9999-12-31 23:59:59.999999' The problem I am getting is that when there is the value,
on the original table, I get the below from the CONNECT table.
The time difference from UTC in Japan is just 9 hours. When I created the CONNECT table making the column definition TIMESTAMP, it returned the below
This might make sense because the original value exceeds the limit for TIMESTAMP on MariaDB. |
| Comments |
| Comment by Olivier Bertrand [ 2015-05-28 ] | |||
|
Internally CONNECT handles all dates as timestamp. Dates not belonging to the timestamp limits should be handled as character strings. | |||
| Comment by Olivier Bertrand [ 2015-05-30 ] | |||
|
As a matter of facts, the time shift was wrongly applied to NULL dates. It is possible that fixing that might also apply to what you got with unsupported dates. | |||
| Comment by Takuya Aoki (Inactive) [ 2015-06-02 ] | |||
|
I didn't know about the below limitations of the DATE datatype. As you say, the time shift should only be applied to proper dates between the limits. https://mariadb.com/kb/en/mariadb/connect-data-types/#date-data-type
| |||
| Comment by Olivier Bertrand [ 2015-06-02 ] | |||
|
That is what the fix I made should do. Improper dates will be internally stored as zero. This value will be regarded as null or just the date 1970-01-01 depending on the delaration of the column (whether it is declared as NOT NULL or as DEFAULT NULL). This is what CONNECT does for all data types. | |||
| Comment by Takuya Aoki (Inactive) [ 2015-06-02 ] | |||
|
I see, I guess configuring the NULL option will fix the problem for both DATETIME and TIMESTAMP. |