Bug #28374 Reading default timestamp data (all zeros) causes E_FAIL if field is NOT NULL
Submitted: 11 May 2007 10:37 Modified: 23 Nov 2007 10:56
Reporter: Jos de Bruin Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:3.51.14 OS:Windows
Assigned to: CPU Architecture:Any

[11 May 2007 10:37] Jos de Bruin
Description:
Reading default timestamp data (all zeros) in a VB6 application (using ADO 2.8) causes E_FAIL if field is defined as NOT NULL

This issue has been reported before (#24163, #13001, #11525 among others) and has not yet been solved as far as I can tell. Thought I share my work-around, which may also shed some light on the cause.

How to repeat:
What happens is that simply retrieving records to an VBA/VB6 app (SELECT * FROM table) returns an E_FAIL status when the table has multiple TIMESTAMP fields (of which only one with the ON UPDATE CURRENT_TIMESTAMP attribute) and contains records in which the other TIMESTAMP fields (those without this attribute) contain the (MySQL standard) default values (i.e. all zeros: 0000-00-00 00:00:00). 

Suggested fix:

By simply allowing these fields to accept NULL values, this error no longer occurs.
[11 May 2007 12:58] Tonci Grgin
Hi Jos and thanks for your report. I will need following attached to this report:
 - Complete VB test case with DDL statements
 - my.ini / my.cnf from your server

When you attach these files, please change status back to "Open".
[11 Jun 2007 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[23 Nov 2007 10:56] Tonci Grgin
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at

  http://www.mysql.com/downloads/

Explanation: This problem is not repeatable as described in Bug#13001 (see attached test case there). If there is, by any chance, still a problem, then it's VB6 related, not MyODBC.