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

sem/tree: v19.1.0: unhandled right expression tree.dNull in ComparisonExpr.Eval #43358

Closed
cockroach-teamcity opened this issue Dec 19, 2019 · 3 comments
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-sentry Originated from an in-the-wild panic report.

Comments

@cockroach-teamcity
Copy link
Member

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/1396844956/?referrer=webhooks_plugin

Panic message:

(0) eval.go:3600: unhandled right expression %s | tree.dNull
(see stack traces in additional data)

Stacktrace (expand for inline code snippets):

} else {
return nil, pgerror.NewAssertionErrorf("unhandled right expression %s", right)
}
in pkg/sql/sem/tree.(*ComparisonExpr).Eval
d, err := filter.Eval(evalCtx)
if err != nil {
in pkg/sql/sqlbase.RunFilter
eh.evalCtx.PushIVarContainer(eh)
pass, err := sqlbase.RunFilter(eh.expr, eh.evalCtx)
eh.evalCtx.PopIVarContainer()
in pkg/sql/distsqlrun.(*exprHelper).evalFilter
if jb.onCond.expr != nil {
res, err := jb.onCond.evalFilter(jb.combinedRow)
if !res || err != nil {
in pkg/sql/distsqlrun.(*joinerBase).render
if h.storedSide == rightSide {
renderedRow, err = h.render(row, otherRow)
} else {
in pkg/sql/distsqlrun.(*hashJoiner).probeRow
case hjProbingRow:
h.runningState, row, meta = h.probeRow()
case hjEmittingUnmatched:
in pkg/sql/distsqlrun.(*hashJoiner).Next
for {
row, meta := src.Next()
// Emit the row; stop if no more rows are needed.
in pkg/sql/distsqlrun.Run
ctx = pb.self.Start(ctx)
Run(ctx, pb.self, pb.out.output)
}
in pkg/sql/distsqlrun.(*ProcessorBase).Run
}
headProc.Run(ctx)
return nil
in pkg/sql/distsqlrun.(*Flow).Run
// TODO(radu): this should go through the flow scheduler.
if err := flow.Run(ctx, func() {}); err != nil {
log.Fatalf(ctx, "unexpected error from syncFlow.Start(): %s "+
in pkg/sql.(*DistSQLPlanner).Run
dsp.FinalizePlan(planCtx, &physPlan)
dsp.Run(planCtx, txn, &physPlan, recv, evalCtx, nil /* finishedSetupFn */)
}
in pkg/sql.(*DistSQLPlanner).PlanAndRun
// the planner whether or not to plan remote table readers.
ex.server.cfg.DistSQLPlanner.PlanAndRun(
ctx, evalCtx, planCtx, planner.txn, planner.curPlan.plan, recv)
in pkg/sql.(*connExecutor).execWithDistSQLEngine
ex.sessionTracing.TraceExecStart(ctx, "distributed")
err = ex.execWithDistSQLEngine(ctx, planner, stmt.AST.StatementType(), res, distributePlan)
ex.sessionTracing.TraceExecEnd(ctx, res.Err(), res.RowsAffected())
in pkg/sql.(*connExecutor).dispatchToExecutionEngine
p.autoCommit = os.ImplicitTxn.Get() && !ex.server.cfg.TestingKnobs.DisableAutoCommit
if err := ex.dispatchToExecutionEngine(ctx, p, res); err != nil {
return nil, nil, err
in pkg/sql.(*connExecutor).execStmtInOpenState
} else {
ev, payload, err = ex.execStmtInOpenState(ctx, stmt, pinfo, res)
}
in pkg/sql.(*connExecutor).execStmt
ctx := withStatement(ex.Ctx(), ex.curStmt)
ev, payload, err = ex.execStmt(ctx, curStmt, stmtRes, nil /* pinfo */)
if err != nil {
in pkg/sql.(*connExecutor).run
}()
return h.ex.run(ctx, s.pool, reserved, cancel)
}
in pkg/sql.(*Server).ServeConn
}()
writerErr = sqlServer.ServeConn(ctx, connHandler, reserved, cancelConn)
// TODO(andrei): Should we sometimes transmit the writerErr's to the
in pkg/sql/pgwire.(*conn).serveImpl.func4

pkg/sql/sem/tree/eval.go in pkg/sql/sem/tree.(*ComparisonExpr).Eval at line 3600
pkg/sql/sqlbase/expr_filter.go in pkg/sql/sqlbase.RunFilter at line 26
pkg/sql/distsqlrun/expr.go in pkg/sql/distsqlrun.(*exprHelper).evalFilter at line 179
pkg/sql/distsqlrun/joinerbase.go in pkg/sql/distsqlrun.(*joinerBase).render at line 207
pkg/sql/distsqlrun/hashjoiner.go in pkg/sql/distsqlrun.(*hashJoiner).probeRow at line 507
pkg/sql/distsqlrun/hashjoiner.go in pkg/sql/distsqlrun.(*hashJoiner).Next at line 243
pkg/sql/distsqlrun/base.go in pkg/sql/distsqlrun.Run at line 174
pkg/sql/distsqlrun/processors.go in pkg/sql/distsqlrun.(*ProcessorBase).Run at line 801
pkg/sql/distsqlrun/flow.go in pkg/sql/distsqlrun.(*Flow).Run at line 626
pkg/sql/distsql_running.go in pkg/sql.(*DistSQLPlanner).Run at line 252
pkg/sql/distsql_running.go in pkg/sql.(*DistSQLPlanner).PlanAndRun at line 839
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execWithDistSQLEngine at line 1112
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).dispatchToExecutionEngine at line 948
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmtInOpenState at line 456
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmt at line 102
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).run at line 1182
pkg/sql/conn_executor.go in pkg/sql.(*Server).ServeConn at line 433
pkg/sql/pgwire/conn.go in pkg/sql/pgwire.(*conn).serveImpl.func4 at line 337
Tag Value
Cockroach Release v19.1.0
Cockroach SHA: 25dd36f
Platform linux amd64
Distribution CCL
Environment v19.1.0
Command server
Go Version go1.11.6
# of CPUs 8
# of Goroutines 187
@cockroach-teamcity cockroach-teamcity added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-sentry Originated from an in-the-wild panic report. labels Dec 19, 2019
@yuzefovich yuzefovich changed the title sentry: (0) eval.go:3600: unhandled right expression %s | tree.dNull (see stack traces in additional data) release-19.1: sentry: tree: unhandled right expression tree.dNull in ComparisonExpr.Eval Dec 20, 2019
@yuzefovich yuzefovich changed the title release-19.1: sentry: tree: unhandled right expression tree.dNull in ComparisonExpr.Eval sem/tree: v19.1.0: unhandled right expression tree.dNull in ComparisonExpr.Eval Mar 14, 2020
@asubiotto
Copy link
Contributor

This looks like expr.fn.NullableArgs was true with a right null expression in an Any, Some, or All comparison expression. @rafiss looks like you added a check for a null right operand, why do we need to check expr.fn.NullableArgs? Shouldn't we just return DNull, nil in any case?

@rafiss
Copy link
Collaborator

rafiss commented May 9, 2020

@asubiotto Sorry I'd missed this earlier.

It's been a while, but I believe you're referring to this PR, is that correct? #37775

That was backported to 19.1, so it isn't present in 19.1.0, where it looks like this error occurred.

If I recall correctly, we need to check expr.fn.NullableArgs because if the function allows nullable arguments, then the output is not always null -- the function itself should handle how to deal with the null.

@yuzefovich
Copy link
Member

Fixed by #37886

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-sentry Originated from an in-the-wild panic report.
Projects
None yet
Development

No branches or pull requests

4 participants