Bug #32582 Potential ODBC bug with returning date fields while using passthrough queries
Submitted: 21 Nov 2007 16:47 Modified: 23 Nov 2007 13:45
Reporter: Joe Parisi Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:3.51.22 OS:Any (date fields become garbled)
Assigned to: CPU Architecture:Any

[21 Nov 2007 16:47] Joe Parisi
Description:
I just updated MySQL ODBC driver from 3.51.21 to 3.51.22.
The following query worked fine in .21, but in .22 the results returned for the date are garbled.

How to repeat:
In a Microsoft Access (2007) database application, I use the following as a passthrough query into a MySQL (4.1.7) database:

SELECT DISTINCT (email), date_format(date, '%m/%d/%Y %H:%i') AS optout_date FROM `visitflorida`.`dialogue_unsubscribe`

The date field in the above query is a datetime field.
The ODBC Connect String for the passthrough query is working fine, as I am able to connect and get results back.
[21 Nov 2007 17:10] Susanne Ebrecht
Many thanks for writing a bug report.
Please, can you add the trace file.
[21 Nov 2007 19:08] Joe Parisi
trace file

Attachment: SQL.LOG (application/octet-stream, text), 15.72 KiB.

[23 Nov 2007 13:45] Susanne Ebrecht
Hi,

I tested this with MyODBC 3.51 and MyODBC 5.1 and I really can't reproduce it.

My table-statement:

create table email(email text, date datetime);
insert into email ('susanne@mysql.de', current_date); 
insert into email ('susanne@mysql.com', current_date - interval 1 day); 
insert into email ('susanne@mysql.com', current_date - interval 10 day);

I opened Access 2007 and wrote the sql statement:
select distinct (email), date_format(date, '%m/%d/%Y %H%i') as output_date from email;

Clicked to "pass through" and "run" and it works like the attached image show.
[23 Nov 2007 13:47] Susanne Ebrecht
screenshot

Attachment: bug32582.jpg (image/jpeg, text), 117.73 KiB.