-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: v21.2.7: incorrect type conversion in ColumnAccessExpr - maybe DNull check is missing? #78159
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.
T-sql-queries
SQL Queries Team
Comments
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
Mar 20, 2022
yuzefovich
changed the title
sentry: error.go:88: unexpected error from the vectorized engine: ×
--
*barriers.barrierError
*errutil.withPrefix: unexpected error from the vectorized engine (1)
error.go:88: *withstack.withStack (top exception)
*assert.withAssertionFailure
*colexecerror.notInternalError
*colexecerror.notInternalError
(check the extra data payloads)
sem/tree: v21.2.7: incorrect type conversion in ColumnAccessExpr - maybe DNull check is missing?
Mar 22, 2022
Good eye @yuzefovich! I was able to reverse engineer a reproduction from the clue you left:
|
Postgres doesn't support our syntax for labelled tuples, but I think this is an equivalent statement that shows that a column access of
|
mgartner
added a commit
to mgartner/cockroach
that referenced
this issue
Mar 24, 2022
Previously, `ColumnAccessExpr.Eval` would panic if the `ColumnAccessExpr`'s inner expression evaluated to `NULL`, because it attempted to cast this `NULL` to a `DTuple`. Now, if the inner expression is `NULL`, `ColumnAccessExpr.Eval` returns `NULL`. Fixes cockroachdb#78159 Release note (bug fix): A bug has been fixed that caused an internal error when the inner expression of a column access expression evaluated to `NULL`. For example, evaluation of the expression `(CASE WHEN b THEN ((ROW(1) AS a)) ELSE NULL END).a` would error when `b` is `false`. This bug has been present since version 19.1 or earlier.
craig bot
pushed a commit
that referenced
this issue
Apr 6, 2022
78423: sql: fix ColumnAccessExpr.Eval with NULL inner expression r=mgartner a=mgartner #### sql: fix ColumnAccessExpr.Eval with NULL inner expression Previously, `ColumnAccessExpr.Eval` would panic if the `ColumnAccessExpr`'s inner expression evaluated to `NULL`, because it attempted to cast this `NULL` to a `DTuple`. Now, if the inner expression is `NULL`, `ColumnAccessExpr.Eval` returns `NULL`. Fixes #78159 Release note (bug fix): A bug has been fixed that caused an internal error when the inner expression of a column access expression evaluated to `NULL`. For example, evaluation of the expression `(CASE WHEN b THEN ((ROW(1) AS a)) ELSE NULL END).a` would error when `b` is `false`. This bug has been present since version 19.1 or earlier. #### sql: include tuple labels in types returned from typeCheckSameTypedTupleExprs Previously, an expression that produced a tuple from several potential values was typed as a tuple without any labels. This prevented a tuple's column to be accessed by a label name. For example, the expression below would result in the error "could not identify column 'a' in record data type". SELECT (CASE WHEN true THEN (ROW(1) AS a) ELSE (ROW(2) AS a) END).a Now, the labels of the first tuple are used in the type of the outer expression. Fixes #78515 Release note (bug fix): A bug has been fixed that caused an error when accessing a named column of a labelled tuple. The bug only occurred when an expression could produce one of several different tuples. For example, `(CASE WHEN true THEN (ROW(1) AS a) ELSE (ROW(2) AS a) END).a` would fail to evaluate. This bug was present since version 22.1.0. Although present in previous versions, it was impossible to encounter due to limitations that prevented using tuples in this way. Co-authored-by: Marcus Gartner <[email protected]>
blathers-crl bot
pushed a commit
that referenced
this issue
Apr 6, 2022
Previously, `ColumnAccessExpr.Eval` would panic if the `ColumnAccessExpr`'s inner expression evaluated to `NULL`, because it attempted to cast this `NULL` to a `DTuple`. Now, if the inner expression is `NULL`, `ColumnAccessExpr.Eval` returns `NULL`. Fixes #78159 Release note (bug fix): A bug has been fixed that caused an internal error when the inner expression of a column access expression evaluated to `NULL`. For example, evaluation of the expression `(CASE WHEN b THEN ((ROW(1) AS a)) ELSE NULL END).a` would error when `b` is `false`. This bug has been present since version 19.1 or earlier.
blathers-crl bot
pushed a commit
that referenced
this issue
Apr 6, 2022
Previously, `ColumnAccessExpr.Eval` would panic if the `ColumnAccessExpr`'s inner expression evaluated to `NULL`, because it attempted to cast this `NULL` to a `DTuple`. Now, if the inner expression is `NULL`, `ColumnAccessExpr.Eval` returns `NULL`. Fixes #78159 Release note (bug fix): A bug has been fixed that caused an internal error when the inner expression of a column access expression evaluated to `NULL`. For example, evaluation of the expression `(CASE WHEN b THEN ((ROW(1) AS a)) ELSE NULL END).a` would error when `b` is `false`. This bug has been present since version 19.1 or earlier.
blathers-crl bot
pushed a commit
that referenced
this issue
Apr 6, 2022
Previously, `ColumnAccessExpr.Eval` would panic if the `ColumnAccessExpr`'s inner expression evaluated to `NULL`, because it attempted to cast this `NULL` to a `DTuple`. Now, if the inner expression is `NULL`, `ColumnAccessExpr.Eval` returns `NULL`. Fixes #78159 Release note (bug fix): A bug has been fixed that caused an internal error when the inner expression of a column access expression evaluated to `NULL`. For example, evaluation of the expression `(CASE WHEN b THEN ((ROW(1) AS a)) ELSE NULL END).a` would error when `b` is `false`. This bug has been present since version 19.1 or earlier.
This was referenced Aug 24, 2023
msirek
pushed a commit
to msirek/cockroach
that referenced
this issue
Sep 8, 2023
This uncomments a unit test from cockroachdb#78159 which was fixed by cockroachdb#109635. Informs: cockroachdb#109105 Release note: None
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.
T-sql-queries
SQL Queries Team
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/3118425943/?referrer=webhooks_plugin
Panic message:
Stacktrace (expand for inline code snippets):
cockroach/pkg/sql/colexecerror/error.go
Lines 87 to 89 in 37dee54
/usr/local/go/src/runtime/panic.go#L964-L966 in runtime.gopanic
/usr/local/go/src/runtime/iface.go#L260-L262 in runtime.panicdottypeE
/usr/local/go/src/runtime/iface.go#L270-L272 in runtime.panicdottypeI
cockroach/pkg/sql/sem/tree/eval.go
Lines 4109 to 4111 in 37dee54
cockroach/pkg/sql/sem/tree/eval.go
Lines 4355 to 4357 in 37dee54
cockroach/pkg/sql/execinfrapb/expr.go
Lines 210 to 212 in 37dee54
cockroach/pkg/sql/execinfrapb/expr.go
Lines 199 to 201 in 37dee54
cockroach/pkg/sql/rowexec/filterer.go
Lines 94 to 96 in 37dee54
cockroach/pkg/sql/row_source_to_plan_node.go
Lines 75 to 77 in 37dee54
cockroach/pkg/sql/apply_join.go
Lines 194 to 196 in 37dee54
cockroach/pkg/sql/plan_node_to_row_source.go
Lines 186 to 188 in 37dee54
cockroach/pkg/sql/colexec/columnarizer.go
Lines 221 to 223 in 37dee54
cockroach/pkg/sql/colexec/materializer.go
Lines 260 to 262 in 37dee54
cockroach/pkg/sql/colexec/materializer.go
Lines 285 to 287 in 37dee54
cockroach/pkg/sql/colexecerror/error.go
Lines 90 to 92 in 37dee54
cockroach/pkg/sql/colexec/materializer.go
Lines 291 to 293 in 37dee54
cockroach/pkg/sql/colflow/flow_coordinator.go
Lines 126 to 128 in 37dee54
cockroach/pkg/sql/colflow/flow_coordinator.go
Lines 143 to 145 in 37dee54
cockroach/pkg/sql/colexecerror/error.go
Lines 90 to 92 in 37dee54
cockroach/pkg/sql/colflow/flow_coordinator.go
Lines 148 to 150 in 37dee54
cockroach/pkg/sql/execinfra/base.go
Lines 185 to 187 in 37dee54
cockroach/pkg/sql/execinfra/processorsbase.go
Lines 730 to 732 in 37dee54
cockroach/pkg/sql/flowinfra/flow.go
Lines 446 to 448 in 37dee54
cockroach/pkg/sql/colflow/vectorized_flow.go
Lines 244 to 246 in 37dee54
cockroach/pkg/sql/distsql_running.go
Lines 547 to 549 in 37dee54
cockroach/pkg/sql/distsql_running.go
Lines 1288 to 1290 in 37dee54
cockroach/pkg/sql/apply_join.go
Lines 317 to 319 in 37dee54
cockroach/pkg/sql/recursive_cte.go
Lines 128 to 130 in 37dee54
cockroach/pkg/sql/plan_node_to_row_source.go
Lines 186 to 188 in 37dee54
cockroach/pkg/sql/colexec/columnarizer.go
Lines 221 to 223 in 37dee54
cockroach/pkg/sql/colflow/stats.go
Lines 97 to 99 in 37dee54
v21.2.7
Jira issue: CRDB-14021
The text was updated successfully, but these errors were encountered: