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

Context parsing error with derived tables and CASE functions [CORE4262] #4586

Closed
firebird-automations opened this issue Nov 12, 2013 · 5 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Purely artificial test case that's not expected to demonstrate anything useful, just to either compile or not:

SELECT
CASE WHEN col = 1 THEN 'Y'
WHEN col = 0 THEN 'N'
END AS text
FROM (
SELECT CASE WHEN EXISTS (SELECT 1 FROM rdb$database ) THEN 1 ELSE 0 END AS col
FROM rdb$relations
)

or

SELECT col AS col1, col AS col2
FROM (
SELECT CASE WHEN EXISTS (SELECT 1 FROM rdb$database ) THEN 1 ELSE 0 END AS col
FROM rdb$relations
)

Statement failed, SQLSTATE = HY000
invalid request BLR at offset <NNN>
-context already in use (BLR error)

In FB 2.5 there's not such a context parsing problem.

Commits: 8dbe038 FirebirdSQL/fbt-repository@51304a7

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

reporter: Dmitry Yemanov [ dimitr ] => Pavel Zotov [ tabloid ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

description: Purely artificial test case that's not expected to demonstrate anything useful, just to either compile or not:

SELECT
CASE WHEN col = 'low' THEN -1
WHEN col = 'high' THEN 1
END as text
FROM (
SELECT CASE WHEN EXISTS (SELECT 1 FROM rdb$database WHERE rdb$relation_id = r.rdb$relation_id - 1) THEN 'low'
WHEN EXISTS (SELECT 1 FROM rdb$database WHERE rdb$relation_id = r.rdb$relation_id + 1) THEN 'high'
END as col
FROM rdb$relations as r
)

Statement failed, SQLSTATE = HY000
invalid request BLR at offset 171
-context already in use (BLR error)

In FB 2.5 there's not such a context parsing problem.

=>

Purely artificial test case that's not expected to demonstrate anything useful, just to either compile or not:

SELECT
CASE WHEN col = 1 THEN 'Y'
WHEN col = 0 THEN 'N'
END AS text
FROM (
SELECT CASE WHEN EXISTS (SELECT 1 FROM rdb$database ) THEN 1 ELSE 0 END AS col
FROM rdb$relations
)

Statement failed, SQLSTATE = HY000
invalid request BLR at offset 113
-context already in use (BLR error)

In FB 2.5 there's not such a context parsing problem.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

description: Purely artificial test case that's not expected to demonstrate anything useful, just to either compile or not:

SELECT
CASE WHEN col = 1 THEN 'Y'
WHEN col = 0 THEN 'N'
END AS text
FROM (
SELECT CASE WHEN EXISTS (SELECT 1 FROM rdb$database ) THEN 1 ELSE 0 END AS col
FROM rdb$relations
)

Statement failed, SQLSTATE = HY000
invalid request BLR at offset 113
-context already in use (BLR error)

In FB 2.5 there's not such a context parsing problem.

=>

Purely artificial test case that's not expected to demonstrate anything useful, just to either compile or not:

SELECT
CASE WHEN col = 1 THEN 'Y'
WHEN col = 0 THEN 'N'
END AS text
FROM (
SELECT CASE WHEN EXISTS (SELECT 1 FROM rdb$database ) THEN 1 ELSE 0 END AS col
FROM rdb$relations
)

or

SELECT col AS col1, col AS col2
FROM (
SELECT CASE WHEN EXISTS (SELECT 1 FROM rdb$database ) THEN 1 ELSE 0 END AS col
FROM rdb$relations
)

Statement failed, SQLSTATE = HY000
invalid request BLR at offset <NNN>
-context already in use (BLR error)

In FB 2.5 there's not such a context parsing problem.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 2 [ 10560 ]

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

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

2 participants