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: invalid cast: oid[] -> bool #40957

Closed
Tracked by #40649
maddyblue opened this issue Sep 21, 2019 · 2 comments
Closed
Tracked by #40649

sql: internal error: invalid cast: oid[] -> bool #40957

maddyblue opened this issue Sep 21, 2019 · 2 comments
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 g % 0 = 0 FROM generate_series(NULL, NULL) AS g;

WITH
	with_6056
		AS (
			SELECT
				*
			FROM
				(
					VALUES
						(
							'6161f427-26b6-476f-8840-71259937ac9c':::UUID,
							ARRAY[0, 0, 0, 0, 0:::OID],
							B'11001011100000001010111010010'
						)
				)
					AS tab_28050
						(col_73101, col_73102, col_73103)
			UNION ALL
				SELECT
					*
				FROM
					(
						VALUES
							(
								COALESCE(
									NULL,
									gen_random_uuid()
								),
								(
									SELECT
										ARRAY[0, 0, 0:::OID]
								),
								B'11011010001110010111100000001'
							)
					)
						AS tab_28051
							(
								col_73105,
								col_73106,
								col_73107
							)
		)
SELECT
	(
		SELECT
			with_6056.col_73103
		WHERE
			EXISTS(
				SELECT
					NULL
				FROM
					tab_orig
				WHERE
					NULL NOT IN (SELECT NULL FROM tab_orig)
			)
	)::BIT(48)
FROM
	with_6056;
stack trace:
github.com/cockroachdb/cockroach/pkg/sql/execinfra/expr.go:78: processExpression()
github.com/cockroachdb/cockroach/pkg/sql/execinfra/expr.go:161: Init()
github.com/cockroachdb/cockroach/pkg/sql/execinfra/processorsbase.go:108: Init()
github.com/cockroachdb/cockroach/pkg/sql/execinfra/processorsbase.go:776: InitWithEvalCtx()
github.com/cockroachdb/cockroach/pkg/sql/execinfra/processorsbase.go:752: Init()
github.com/cockroachdb/cockroach/pkg/sql/rowexec/tablereader.go:92: newTableReader()
github.com/cockroachdb/cockroach/pkg/sql/rowexec/processors.go:138: NewProcessor()
github.com/cockroachdb/cockroach/pkg/sql/rowflow/row_based_flow.go:165: makeProcessor()
github.com/cockroachdb/cockroach/pkg/sql/rowflow/row_based_flow.go:65: setupProcessors()
github.com/cockroachdb/cockroach/pkg/sql/rowflow/row_based_flow.go:48: Setup()
github.com/cockroachdb/cockroach/pkg/sql/distsql/server.go:331: setupFlow()
github.com/cockroachdb/cockroach/pkg/sql/distsql/server.go:404: SetupLocalSyncFlow()
github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:241: setupFlows()
github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:330: Run()
github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:884: planAndRunSubquery()
github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:788: PlanAndRunSubqueries()
github.com/cockroachdb/cockroach/pkg/sql/apply_join.go:310: runRightSidePlan()
github.com/cockroachdb/cockroach/pkg/sql/apply_join.go:280: Next()
github.com/cockroachdb/cockroach/pkg/sql/plan_node_to_row_source.go:171: Next()
github.com/cockroachdb/cockroach/pkg/sql/execinfra/base.go:169: Run()
github.com/cockroachdb/cockroach/pkg/sql/execinfra/processorsbase.go:725: Run()
github.com/cockroachdb/cockroach/pkg/sql/flowinfra/flow.go:341: Run()
github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:341: Run()
github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:884: planAndRunSubquery()
github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:788: PlanAndRunSubqueries()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:817: execWithDistSQLEngine()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:718: dispatchToExecutionEngine()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:417: execStmtInOpenState()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:98: execStmt()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1238: execCmd()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1167: run()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:444: ServeConn()
@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 21, 2019
@yuzefovich
Copy link
Member

It appears to be yet another apply join related bug.

@yuzefovich
Copy link
Member

This query now returns successfully, closing.

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

No branches or pull requests

3 participants