[ODBC-182] Wrong data inserted into TIME field if bound as TIMESTAMP, and date fields contain data Created: 2018-09-10  Updated: 2018-09-12  Resolved: 2018-09-12

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

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


 Description   

If parameter for inserting value into time field is bound like SQLBindParameter(Stmt, 1, SQL_PARAM_INPUT, SQL_C_TIMESTAMP, SQL_TIME,...), i.e. passed via timestamp structure, and date fields are not empty(it seems like day field is important), the inserted value will be different from the value in time fields of the parameter



 Comments   
Comment by Lawrin Novitsky [ 2018-09-12 ]

The fix and the testcase have been pushed into odbc-3.0 as 79efd0e
The patch also enforces some time validity checks for such parameters, as required by the specks. i.e. time should be between 00:00:00 and 23:59:59, and fractional part should be zero, and if timestamp struct bound for SQL_DATE sql type, then all time fields should be zero

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