Bug #3355 MyODBC 3.51 updating TIME fields of 1:00:00 or less
Submitted: 31 Mar 2004 23:59 Modified: 31 May 2013 6:48
Reporter: Antonino Quartararo Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:3.51 OS:Windows (Windows 2000/XP/NT)
Assigned to: Bogdan Degtyariov CPU Architecture:Any

[31 Mar 2004 23:59] Antonino Quartararo
Description:
Using MyODBC 3.51 and MySQL Server 4.1.1 and InnoDB tables.
Running application written in the "Clarion" programming language I find that for any TIME fields entered with a value of one hour (1:00:00) or less an insert/update error is generated. The error relates to MySQL trying to store 1:00:00 as 100:00:00.

This also happens with times of less than one hour, e.g. 0:34 (34 minutes) gives the error that it cannot store 34:00:00.

All times more than one hour ( 1:01 and above) are stored correctly and no error is generated by MySQL. 

Using MyODBC 2.50 does not produce the above error and works correctly.

How to repeat:
Run any Clarion application that stores time fields.

Suggested fix:
Make the behaviour of MyODBC 3.51 the same as MyODBC 2.50
[13 Apr 2004 20:16] MySQL Verification Team
I don't have Clarion so I tested MyODBC with a generic tool
for to query ODBC driver and I wasn't able for to get the
error reported:

	Full Connect(Default)

	Env. Attr. SQL_ATTR_ODBC_VERSION set to SQL_OV_ODBC3

	Successfully connected to DSN 'myodbc3-test'.
SQLExecDirect:
				In:				hstmt = 0x00991930, 
										szSqlStr = "insert into testtime values ("00:34:00")", cbSqlStr = -3
				Return:	SQL_SUCCESS=0
SQLExecDirect:
				In:				hstmt = 0x00991930, szSqlStr = "select * from testtime", 
										cbSqlStr = -3
				Return:	SQL_SUCCESS=0

Get Data All:
"mytime"
00:34:00
1 row fetched from 1 column.

Then my question is: are you debugged how it is sends the query
for the MyODBC driver ? Is there a way you can format it like
above ?
[13 Apr 2004 23:04] Antonino Quartararo
I had also tested in a similar manner to you and executing a direct SQL statement with the time in double (or single) quotes updates correctly.
Initially I thought the problem must be with the ODBC interface in Clarion and approached the newgroups etc. but could not get any answers.
I coded around the problem last December until for some reason I decided to try MyODBC 2.50 and using the same application the problem disappeared. 
It was then I decided to report as a bug to you. There must be some subtle difference between MyODBC 3.51 and MyODBC 2.50 that the Clarion ODBC is hitting.
If you wish I can write a small self-contained application in Clarion that you can run yourself.

Thanks
A.Q.
[23 Apr 2004 22:19] Antonino Quartararo
Please let me know if you are waiting for more information from me.

Do you wish me to send you an exe that allows you to test the problem?
[2 May 2004 14:10] Antonino Quartararo
I have downloaded MyODBC version 3.51.07 to test this bug.
This has made the problem worse. Let me explain:

1. Using version 2.50 of MyODBC the time fields that I process through my 
   applications (written in Clarion 5.5) using the languages own constructs
   and not a directly generated SQL command work as they should, i.e. the
   times I enter are the times that are recorded and are read back properly.

2. Using version 3.51.06 of MyODBC the time fields I enter on the same 
   applications above works except for times of 1:00 or less (as described
   in this original bug report)

3. Using version 3.51.07 of MyODB the time fields are not even visible when 
   I read back the records into my appication. E.g I enter a time of 12:34 into
   a time field, write the record to the database, read the record back and 
   the time field displays as a blank.

The application I used in all 3 tests above is the same EXE file, only changing
the DSN connection when connecting to the MySQL database.
[2 Jul 2004 0:44] Timothy Smith
Hi.  Can you please do this:

Rename myodbc3.dll to myodbc3_save.dll, and rename myodbc3d.dll to myodbc3.dll.  This will make you use the debugging version of myodbc.

Then, in your data sources manager, configure your myodbc DSN.  Press "Options >>", and select both of the checkboxes at the bottom for debugging.  (generate a trace file, and log sql commands).

Then, run your simple test program that demonstrates the problem.

Upload the source for the test, and the two log files, to this issue.

Thanks!

Timothy
[9 Nov 2006 11:09] Javier Diaz Diaz
Hi

I'm using C++Builder 6.0 and MysqlODBC 3.51 and I having exactly the same problem. The time 00:01 is being converted to 100:00 and of course I'm getting an error. If you try 00:02, 00:03, etc, then the actual value being inserted on the db is 02:00, 03:00, etc.

If there is any solution you could recommend me, I will really appreciate it.

Thx
Javier
[9 Nov 2006 22:08] Antonino Quartararo
My solution was to use MyODBC 2.50.39 and has it worked they it should and has been stable I have not followed it up any further as it didn't seem that a resolution was forthcoming.
[20 Nov 2006 10:50] Tonci Grgin
Hi Javier. Please post *complete* builder sample, including source, frm (saved as text) and project files. Are you using BDE?

Hi Antonio, please provide more info on Clarion and your test case. I suspect they are using old ODBC standards. Did you try to update your Clarion?

Since Miguel already tested with generic, and proper, ODBC client it is my opinion that tools you are using are outdated as is the case with MyODBC 2.5.
[21 Dec 2006 0: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".
[31 May 2013 6:48] Bogdan Degtyariov
I'm closing this bug because I can not continue without feedback from the reporter. If you have new info, please reopen the report.