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

sql: internal error: cannot map variable 1 to an indexed var #40590

Closed
maddyblue opened this issue Sep 9, 2019 · 0 comments · Fixed by #40617
Closed

sql: internal error: cannot map variable 1 to an indexed var #40590

maddyblue opened this issue Sep 9, 2019 · 0 comments · Fixed by #40617
Assignees
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-sqlsmith

Comments

@maddyblue
Copy link
Contributor

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;

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
						)
				)
		);
stack trace:
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/scalar.go:149: indexedVar()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:562: func1()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/colset.go:55: func1()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/util/fast_int_set.go:167: ForEach()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/colset.go:55: ForEach()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:560: buildProject()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:195: buildRelational()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:988: buildGroupByInput()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:861: buildGroupBy()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:198: buildRelational()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:493: buildSelect()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:192: buildRelational()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:988: buildGroupByInput()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:956: buildDistinct()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:201: buildRelational()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:1122: buildLimitOffset()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:204: buildRelational()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:535: buildProject()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:195: buildRelational()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/builder.go:117: build()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/builder.go:105: Build()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:169: makeOptimizerPlan()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:734: makeExecPlan()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:616: dispatchToExecutionEngine()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:417: execStmtInOpenState()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:98: execStmt()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1238: execCmd()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1167: run()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:444: ServeConn()
/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:584: func1()
runtime/asm_amd64.s:1337: goexit()

Same error message as #39435.

@maddyblue maddyblue added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-sqlsmith labels Sep 9, 2019
craig bot pushed a commit that referenced this issue Sep 10, 2019
40609: roachtest: update 19.1 hibernate blacklist r=rafiss a=rafiss

The blacklist had too many expected failures. Most of them were related
to earlier issues with the test being unable to connect to the cluster. Also, remove
the `--info` option from the test runner command, since it makes too much output.

touches #40538

Release note: None

40617: opt: fix scalar building error handling r=RaduBerinde a=RaduBerinde

We are incorrectly returning `nil` error in an error case. This leads
to an assertion error instead of a "could not decorrelate subquery"
error.

Fixes #40590.

Release note: None

40619: cliccl: Change license acquisition URL r=rohany a=rohany

Change the cockroach demo license acquisition URLs to point to a new URL.

Release note: None

Co-authored-by: Rafi Shamim <rafi@cockroachlabs.com>
Co-authored-by: Radu Berinde <radu@cockroachlabs.com>
Co-authored-by: Rohan Yadav <rohany@cockroachlabs.com>
@craig craig bot closed this as completed in d4a730c Sep 10, 2019
RaduBerinde added a commit to RaduBerinde/cockroach that referenced this issue Oct 17, 2019
We are incorrectly returning `nil` error in an error case. This leads
to an assertion error instead of a "could not decorrelate subquery"
error.

Fixes cockroachdb#40590.

Release note: None
RaduBerinde added a commit to RaduBerinde/cockroach that referenced this issue Oct 17, 2019
We are incorrectly returning `nil` error in an error case. This leads
to an assertion error instead of a "could not decorrelate subquery"
error.

Fixes cockroachdb#40590.

Release note: None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-sqlsmith
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants