[ODBC-70] SQL_C_TIMESTAMP to DATETIME columns stored '1970-01-01 00:00:00' for value '0000-00-00 00:00:00' Created: 2016-11-19  Updated: 2018-10-02  Resolved: 2018-10-02

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: 2.0.12
Fix Version/s: 3.0.7, 2.0.19

Type: Bug Priority: Major
Reporter: Rahul Dhuvad Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows 64-bit, Linux 64-bit



 Description   

If we bind parameter (to Aurora database via MariaDB ODBC driver) of C type SQL_C_TIMESTAMP to a DATETIME column in the table, we are seeing data loaded is '1970-01-01 00:00:00' for value '0000-00-00 00:00:00' in the SQL_TIMESTAMP_STRUCT.

Same if we try to insert in a TIMESTAMP column (instead of DATETIME) of the table, then value is stored properly as '0000-00-00 00:00:00'.

Also, instead of SQL_C_TIMESTAMP, if we bind as SQL_C_CHAR with same value to DATETIME column, then as well value is correctly stored as '0000-00-00 00:00:00'.



 Comments   
Comment by Lawrin Novitsky [ 2018-10-02 ]

I have push the last part related to this report - enforcing of constraints on date/time values in case if they passed as a string. The fix and testcase extension have been pushed into odbc-3.0 as bc32db6

Generated at Thu Feb 08 03:26:00 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.