MyDAC 5.70.0.42 Master / Detail Bug

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

MyDAC 5.70.0.42 Master / Detail Bug

Post by swierzbicki » Wed 10 Dec 2008 16:25

Hi,

I have found a bug when working with Master / Details :

On the Detail Query fill :

SQL with this script :

Code: Select all

SET @MyVAR = (SELECT Field FROM Table WHERE Field = :Field)  ;
DROP TEMPORARY TABLE IF EXISTS TmpTable;
CREATE TEMPORARY TABLE IF NOT EXISTS TmpTable
SELECT 
@MyVAR as MyVar,
convert(:Field, CHAR(10)) as Field;
SELECT *  FROM TmpTable
Set the master and details keys to 'Field'
Set the keyfields to 'Field'
Set Debug to true


Double click on the query and in the SQL Editor select 'Data Editor...'
The debug output will show this :

Code: Select all

SET @MyVAR = (SELECT Field FROM Table WHERE (Field = :Field)  ;
DROP TEMPORARY TABLE IF EXISTS TmpTable;
CREATE TEMPORARY TABLE IF NOT EXISTS TmpTable
SELECT 
@MyVAR as MyVar,
convert(:Field, CHAR(10)) as Field;
SELECT *  FROM TmpTable) AND Field= :Field

:Field(String[5])='Value' 
:Field(String[5])='Value' 
:Field(String[5])='Value' 
You can see that the

Code: Select all

SELECT *  FROM TmpTable) AND Field= :Field
is wrong : a ')' is added instead the 'Where' keyword.

If I remove the 'where' located in the 'SET' statement, the query will be correctly changed and executed by MyDAC.

This is a simple exemple, in my case, I have about 20 parameters in my 'SET' statement...

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

Re: MyDAC 5.70.0.42 Master / Detail Bug

Post by eduardosic » Wed 10 Dec 2008 20:14

as temporary solution, try to clean property DetailFields.

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

Post by swierzbicki » Thu 11 Dec 2008 10:19

Hi Eduardosic,

Thank you for the tips but that's what I've already done : I've removed the master/Detail link and I've manually set my parameter. This is a temporary solution : I have other nested queries where I need that the master / detail mechanism to work !

I'm sure that Devart team will found a solution ;)

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

Post by Dimon » Thu 11 Dec 2008 13:44

We will investigate possibility to add such functionality, but it is hardly to happen in the nearest future.
Please create master-detail relationship by adding parameters manually.

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

Post by eduardosic » Thu 11 Dec 2008 13:53

Dimon wrote:We will investigate possibility to add such functionality, but it is hardly to happen in the nearest future.
Please create master-detail relationship by adding parameters manually.
swierzbicki can create a master-detail with form link and clean property DetailFields, more speed.

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

Post by swierzbicki » Fri 12 Dec 2008 09:06

Hi Dimon,

Please note that this used to worked in version prior to 5.x !
It will be nice to have this working again ;)

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

Post by Dimon » Tue 16 Dec 2008 12:41

Please specify the MyDAC version it works with.

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

Post by swierzbicki » Fri 19 Dec 2008 10:11

I don't have all myDAC version on my laptop.
The only thing I know is that my software was out on November 2007 !

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

Post by Dimon » Fri 19 Dec 2008 13:39

I can not find any MyDAC build in which this situation is processed correctly, but we will investigate the possibility of solving this problem.

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

Post by swierzbicki » Fri 19 Dec 2008 21:44

Ok !
Thank you for trying to solve this !

Post Reply