BUG in MyDAC 5.50 when execute a sequential empty query

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

BUG in MyDAC 5.50 when execute a sequential empty query

Post by eduardosic » Thu 05 Jun 2008 00:39

Hi CoreLab,

when i run the script:

Code: Select all


Select
  A.Cd_Equipamento,
  B.Ds_equipamento,
  A.Dt_Locacao,
  DATEDIFF( CURDATE(),Dt_Locacao) as Dias_Loc,
  D.Ds_Grupo

from
  Locacao A
inner join
  Equipamentos B
on
  A.Cd_equipamento = B.cd_equipamento

inner join
  Clientes C
on
  A.Cd_Cliente = C.Cd_Cliente

left join
  produtos_grupos D
on
  B.Cd_Grupo = D.Cd_grupo

where
  DATEDIFF( CURDATE(),Dt_Locacao) > 90 and D.Ds_Grupo like :Find and
  A.Cd_Cliente =:Cd_Cliente

Order by 
  Cd_equipamento

some times the exception "Field "Dias_Loc" is not a expected Type" is raised..

a made a small project to reproduce it.

http://www.drdsistemas.com.br/util/myda ... 6-2008.zip

Please Fix it, is VERY important...

in MyDAC 5.20 work's fine.

More Information:
Delphi 7
MyDAC 5.50.0.34
MySQL server version: 5.0.37 Windows Version
MySQL client version: Direct

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Thu 05 Jun 2008 07:49

We have reproduced the problem and now we are investigating it. We will let you know as soon as we get any results.

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Post by eduardosic » Thu 05 Jun 2008 11:23

Challenger wrote:We have reproduced the problem and now we are investigating it. We will let you know as soon as we get any results.
Ok, thank's

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Post by swierzbicki » Thu 05 Jun 2008 20:08

I'm facing the same issue.
I've solved it by removing my order by clause.

Can you test ?

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

Post by Dimon » Tue 10 Jun 2008 14:46

This problem concerns specificity of MySQL server.
For the same query with different parameters MySQL server returns different field types. In the first case it equals to ftLargeInt, in the second case to ftInteger.
In order to solve this problem you should create TIntegerField object for the "Dias_Loc" field and set the TMyConnection.Options.OptimizedBigInt property to True.
Another solution is to delete the ORDER BY clause from the query.

Changing of the behaviour in the new build occurs because in the new build FieldDefs are recreated on every DataSet opening.

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Post by eduardosic » Tue 10 Jun 2008 15:22

Dimon wrote:This problem concerns specificity of MySQL server.
For the same query with different parameters MySQL server returns different field types. In the first case it equals to ftLargeInt, in the second case to ftInteger.
In order to solve this problem you should create TIntegerField object for the "Dias_Loc" field and set the TMyConnection.Options.OptimizedBigInt property to True.
Another solution is to delete the ORDER BY clause from the query.

Changing of the behaviour in the new build occurs because in the new build FieldDefs are recreated on every DataSet opening.
Thank's Dimon, Another solution, i delete the field from TMyQuery and use
the field created in run time.

i go to wait the fix of SetOrderBy() bug, when new build go to released?

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

Post by Dimon » Fri 13 Jun 2008 13:32

eduardosic wrote:i go to wait the fix of SetOrderBy() bug, when new build go to released?
New build of MyDAC version 5.50.0.35 with fixed bug with the SetOrderBy is available for download now.

Post Reply