Page 1 of 1

UniDAC 5.2.5 Master-Detail possible BUG

Posted: Wed 22 Jan 2014 11:20
by Filosoft
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,

Re: UniDAC 5.2.5 Master-Detail possible BUG

Posted: Wed 22 Jan 2014 13:40
by AlexP
Hello,

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

Re: UniDAC 5.2.5 Master-Detail possible BUG

Posted: Wed 22 Jan 2014 15:39
by Filosoft
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,

Re: UniDAC 5.2.5 Master-Detail possible BUG

Posted: Wed 22 Jan 2014 16:24
by AlexP
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.

Re: UniDAC 5.2.5 Master-Detail possible BUG

Posted: Mon 24 Mar 2014 19:36
by armalite
In firebird 2.1 and 2.5 have the same problem.

Re: UniDAC 5.2.5 Master-Detail possible BUG

Posted: Tue 25 Mar 2014 10:03
by AlexP
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.