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
internal error: expected subquery to be lazily planned as a routine
#101980
Comments
Hello, I am Blathers. I am here to help you get the issue triaged. Hoot - a bug! Though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here. I have CC'd a few people who may be able to assist you:
If we have not gotten back to your issue within a few business days, you can try the following:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Very nice find. Thank you! cc @mgartner for triage. |
Hi @mgartner, please add branch-* labels to identify which branch(es) this release-blocker affects. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Simplified reproduction: CREATE TABLE t1 (i INT);
CREATE TABLE t2 (i INT);
INSERT INTO t1 (i) VALUES (1);
INSERT INTO t2 (i) VALUES (1);
SELECT t2.i FROM t1
FULL JOIN t2 ON t2.i IN (
SELECT t2.i FROM t2, t1
WHERE t1.i = 0
OR t2.i IN (SELECT t2.i FROM t2)
); |
Removing the |
102336: opt: fix internal error when planning correlated ANY subqueries r=mgartner a=mgartner This commit fixes a bug where a decorrelation error was not returned when trying to build uncorrelated ANY subqueries within a lazily-evaluated routine, which is not yet supported. Instead of the error, the ANY subquery would be planned as an eagerly-evaluate subquery. This violated the requirement that no eagerly-evaluated subqueries are planned within a lazily-evaluated routine, and caused an internal error. Fixes #101980 Release note (bug fix): A minor bug has been fixed that caused an internal error for some queries with nested subqueries instead of the more appropriate "could not decorrelate subquery" error. This bug was only present in pre-release alpha and beta versions of 23.1. Co-authored-by: Marcus Gartner <marcus@cockroachlabs.com>
This commit fixes a bug where a decorrelation error was not returned when trying to build uncorrelated ANY subqueries within a lazily-evaluated routine, which is not yet supported. Instead of the error, the ANY subquery would be planned as an eagerly-evaluate subquery. This violated the requirement that no eagerly-evaluated subqueries are planned within a lazily-evaluated routine, and caused an internal error. Fixes #101980 Release note (bug fix): A minor bug has been fixed that caused an internal error for some queries with nested subqueries instead of the more appropriate "could not decorrelate subquery" error. This bug was only present in pre-release alpha and beta versions of 23.1.
Describe the problem
Please describe the issue you observed, and any steps we can take to reproduce it:
To Reproduce
The following program triggers this error
This is the error message:
If possible, provide steps to reproduce the behavior:
I build CockroachDB from the last commit version 8124bff, and run it with
./cockroach start-single-node --insecure
Expected behavior
A clear and concise description of what you expected to happen.
No error.
Environment:
Jira issue: CRDB-27198
The text was updated successfully, but these errors were encountered: