-
Notifications
You must be signed in to change notification settings - Fork 4.1k
opt: top-level relational expression cannot have outer columns #58438
Description
This issue was autofiled by Sentry. It represents a crash or reported error on a live cluster with telemetry enabled.
Sentry link: https://sentry.io/organizations/cockroach-labs/issues/2131023460/?referrer=webhooks_plugin
Panic message:
optimizer.go:234: top-level relational expression cannot have outer columns: (7)
--
*errutil.leafError: top-level relational expression cannot have outer columns: (7) (1)
optimizer.go:234: *withstack.withStack (top exception)
*assert.withAssertionFailure
(check the extra data payloads)
Stacktrace (expand for inline code snippets):
cockroach/pkg/sql/opt/xform/optimizer.go
Lines 233 to 235 in 92d9495
| if !root.Relational().OuterCols.Empty() { | |
| return nil, errors.AssertionFailedf( | |
| "top-level relational expression cannot have outer columns: %s", |
Lines 515 to 517 in 92d9495
| if _, isCanned := opc.p.stmt.AST.(*tree.CannedOptPlan); !isCanned { | |
| if _, err := opc.optimizer.Optimize(); err != nil { | |
| return nil, err |
Lines 194 to 196 in 92d9495
| execMemo, err := opc.buildExecMemo(ctx) | |
| if err != nil { |
cockroach/pkg/sql/conn_executor_exec.go
Lines 900 to 902 in 92d9495
| if err := planner.makeOptimizerPlan(ctx); err != nil { | |
| log.VEventf(ctx, 1, "optimizer plan failed: %v", err) |
cockroach/pkg/sql/conn_executor_exec.go
Lines 779 to 781 in 92d9495
| // between here and there needs to happen even if there's an error. | |
| err := ex.makeExecPlan(ctx, planner) | |
| // We'll be closing the plan manually below after execution; this |
cockroach/pkg/sql/conn_executor_exec.go
Lines 638 to 640 in 92d9495
| p.autoCommit = os.ImplicitTxn.Get() && !ex.server.cfg.TestingKnobs.DisableAutoCommit | |
| if err := ex.dispatchToExecutionEngine(ctx, p, res); err != nil { | |
| return nil, nil, err |
cockroach/pkg/sql/conn_executor_exec.go
Lines 113 to 115 in 92d9495
| } else { | |
| ev, payload, err = ex.execStmtInOpenState(ctx, stmt, res, pinfo) | |
| } |
cockroach/pkg/sql/conn_executor.go
Lines 1464 to 1466 in 92d9495
| stmtCtx := withStatement(ctx, ex.curStmt) | |
| ev, payload, err = ex.execStmt(stmtCtx, curStmt, stmtRes, nil /* pinfo */) | |
| return err |
cockroach/pkg/sql/conn_executor.go
Lines 1466 to 1468 in 92d9495
| return err | |
| }() | |
| // Note: we write to ex.statsCollector.phaseTimes, instead of ex.phaseTimes, |
cockroach/pkg/sql/conn_executor.go
Lines 1390 to 1392 in 92d9495
| var err error | |
| if err = ex.execCmd(ex.Ctx()); err != nil { | |
| if errors.IsAny(err, io.EOF, errDrainingComplete) { |
cockroach/pkg/sql/conn_executor.go
Lines 507 to 509 in 92d9495
| }() | |
| return h.ex.run(ctx, s.pool, reserved, cancel) | |
| } |
cockroach/pkg/sql/pgwire/conn.go
Lines 625 to 627 in 92d9495
| reservedOwned = false // We're about to pass ownership away. | |
| retErr = sqlServer.ServeConn(ctx, connHandler, reserved, cancelConn) | |
| }() |
/usr/local/go/src/runtime/asm_amd64.s#L1356-L1358 in runtime.goexit
pkg/sql/opt/xform/optimizer.go in pkg/sql/opt/xform.(*Optimizer).Optimize at line 234
pkg/sql/plan_opt.go in pkg/sql.(*optPlanningCtx).buildExecMemo at line 516
pkg/sql/plan_opt.go in pkg/sql.(*planner).makeOptimizerPlan at line 195
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).makeExecPlan at line 901
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).dispatchToExecutionEngine at line 780
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmtInOpenState at line 639
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmt at line 114
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).execCmd.func1 at line 1465
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).execCmd at line 1467
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).run at line 1391
pkg/sql/conn_executor.go in pkg/sql.(*Server).ServeConn at line 508
pkg/sql/pgwire/conn.go in pkg/sql/pgwire.(*conn).processCommandsAsync.func1 at line 626
/usr/local/go/src/runtime/asm_amd64.s in runtime.goexit at line 1357
| Tag | Value |
|---|---|
| Cockroach Release | v20.2.2 |
| Cockroach SHA: | 92d9495 |
| Platform | darwin amd64 |
| Distribution | CCL |
| Environment | v20.2.2 |
| Command | demo |
| Go Version | `` |
| # of CPUs | |
| # of Goroutines |
Jira issue: CRDB-3393
Metadata
Metadata
Assignees
Labels
Type
Projects
Status