Page 1 of 1

BUG in MyDAC 5.50 when execute a sequential empty query

Posted: Thu 05 Jun 2008 00:39
by eduardosic
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

Posted: Thu 05 Jun 2008 07:49
by Challenger
We have reproduced the problem and now we are investigating it. We will let you know as soon as we get any results.

Posted: Thu 05 Jun 2008 11:23
by eduardosic
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

Posted: Thu 05 Jun 2008 20:08
by swierzbicki
I'm facing the same issue.
I've solved it by removing my order by clause.

Can you test ?

Posted: Tue 10 Jun 2008 14:46
by Dimon
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.

Posted: Tue 10 Jun 2008 15:22
by eduardosic
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?

Posted: Fri 13 Jun 2008 13:32
by Dimon
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.