Skip to content

sql/logictest: reveal error details if present#35827

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20190316-logictest-details
Mar 16, 2019
Merged

sql/logictest: reveal error details if present#35827
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20190316-logictest-details

Conversation

@knz
Copy link
Copy Markdown
Contributor

@knz knz commented Mar 16, 2019

Before:

testdata/logic_test/assertion_error:4:
expected success, but found
crdb_internal.force_assertion_error(): internal error: woo

After (for example, after #35820 is separately applied):

testdata/logic_test/assertion_error:4:
expected success, but found
(XX000) crdb_internal.force_assertion_error(): internal error: woo
sql/sem/builtins/builtins.go:2815: in func211()
DETAIL: stack trace:
github.com/cockroachdb/cockroach/pkg/sql/sem/builtins/builtins.go:2815: in func211()
github.com/cockroachdb/cockroach/pkg/sql/sem/tree/eval.go:3651: in Eval()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/expr.go:196: in eval()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/processors.go:375: in ProcessRow()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/processors.go:778: in ProcessRowHelper()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/values.go:126: in Next()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/base.go:174: in Run()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/processors.go:801: in Run()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/flow.go:627: in Run()
github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:252: in Run()
github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:839: in PlanAndRun()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:1112: in execWithDistSQLEngine()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:948: in dispatchToExecutionEngine()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:456: in execStmtInOpenState()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:102: in execStmt()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1178: in run()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:429: in ServeConn()
github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:337: in func4()

NOTE: internal errors may have more details in log. Use -show-logs.

Release note: None

Before:

```
testdata/logic_test/assertion_error:4:
expected success, but found
crdb_internal.force_assertion_error(): internal error: woo
```

After (for example, after cockroachdb#35820 is separately applied):

```
testdata/logic_test/assertion_error:4:
expected success, but found
(XX000) crdb_internal.force_assertion_error(): internal error: woo
sql/sem/builtins/builtins.go:2815: in func211()
DETAIL: stack trace:
github.com/cockroachdb/cockroach/pkg/sql/sem/builtins/builtins.go:2815: in func211()
github.com/cockroachdb/cockroach/pkg/sql/sem/tree/eval.go:3651: in Eval()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/expr.go:196: in eval()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/processors.go:375: in ProcessRow()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/processors.go:778: in ProcessRowHelper()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/values.go:126: in Next()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/base.go:174: in Run()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/processors.go:801: in Run()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/flow.go:627: in Run()
github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:252: in Run()
github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:839: in PlanAndRun()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:1112: in execWithDistSQLEngine()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:948: in dispatchToExecutionEngine()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:456: in execStmtInOpenState()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:102: in execStmt()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1178: in run()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:429: in ServeConn()
github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:337: in func4()

NOTE: internal errors may have more details in log. Use -show-logs.
```

Release note: None
@knz knz requested review from a team and RaduBerinde March 16, 2019 13:12
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@andy-kimball andy-kimball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:, thanks for doing this, will make it much nicer to debug.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @andy-kimball and @RaduBerinde)

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Mar 16, 2019

you're welcome!

bors r+

craig bot pushed a commit that referenced this pull request Mar 16, 2019
35827: sql/logictest: reveal error details if present r=knz a=knz

Before:

```
testdata/logic_test/assertion_error:4:
expected success, but found
crdb_internal.force_assertion_error(): internal error: woo
```

After (for example, after #35820 is separately applied):

```
testdata/logic_test/assertion_error:4:
expected success, but found
(XX000) crdb_internal.force_assertion_error(): internal error: woo
sql/sem/builtins/builtins.go:2815: in func211()
DETAIL: stack trace:
github.com/cockroachdb/cockroach/pkg/sql/sem/builtins/builtins.go:2815: in func211()
github.com/cockroachdb/cockroach/pkg/sql/sem/tree/eval.go:3651: in Eval()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/expr.go:196: in eval()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/processors.go:375: in ProcessRow()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/processors.go:778: in ProcessRowHelper()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/values.go:126: in Next()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/base.go:174: in Run()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/processors.go:801: in Run()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/flow.go:627: in Run()
github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:252: in Run()
github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:839: in PlanAndRun()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:1112: in execWithDistSQLEngine()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:948: in dispatchToExecutionEngine()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:456: in execStmtInOpenState()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:102: in execStmt()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1178: in run()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:429: in ServeConn()
github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:337: in func4()

NOTE: internal errors may have more details in log. Use -show-logs.
```

Release note: None

Co-authored-by: Raphael 'kena' Poss <knz@cockroachlabs.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 16, 2019

Build succeeded

@craig craig bot merged commit 5515bde into cockroachdb:master Mar 16, 2019
@knz knz deleted the 20190316-logictest-details branch March 16, 2019 20:56
@RaduBerinde
Copy link
Copy Markdown
Member

Thank you! Easier to read than panic stacktraces too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants