On 05/18/2016 01:25 PM, Paul Reeves wrote:
>
>
> The behaviour of this function seems to have changed slightly.
>
> In FB 2.5 this string:
>
>    SELECT * FROM DEPT_BUDGET(0)
>
> will execute in isc_dsql_execute_immediate without error.
>
>
> If the server is FB 3.0 and the client is Fb 2.5 this error is thrown:
>
>    Dynamic SQL Error
>    -SQLDA missing or incorrect version, or incorrect number/type of
>      variables
>    -unknown ISC error 336003111
>
>
> If the server is Fb 3.0 and the client is Fb 3.0 this error is thrown:
>
>    Dynamic SQL Error
>    -SQLDA error
>    -Wrong number of parameters (expected 1, got 0)

Difference is explained as follows. Old message:

   -SQLDA missing or incorrect version, or incorrect number/type of
     variables

which more or less good reflected a reason of failure (missing output 
SQLDA) for error ocde isc_dsql_sqlda_err was changed to

   -SQLDA error

with an attempt to provide an idea what's wrong with SQLDA. Text

   -Wrong number of parameters (expected 1, got 0)

is almost correct - yes, missing SQLDA has no (or other words 0) 
SQLVARS. And (as far as I understand) given procedure has single 
returned column.

Looks like text:

   -SQLDA missing or other SQLDA error
   -Wrong number of columns or parameters (expected 1, got 0)

will be better. I will take a look is it possible to find a way to 
notify what SQLDA caused problems - IN or OUT.

>
> In all cases isc_dsql_execute_immediate is called with a null xsqlda.
>
> I've tested this with a control statement that does a dummy update. In
> all those cases execution succeeds correctly with a null xsqlda.
>
> Obviously select statements are not meant to work with
> isc_dsql_execute_immediate. And it is arguable that the old behaviour
> was incorrect because it allowed misuse of the function. However, if we
> are going to throw an error I think it should be more explicit. Perhaps
> something along the lines of:
>
>    'Select statements cannot be execute by isc_dsql_execute_immediate'

At the step when we know that the statement is SELECT we have absolutely 
no idea what API call was used initially.
Therefore exactly such a message is rather hard to produce.


>
> Shall I log this as a bug / enhancement request ?
>

I think yes.


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to