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: panic: invalid datum type given: tuple{int, int}, expected oid[] #40587

Closed
Tracked by #40649
maddyblue opened this issue Sep 9, 2019 · 3 comments
Closed
Tracked by #40649
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 AS _decimal FROM generate_series(0, 0) AS g;

WITH
	with_1724
		AS (
			SELECT
				*
			FROM
				(VALUES (0)) AS tab_8043 (col_21511)
		)
SELECT
	(
		WITH
			with_1725
				AS (
					SELECT
						*
					FROM
						(VALUES ((SELECT NULL)))
							AS tab_8046 (col_21533)
				)
		SELECT
			tab_8044._decimal
	)
FROM
	tab_orig AS tab_8044;
github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).closeWrapper(0xc001169000, 0x4f50cc0, 0xc0013b4680, 0x3f4f6c0, 0xc000507bf0)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:730 +0x330
github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn.func1(0xc001169000, 0x4f50cc0, 0xc0013b4680)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:442 +0x61
panic(0x3f4f6c0, 0xc000507bf0)
	/usr/local/go/src/runtime/panic.go:522 +0x1b5
github.com/cockroachdb/cockroach/pkg/sql/sqlbase.DatumToEncDatum(0xc000d58a80, 0x4fd8240, 0xc00107e2a0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/sqlbase/encoded_datum.go:167 +0x1e2
github.com/cockroachdb/cockroach/pkg/sql.(*planNodeToRowSource).Next(0xc001341400, 0xc001169358, 0x4f51e40, 0xc00107fd70, 0x0)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/plan_node_to_row_source.go:179 +0x517
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.Run(0x4f50cc0, 0xc001179e00, 0x4f7bdc0, 0xc001341400, 0x4f2a980, 0xc001399c00)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/base.go:171 +0x35
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*ProcessorBase).Run(0xc001341400, 0x4f50cc0, 0xc001179e00)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/processors.go:793 +0x92
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*Flow).Run(0xc0012b7200, 0x4f50d80, 0xc0010cac90, 0x46f1078, 0x0, 0x0)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/flow.go:584 +0x1ec
github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).Run(0xc0007583c0, 0xc00102b260, 0xc0017fb200, 0xc0016b9808, 0xc0014a8840, 0xc0014498c0, 0x0, 0x0)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:337 +0x381
github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).planAndRunSubquery(0xc0007583c0, 0x4f50cc0, 0xc001178740, 0x1, 0xc00107fda0, 0x3, 0x1, 0x4f51e40, 0xc00107fd70, 0x0, ...)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:880 +0x7c8
github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).PlanAndRunSubqueries(0xc0007583c0, 0x4f50cc0, 0xc001178740, 0xc001169358, 0xc0016b9ac8, 0xc00041bea0, 0x4, 0x4, 0xc0014a8000, 0xc001169101, ...)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:784 +0x1ba
github.com/cockroachdb/cockroach/pkg/sql.(*applyJoinNode).runRightSidePlan(0xc001395a00, 0x4f50cc0, 0xc001178740, 0xc001328240, 0xc001169358, 0xc00099aa80, 0x0, 0x0)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/apply_join.go:310 +0x26b
github.com/cockroachdb/cockroach/pkg/sql.(*applyJoinNode).Next(0xc001395a00, 0x4f50cc0, 0xc001178740, 0xc001328240, 0xc001169358, 0x79184a0, 0xc0005aab50, 0xc0016b9d78)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/apply_join.go:280 +0x6df
github.com/cockroachdb/cockroach/pkg/sql.(*planNodeToRowSource).Next(0xc001340a00, 0xc0018a1000, 0xc001170000, 0xc0016b9dd0, 0x147401b)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/plan_node_to_row_source.go:171 +0x43c
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*noopProcessor).Next(0xc00123b200, 0x0, 0x0, 0xc00102a960, 0xc0017c7c00)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/noop.go:66 +0x4c
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*hashJoiner).receiveNext(0xc0011bf100, 0xc000507801, 0xc0016b9ec0, 0x702ffc, 0xc00004e000, 0x42fa4c0, 0x4414700, 0x6fc8b6, 0x7d969e0)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/hashjoiner.go:653 +0x198
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*hashJoiner).build(0xc0011bf100, 0xc0016b9fa0, 0x203000, 0x203000, 0x4414700, 0x10000c000321420)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/hashjoiner.go:300 +0xd2
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*hashJoiner).Next(0xc0011bf100, 0x416ff00, 0xc000321420, 0x458f839, 0x10)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/hashjoiner.go:234 +0x1c1
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*orderedAggregator).accumulateRows(0xc00172b000, 0x416ff00, 0xc000353820, 0xc001178740, 0x4587e98, 0x12)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/aggregator.go:530 +0x4f
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*orderedAggregator).Next(0xc00172b000, 0xc001178740, 0x4587e98, 0x12, 0x4f50cc0)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/aggregator.go:726 +0x14d
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.Run(0x4f50cc0, 0xc001178740, 0x4f7c380, 0xc00172b000, 0x4f2a980, 0xc001398a80)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/base.go:171 +0x35
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*ProcessorBase).Run(0xc00172b000, 0x4f50cc0, 0xc001178740)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/processors.go:793 +0x92
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*Flow).Run(0xc00128db00, 0x4f50d80, 0xc00107f3e0, 0x46f1078, 0x0, 0x0)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/flow.go:584 +0x1ec
github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).Run(0xc0007583c0, 0xc0010b9320, 0xc0017fb200, 0xc0016ba760, 0xc000813080, 0xc001169428, 0x0, 0x0)
	/home/mjibson/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:337 +0x381

See #40394, which had a similar error message. Please assign back to me or someone on the sql exec team if this isn't an opt-related bug like the other one was.

@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
@rytaft
Copy link
Collaborator

rytaft commented Sep 9, 2019

I haven't spent time looking at this particular issue, but like #40444, I have a strong suspicion that this may be due to the same root cause as #39438 (subqueries are not getting replaced in apply joins). I'd really like to see that issue get fixed before spending any more time trying to debug these issues.

@maddyblue maddyblue assigned jordanlewis and unassigned rytaft Sep 9, 2019
@maddyblue
Copy link
Contributor Author

Ok. Assigning these two issues back to Jordan then.

@maddyblue
Copy link
Contributor Author

Doesn't repro anymore.

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