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

opt: fix scalar building error handling #40617

Merged
merged 1 commit into from
Sep 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions pkg/sql/logictest/testdata/logic_test/apply_join
Original file line number Diff line number Diff line change
Expand Up @@ -278,3 +278,36 @@ query II
SELECT a, (SELECT a FROM y) FROM x
----
1 1

# Regression test for #40590: non-executable apply join inside apply join.

statement ok
CREATE TABLE IF NOT EXISTS tab_orig AS
SELECT
'2001-01-01'::TIMESTAMP + g * '1 day' AS _timestamp,
g AS _string
FROM
generate_series(NULL, NULL) AS g;

statement error could not decorrelate subquery
SELECT
NULL
FROM
tab_orig AS tab_9962,
tab_orig AS tab_9963
JOIN tab_orig AS tab_9964 ON true
WHERE
NOT
(
tab_9964._timestamp
IN (SELECT tab_9962._timestamp)
OR EXISTS(
WITH
with_2063 AS (SELECT NULL)
SELECT
COALESCE(
tab_9962._string,
tab_9963._string
)
)
)
2 changes: 1 addition & 1 deletion pkg/sql/opt/exec/execbuilder/relational.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ func (b *Builder) buildApplyJoin(join memo.RelExpr) (execPlan, error) {
if len(*filters) != 0 {
onExpr, err = b.buildScalar(&ctx, filters)
if err != nil {
return execPlan{}, nil
return execPlan{}, err
}
}

Expand Down