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

Common table expression context could be used with parameters [CORE2699] #3099

Closed
firebird-issue-importer opened this issue Oct 20, 2009 · 13 comments

Comments

@firebird-issue-importer

Submitted by: @asfernandes

Is related to QA547

Test case:
with x as (
select 1 n from rdb$database
)
select * from x(10);

Obviously, parameters usage is not correct here.

Commits: 0145996 ed0e0da

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Oct 20, 2009

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Oct 20, 2009

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Oct 21, 2009

Commented by: Sean Leyne (seanleyne)

Adriano,

Could you clarify are you saying that CTE should support parameters?

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Oct 21, 2009

Commented by: @asfernandes

The test case should result in an error, but wasn't.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Oct 21, 2009

Commented by: Sean Leyne (seanleyne)

Adriano,

Again, could you clarify, what is the error?

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Oct 21, 2009

Commented by: @dyemanov

AFAIU, the bug is that the engine silently accepts the "parametrized" syntax (10 in parenthesis in the example above) while it should throw an error, as such a feature is not intended.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Oct 21, 2009

Commented by: Sean Leyne (seanleyne)

If the feature is not intended, that's fine.

I should point out, however, that the readme documentation for CTEs suggests that parameters are supported:
...
WITH [RECURSIVE]
CTE_A [(a1, a2, ...)]
AS ( SELECT ... ),

CTE\_B \[\(b1, b2, \.\.\.\)\]
AS \( SELECT \.\.\. \),
 \.\.\.
 SELECT \.\.\.
   FROM CTE\_A, CTE\_B, TAB1, TAB2 \.\.\.
 WHERE \.\.\.

The "CTE_A [(a1, a2, ...)]" certainly gives the impersion that parameters are supported. What else could "(a1, a2, ...)" be, but parameters?

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Oct 21, 2009

Commented by: @asfernandes

This is not parameters. This is field names, like CREATE VIEW X (a1, a2, ...) ...

What is invalid is WITH CTE_A ... SELECT * FROM CTE_A (<parameters>)

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Oct 21, 2009

Modified by: @asfernandes

description: Test case:
with x as (
select 1 n from rdb$database
)
select * from x(10);

Obviously, parameters do nothing here.

=>

Test case:
with x as (
select 1 n from rdb$database
)
select * from x(10);

Obviously, parameters usage is not correct here.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Mar 29, 2014

Modified by: @pcisar

Link: This issue is related to QA547 [ QA547 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 28, 2015

Modified by: @pavel-zotov

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

QA Status: Done successfully

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Sep 23, 2015

Commented by: @pcisar

Test created.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Sep 23, 2015

Modified by: @pcisar

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

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