[ODBC-82] Indicator buffer is set to SQL_NULL_DATA when date field has value '0000-00-00'. Created: 2017-01-30  Updated: 2018-11-04  Resolved: 2018-11-04

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: 2.0.13
Fix Version/s: N/A

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

Windows-64bit



 Description   

If we bind a date column with value '0000-00-00' (of aurora database via MariaDB ODBC driver) to SQL_C_TIMESTAMP in a data buffer, it populates the data buffer with correct value but incorrectly sets indicator buffer to SQL_NULL_DATA(-1). Same issue can be seen for all date data types datetime, timestamp, date and time.



 Comments   
Comment by Lawrin Novitsky [ 2017-02-23 ]

The reason here is that ODBC doesn't allow date 0000-00-00. Unlike all flavors of mysql server. You can look here here then or directly here. However, 00:00:00 is legitimate value for time type.

Comment by kriti suwalka [ 2017-03-13 ]

For time field also, same issue is observed.

Comment by Lawrin Novitsky [ 2017-03-13 ]

For time I have this fixed already.

Comment by kriti suwalka [ 2017-05-15 ]

In that case, could you please resolve the JIRA and let us know which version of driver will have this fix?

Comment by Lawrin Novitsky [ 2017-05-15 ]

2.0.14 has it (https://downloads.mariadb.com/Connectors/odbc/connector-odbc-2.0.14/)
I did not start separate issue for this. But looking in the release notes, this probably was done be in this revision:
"Revision #8c998ae 2017-03-01 01:00:22 +0100
Fixes and testcases more around ODBC-70 AND ODBC-83 - connector now checks if date/time are valid ODBC date/time, and returns errors, if they are not. Fixed bug in SQLSetStmtAttr - SQL_ATTR_ROW_OPERATION_PTR and SQL_ATTR_ROW_STATUS_PTR were setting fields in wrong descriptors. Fixed many things around row status, return code for rowset fetch."
I am not closing this issue since I want to decide what else should we do with 0000-00-00 date, if anything. Just not to forget about it.

Comment by Lawrin Novitsky [ 2018-11-04 ]

I think it's ok to close it by now

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