Bug #25846 MyODBC does not recognize TIME (hh:mm:ss) and DATE (yy:mm:dd)
Submitted: 25 Jan 2007 13:52 Modified: 9 Mar 2007 11:25
Reporter: Bogdan Degtyariov Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:3.51.12 OS:Any (All OS)
Assigned to: Bogdan Degtyariov
Tags: date, SQLBindCol, SQLFetch, time

[25 Jan 2007 13:52] Bogdan Degtyariov
Description:
When return the result into the bound buffer MyODBC performs incorrect data transformation TIME->DATE. Actually it uses the string length as the indicator of the type and recognizes TIME (hh:mm:ss) as DATE (yy:mm:dd). Which may display unpredictable results.

How to repeat:
It can be recreated in Crystal Reports. Just try to retrieve a TIME field.
Will upload C test case later.

Suggested fix:
Make difference between ":" and "-" and treat them as TIME and DATE indicators accordingly.
[1 Mar 2007 21:01] Bogdan Degtyariov
Bugs #24867 and #25432 are duplicated by this bug
[2 Mar 2007 18:32] Bogdan Degtyariov
This bug has been fixed in MyODBC 3.51.14 (Next GA version of MyODBC)
[9 Mar 2007 11:25] MC Brown
An entry ahs been added to the 3.51.14 changelog.
[20 Jun 2007 23:20] André Lopes
the bug persist

i still getting back date/time values on time fields
[21 Jun 2007 11:03] Miguel Solorzano
Bogdan,

Could you please verify if this bug still exist or comment the exactly
version the fix will be present. See: http://bugs.mysql.com/bug.php?id=29255.
Thanks in advance.
[19 Dec 2007 14:21] Bogdan Degtyariov
Checked the bug with MyODBC 3.51.22. Works as expected.
The problem with Excel is that the bounding buffer for DATE and TIME columns is TIMESTAMP. If fill the buffer from the TIME column the TIMESTAMP variable will contain the following information "0000-00-00 HH:MM:SS". As ero dates are not allowed the date component is set to the current date. See the [c] section which corresponds to the case when time column is bound to TIMESTAMP buffer:

http://msdn2.microsoft.com/en-us/library/ms712436(VS.85).aspx

DATE result bound to TIMESTAMP result is ok. Time component can be 00:00:00 accordingly to MSDN specification:

http://msdn2.microsoft.com/en-us/library/ms712474(VS.85).aspx