Page 1 of 1

Problem with ".Post", DateTime and MySQL 5.5?

Posted: Fri 09 Dec 2011 13:09
by friedel
I get an error with the following simple code:

quSync := TMyQuery.Create(Application);
quSync.Connection := ...;
quSync.SQL.Text := 'SELECT * FROM table1';
quSync.Edit;
quSync['time1'] := Now;
quSync.Post;

#42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2011-12-08 20:01:42' ? WHERE name_'...' at line 3

MySQL log is:

SET
time1 '2011-12-08 20:01:42' ?
WHERE
name_'...' = ?

"time1" is a DATETIME field, "name" is VARCHAR. MySQL version is 5.5.18.

I think there is a problem with internal datetime format. Any ideas?

Posted: Fri 09 Dec 2011 17:58
by AndreyZ
Hello,

I cannot reproduce the problem. Please try using the latest MyDAC version 7.1.3 and check if the problem persists.

Posted: Thu 22 Dec 2011 09:53
by nigel_1
I am having this problem and many more now I have upgraded from V5 to V7.1.3 MyDac (I also upgraded to SDac V6.1.3 at the same time).

MySQL V5.5.8

Opening a query and trying to use Append or post = Problem
(SQL_C is an opened TMyconnection)

The table DDL is:
CREATE TABLE `testtable1` (
`id` int(4) NOT NULL AUTO_INCREMENT,
`field1` varchar(30) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

If (SQL_C.InTransaction = False) Then SQL_C.StartTransaction;
Test1_Q.edit;
Test1_Q.FieldByName('field1').AsString := FormatDatetime('YYYYMMDDHHMMSS', Now);
Test1_Q.Post;
If (SQL_C.InTransaction = True) Then SQL_C.Commit;




#42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''20111222141546' (?)' at line 4

The Debug:

UPDATE testtable1
SET
field1 = ?
WHERE
id = ?


:field1(String[14],IN)='20111222122603'
:Old_id(Integer,IN)=1



This is one of the lesser problems as I can work round it, there are many problems introduced in this update. I have manged to remove all calls to "post" from my main applications.

Any answers to this as I would like to not have to go through all the 53 applications using these problem components?

Regards
Nigel

Posted: Thu 22 Dec 2011 13:17
by AndreyZ
I cannot reproduce the problem. Please try creating a small sample that demonstrates the problem and send it to andreyz*devart*com.

Posted: Thu 22 Dec 2011 13:26
by nigel_1
Hi, many thanks for your reply.

Email with demo code sent.

Regards
Nigel

Posted: Fri 23 Dec 2011 06:56
by AndreyZ
Thank you for the information. We have reproduced this problem and fixed. This fix will be included in the next MyDAC build.

Posted: Fri 23 Dec 2011 10:07
by nigel_1
Hi,

Thanks for your reply but this does not fix my current problem with the other 50+ applications that I now have to modify.

The reason I upgraded from V5 MyDac was to remove some memory leak bugs and a locking bug, This upgrade also FORCED me to upgrade the SDAC version I was using or MyDAC V7 would not install!

I paid for both these updated components and now I still have bug problems and this is not good business.

Can you make an interim release so at least this bug is fixed and I can actually use the items I have purchased?

I feel this is only fair as I have already paid for SDAC that I did not require and I have also done work I should not have needed to do.

If I release software and it has a bug I fix it and get it to the end user straight away as that is the nature of software development and service level agreements.

You may not release a new version for many months, what do I do until then?

Yours
Nigel Afford
(Cyprus)

Posted: Fri 23 Dec 2011 13:19
by AndreyZ
In the latest MyDAC versions we added support of a lot of operation systems (Windows x64, MacOS, iOS, Linux x64, FreeBSD). To achieve this, we made a lot of changes in all DAC components. We understand that these changes can cause bugs and we fix them as soon as they are reported. We are sorry for the inconvenience. We plan to release new builds of all DAC components next week.

Thanks

Posted: Fri 23 Dec 2011 14:45
by nigel_1
Hi,

Thanks, I will keep looking for the next update for MyDac.

Best Regards
Nigel