Issue Details (XML | Word | Printable)

Key: CORE-5244
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Paul Reeves
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Wrong error message when trying to execute SELECT statement using isc_dsql_execute_immediate

Created: 18/May/16 03:25 PM   Updated: 21/May/16 07:57 AM
Component/s: API / Client Library, Engine
Affects Version/s: 4.0 Initial, 3.0.0
Fix Version/s: 3.0.1, 4.0 Alpha 1

QA Status: Cannot be tested
Test Details:
Can`t reproduce using neither ISQL nor Python: they both prevent from API misuse.


 Description  « Hide
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)


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'

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.