UniDAC 5.2.5 Master-Detail possible BUG

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Filosoft
Posts: 2
Joined: Wed 22 Jan 2014 10:56

UniDAC 5.2.5 Master-Detail possible BUG

Post by Filosoft » Wed 22 Jan 2014 11:20

Hi,

After updating to UniDAC 5.2.5 with PostgreSQL provider, our master-detail relationships stopped working when the master query is empty (error pgError "could not determine data type of parameter $1.")

- Master-detail relationship is defined as "id->id_master", and LocalMasterDetail=False.
We checked the query SQL with DBMonitor and the query is a bit strange:

Code: Select all

select * from detail WHERE ( id_master IS NULL AND :id IS NULL)
If we make UnpreparedExecute=True in Detail query options, the query is the same, but there is no error.

We expected the query to be:

Code: Select all

select * from detail WHERE ( id_master IS NULL )

or

Code: Select all

select * from detail WHERE ( id_master = :id )
param id Value = NULL
Please note that everything was working fine with the previous version of UniDAC.

Regards,

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: UniDAC 5.2.5 Master-Detail possible BUG

Post by AlexP » Wed 22 Jan 2014 13:40

Hello,

To solve the problem, there is no need to modify the UnpreparedExecute property, it's enough to set the UseParamTypes property to True

Filosoft
Posts: 2
Joined: Wed 22 Jan 2014 10:56

Re: UniDAC 5.2.5 Master-Detail possible BUG

Post by Filosoft » Wed 22 Jan 2014 15:39

Thanks AlexP,

Your sugestion fixed the problem. :D

Shouldn't the UseParamTypes property default value be True ?
When should we make UseParamTypes=False and UseParamTypes=True ?

Regards,

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: UniDAC 5.2.5 Master-Detail possible BUG

Post by AlexP » Wed 22 Jan 2014 16:24

Hello,

Set the UseParamTypes option to True to disable automatic detection of parameter types. When this option is True, data types of parameters are set basing on the DataType property. When this option is False, data types of the parameters are detected by server automatically.

P.S. We cannot change this property value, since this modification will change the behavior in the existing users' projects.

armalite
Posts: 5
Joined: Tue 09 Nov 2010 11:54

Re: UniDAC 5.2.5 Master-Detail possible BUG

Post by armalite » Mon 24 Mar 2014 19:36

In firebird 2.1 and 2.5 have the same problem.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: UniDAC 5.2.5 Master-Detail possible BUG

Post by AlexP » Tue 25 Mar 2014 10:03

We will change this behaviour in the next version of UniDAC. A query that takes into account NULL values will be generated optionally. By default an old query will be generated. Thus, there will no necessity for you to change the value of the UseParamTypes property.

Post Reply