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 with recursive CTE [CORE4005] #4337

Closed
firebird-automations opened this issue Dec 4, 2012 · 7 comments
Closed

wrong error message with recursive CTE [CORE4005] #4337

firebird-automations opened this issue Dec 4, 2012 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Frank Schlottmann-Goedde (fsg)

Votes: 1

with recursive
CTE_CNT1 as (select 0 as I
from RDB$DATABASE
union all select I + 1
from CTE_CNT1
where I < 9),

CTE_CNT2 as (select I, 0 as J
from CTE_CNT1
union all select J * 10 + c1.I, c2.J + 1
from CTE_CNT1 c1
join CTE_CNT2 c2 on c2.J < 10)

select I from CTE_CNT2;

fails with:
Statement failed, SQLSTATE = 42S22
Dynamic SQL Error
-SQL error code = -206
-Column unknown
-C2.J
-At line 14, column 15

Commits: 0e9ff22 7f587ec FirebirdSQL/fbt-repository@9faf476 FirebirdSQL/fbt-repository@2125d51

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Fix is committed into both v2.5 and v3 branches.
Note, test query fill fail in database with sql dialect 3 because of another bug CORE4144.
In database with sql dialect 1 query should run even before CORE4144 will be fixed.

Please test it and confirm, i can't verify correctness of results (while it is the same as at MSSQL 2008)

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

Version: 3.0 Alpha 1 [ 10331 ]

Version: 2.5.2 Update 1 [ 10521 ]

Version: 2.5.1 [ 10333 ]

Version: 2.5.0 [ 10221 ]

Fix Version: 2.5.3 [ 10461 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

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

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

Version: 3.0 Initial [ 10301 ]

Version: 3.0 Alpha 1 [ 10331 ] =>

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

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