cockroachdb / cockroachdb/cockroach

roachtest/sqlsmith: index out of range in UnnestTuplesFromValues

Open
#160,970 2 comments 0 reactions 0 assignees View on GitHub
branch-release-24.3.25-rc C-test-failure O-roachtest O-robot O-rsg T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

roachtest.sqlsmith/setup=empty/setting=default [failed](https://teamcity.cockroachdb.com/buildConfiguration/Cockroach_Nightlies_RoachtestNightlyGceBazel/20964976?buildTab=log) with [artifacts](https://teamcity.cockroachdb.com/buildConfiguration/Cockroach_Nightlies_RoachtestNightlyGceBazel/20964976?buildTab=artifacts#/sqlsmith/setup=empty/setting=default) on release-24.3.25-rc @ [eecd7c2c316ed213daab1c664e0d854fc937a746](https://github.com/cockroachdb/cockroach/commits/eecd7c2c316ed213daab1c664e0d854fc937a746):

Reduced repro
```sql
CREATE TABLE t (c INT);

INSERT INTO t
WITH cte AS (SELECT NULL FROM (VALUES ((1, 2)::RECORD), ((3,))))
SELECT NULL;
```
```
ERROR: internal error: runtime error: index out of range [1] with length 1
SQLSTATE: XX000
DETAIL: stack trace:
pkg/util/errorutil/catch.go:24: shouldCatch()
pkg/util/errorutil/catch.go:38: MaybeCatchPanic()
GOROOT/src/runtime/panic.go:783: gopanic()
GOROOT/src/runtime/panic.go:115: goPanicIndex()
pkg/sql/opt/norm/project_funcs.go:201: UnnestTuplesFromValues()
bazel-out/darwin_arm64-fastbuild/bin/pkg/sql/opt/norm/factory.og.go:2043: ConstructProject()
pkg/sql/opt/optbuilder/project.go:57: constructProject()
pkg/sql/opt/optbuilder/project.go:32: constructProjectForScope()
pkg/sql/opt/optbuilder/select.go:1261: buildSelectClause()
pkg/sql/opt/optbuilder/select.go:1143: buildSelectStmtWithoutParens()
pkg/sql/opt/optbuilder/select.go:1095: func1()
pkg/sql/opt/optbuilder/with.go:110: processWiths()
pkg/sql/opt/optbuilder/select.go:1094: buildSelect()
pkg/sql/opt/optbuilder/builder.go:382: buildStmt()
pkg/sql/opt/optbuilder/with.go:189: buildCTE()
pkg/sql/opt/optbuilder/with.go:134: buildCTEs()
pkg/sql/opt/optbuilder/with.go:107: processWiths()
pkg/sql/opt/optbuilder/select.go:1094: buildSelect()
pkg/sql/opt/optbuilder/builder.go:382: buildStmt()
pkg/sql/opt/optbuilder/insert.go:685: buildInputForInsert()
pkg/sql/opt/optbuilder/insert.go:275: buildInsert()
pkg/sql/opt/optbuilder/builder.go:394: func2()
pkg/sql/opt/optbuilder/with.go:110: processWiths()
pkg/sql/opt/optbuilder/builder.go:393: buildStmt()
pkg/sql/opt/optbuilder/builder.go:320: buildStmtAtRootWithScope()
pkg/sql/opt/optbuilder/builder.go:296: buildStmtAtRoot()
pkg/sql/opt/optbuilder/builder.go:275: Build()
pkg/sql/plan_opt.go:945: buildExecMemo()
pkg/sql/plan_opt.go:328: makeOptimizerPlanInternal()
pkg/sql/plan_opt.go:308: makeOptimizerPlan()
pkg/sql/conn_executor_exec.go:3260: makeExecPlan()
pkg/sql/conn_executor_exec.go:2841: dispatchToExecutionEngine()
```

Reproduces on master too.

Jira issue: CRDB-58635

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.