The driver trucates queries with UpdateMode upWhereKeyOnly

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for MySQL in Delphi and C++Builder
Post Reply
dualsoft
Posts: 7
Joined: Wed 28 Oct 2009 11:17

The driver trucates queries with UpdateMode upWhereKeyOnly

Post by dualsoft » Wed 28 Oct 2009 11:48

I tried with dbexpmda.dll v4.40.0.18, Delphi 7
The driver trucates queries with UpdateMode is upWhereKeyOnly and I try to change the field in Key.
Here is the link with a test project:
http://www.winarhi.ro/temp/test.zip

When I call ApplyUpdates the driver generate truncated query like this:

Code: Select all

update  test1   se
where
  A  = 'test'
And shold be:

Code: Select all

update  test1   set A = 'other'
where
  A  = 'test'

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 28 Oct 2009 14:32

To solve the problem you should change the following line in your example:

Code: Select all

DataSet.FieldByName('A').ProviderFlags := [pfInKey];
to this line:

Code: Select all

DataSet.FieldByName('A').ProviderFlags := DataSet.FieldByName('A').ProviderFlags + [pfInKey];

Post Reply