Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong error message when trying to execute SELECT statement using isc_dsql_execute_immediate [CORE5244] #5523

Closed
firebird-issue-importer opened this issue May 18, 2016 · 4 comments

Comments

@firebird-issue-importer

Submitted by: @reevespaul

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'

Commits: 641a2b9 6b4a5c9

====== Test Details ======

Can`t reproduce using neither ISQL nor Python: they both prevent from API misuse.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 18, 2016

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 18, 2016

Modified by: @AlexPeshkoff

reporter: Alexander Peshkov [ alexpeshkoff ] => Paul Reeves [ paul_reeves ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 18, 2016

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0.1 [ 10730 ]

Fix Version: 4.0 Alpha 1 [ 10731 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 21, 2016

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Cannot be tested

Test Details: Can`t reproduce using neither ISQL nor Python: they both prevent from API misuse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment