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

Use of "? in (SELECT some_col FROM some_table)" subqueries results in error [CORE3842] #1424

Closed
firebird-automations opened this issue May 5, 2012 · 10 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @mrotteveel

Relate to JDBC94
Duplicates CORE2697

Using a query with the condition "? in (SELECT some_col FROM some_table)" results in an error -804 Data type unknown. This was suppossed to fixed by CORE2697 for version 3.0, but it appears this is not the case.

Synthetic reproduction script (see also JDBC94)
CREATE TABLE VALUE_TABLE
(
INT_COLUMN Integer NOT NULL,
PRIMARY KEY (INT_COLUMN)
);
COMMIT;
INSERT INTO VALUE_TABLE(INT_COLUMN) VALUES (1);
COMMIT;

set term #⁠;
EXECUTE BLOCK
AS
DECLARE charResult CHAR(1);
BEGIN
EXECUTE STATEMENT ('SELECT ''x'' FROM RDB$DATABASE WHERE ? IN (SELECT INT_COLUMN FROM VALUE_TABLE)') (1) INTO charResult;
END#⁠
set term ;#⁠

Result:
Engine Code : 335544569
Engine Message :
Dynamic SQL Error
SQL error code = -804
Data type unknown

As stated in CORE2697 this could be rewritten to use EXISTS, but sometimes that is not an option if the query is generated.

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

See test for CORE2697

@firebird-automations
Copy link
Collaborator Author

Modified by: @mrotteveel

Link: This issue block progress on JDBC94 [ JDBC94 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @mrotteveel

Link: This issue block progress on JDBC94 [ JDBC94 ] =>

@firebird-automations
Copy link
Collaborator Author

Modified by: @mrotteveel

Link: This issue relate to JDBC94 [ JDBC94 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Marking this as duplicate. CORE2697 was fixed once but broken later. Now it's fixed again.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Duplicate [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Link: This issue duplicates CORE2697 [ CORE2697 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

Checked it with WI-T3.0.0.29952 Firebird 3.0 Unstable and it is OK now.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test => Covered by another test(s)

Test Details: See test for CORE2697

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

No branches or pull requests

1 participant