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

pkg/ccl/testccl/sqlccl/sqlccl_test: TestShowCreateRedactableValues failed #108894

Closed
cockroach-teamcity opened this issue Aug 17, 2023 · 3 comments
Assignees
Labels
C-test-failure Broken test (automatically or manually discovered). O-robot Originated from a bot. O-rsg Random Syntax Generator T-sql-queries SQL Queries Team
Milestone

Comments

@cockroach-teamcity
Copy link
Member

cockroach-teamcity commented Aug 17, 2023

pkg/ccl/testccl/sqlccl/sqlccl_test.TestShowCreateRedactableValues failed with artifacts on release-23.1.9-rc @ 8970df10ccd36578aa106f67cd34d4e57460a342:

Fatal error:

panic: ReturnType called on TypedExpr with empty typeAnnotation. Was the underlying Expr type-checked before asserting a type of TypedExpr? [recovered]
	panic: ReturnType called on TypedExpr with empty typeAnnotation. Was the underlying Expr type-checked before asserting a type of TypedExpr?

Stack:

goroutine 43032 [running]:
github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).recover(0xc009ceecb8?, {0x7425e00, 0xc00564e720})
	github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:229 +0x6a
panic({0x5878ce0, 0xc004104b80})
	GOROOT/src/runtime/panic.go:884 +0x212
github.com/cockroachdb/cockroach/pkg/sql/sem/tree.typeAnnotation.assertTyped(...)
	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/expr.go:152
github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*Subquery).TypeCheck(0xc002ba5198?, {0x7444560?, 0xc003bd1290?}, 0xc0080d4c00?, 0x73f7ea8?)
	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/type_check.go:1503 +0xe5
github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*CastExpr).TypeCheck(0xc003bd12c0, {0x7425e00, 0xc00564e720}, 0xc002ba5180, 0x0?)
	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/type_check.go:583 +0x251
github.com/cockroachdb/cockroach/pkg/sql/catalog/schemaexpr.deserializeExprForFormatting({0x7425e00, 0xc00564e720}, {0x74f8510, 0xc005964500}, {0xc007655580?, 0x3d?}, 0xc007655580?, 0x48000)
	github.com/cockroachdb/cockroach/pkg/sql/catalog/schemaexpr/expr.go:339 +0xd6
github.com/cockroachdb/cockroach/pkg/sql/catalog/schemaexpr.formatExprForDisplayImpl({0x7425e00, 0xc00564e720}, {0x74f8510?, 0xc005964500?}, {0xc007655580?, 0x4?}, 0x158?, 0xc00320d880, 0x1752b17?, 0x0)
	github.com/cockroachdb/cockroach/pkg/sql/catalog/schemaexpr/expr.go:294 +0x6b
github.com/cockroachdb/cockroach/pkg/sql/catalog/schemaexpr.FormatExprForDisplay(...)
	github.com/cockroachdb/cockroach/pkg/sql/catalog/schemaexpr/expr.go:251
github.com/cockroachdb/cockroach/pkg/sql.formatViewQueryTypesForDisplay.func1({0x7443958?, 0xc003bd1020})
	github.com/cockroachdb/cockroach/pkg/sql/show_create_clauses.go:271 +0x165
github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*simpleVisitor).VisitPre(0xc009025020, {0x7443958, 0xc003bd1020})
	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:2005 +0x46
github.com/cockroachdb/cockroach/pkg/sql/sem/tree.WalkExpr({0x73f95f0, 0xc009025020}, {0x7443958?, 0xc003bd1020})
	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:831 +0x5a
github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*ComparisonExpr).Walk(0xc002001d60, {0x73f95f0, 0xc009025020})
	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:191 +0x3d
github.com/cockroachdb/cockroach/pkg/sql/sem/tree.WalkExpr({0x73f95f0, 0xc009025020}, {0x7443a70?, 0xc002001d60})
	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:834 +0x77
github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*SelectClause).walkStmt(0xc005eea960, {0x73f95f0, 0xc009025020})
	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:1702 +0x135
github.com/cockroachdb/cockroach/pkg/sql/sem/tree.walkStmt({0x73f95f0, 0xc009025020}, {0x7451f80?, 0xc005eea960})
	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:1990 +0x5d
github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*Select).walkStmt(0xc002001f40, {0x73f95f0, 0xc009025020})
	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:1606 +0x7d
github.com/cockroachdb/cockroach/pkg/sql/sem/tree.walkStmt({0x73f95f0, 0xc009025020}, {0x7451f40?, 0xc002001f40})
	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:1990 +0x5d
github.com/cockroachdb/cockroach/pkg/sql/sem/tree.SimpleStmtVisit({0x7451f40, 0xc002001f40}, 0xc0080d4400)
	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:2037 +0x85
github.com/cockroachdb/cockroach/pkg/sql.formatViewQueryTypesForDisplay({0x7425e00?, 0xc00564e720}, 0xc002ba5180, 0xc00320d880, {0x74f8510?, 0xc005964500})
	github.com/cockroachdb/cockroach/pkg/sql/show_create_clauses.go:290 +0x1d6
github.com/cockroachdb/cockroach/pkg/sql.formatViewQueryForDisplay({0x7425e00, 0xc00564e720}, 0x80?, 0x203002?, {0x74f8510, 0xc005964500}, {0x60, 0x4, 0x0, 0x1, ...})
	github.com/cockroachdb/cockroach/pkg/sql/show_create_clauses.go:175 +0x192
github.com/cockroachdb/cockroach/pkg/sql.ShowCreateView({0x7425e00, 0xc00564e720}, 0x38a3073?, 0x61e24f0?, 0x7f74039d5008?, {0x74f8510, 0xc005964500}, 0x0)
	github.com/cockroachdb/cockroach/pkg/sql/show_create_clauses.go:144 +0x29f
github.com/cockroachdb/cockroach/pkg/sql.glob..func66({0x7425e00, 0xc00564e720}, 0xc002ba4e40, {{0xc00620e150?, 0x65?}}, {0x74c7000, 0xc0066044d0}, {0x74c4ae8, 0xc0096c1860}, {0x74f8510, ...}, ...)
	github.com/cockroachdb/cockroach/pkg/sql/crdb_internal.go:3401 +0x425
github.com/cockroachdb/cockroach/pkg/sql.makeAllRelationsVirtualTableWithDescriptorIDIndex.func1.1({0x74c7000?, 0xc0066044d0?}, {0x74c4ae8?, 0xc0096c1860?}, {0x74f8510?, 0xc005964500?}, 0xc0066044d0?)
	github.com/cockroachdb/cockroach/pkg/sql/pg_catalog.go:1107 +0xcf
github.com/cockroachdb/cockroach/pkg/sql.forEachTableDescWithTableLookupInternalFromDescriptors({0x7425e00, 0xc00564e720}, 0xc002ba4e40, {0x74c7000, 0xc00522d810}, 0x1, 0x0?, {{0xc006b0b060}, {0xc006b0b0a0}, 0x5d38a}, ...)
	github.com/cockroachdb/cockroach/pkg/sql/information_schema.go:2657 +0x5a3
github.com/cockroachdb/cockroach/pkg/sql.forEachTableDescWithTableLookupInternal({0x7425e00, 0xc00564e720}, 0xc002ba4e40, {0x74c7000?, 0xc00522d810}, 0x7f74047b38e0?, 0x40?, 0x7f74308e43c8?)
	github.com/cockroachdb/cockroach/pkg/sql/information_schema.go:2530 +0x145
github.com/cockroachdb/cockroach/pkg/sql.forEachTableDescWithTableLookup(...)
	github.com/cockroachdb/cockroach/pkg/sql/information_schema.go:2501
github.com/cockroachdb/cockroach/pkg/sql.makeAllRelationsVirtualTableWithDescriptorIDIndex.func1({0x7425e00, 0xc00564e720}, 0xc002ba4e40, {0x74c7000, 0xc00522d810}, 0xc00426b1c0)
	github.com/cockroachdb/cockroach/pkg/sql/pg_catalog.go:1105 +0x125
github.com/cockroachdb/cockroach/pkg/sql.(*virtualDefEntry).getPlanInfo.func1.1({0x7425e00, 0xc00564e720}, {0x73ea5a0?, 0xc0073d0860})
	github.com/cockroachdb/cockroach/pkg/sql/virtual_schema.go:678 +0x196
github.com/cockroachdb/cockroach/pkg/sql.setupGenerator.func3({0x7425e00, 0xc00564e720})
	github.com/cockroachdb/cockroach/pkg/sql/virtual_table.go:127 +0x114
github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2()
	github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:470 +0x146
created by github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTaskEx
	github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:461 +0x43b
Log preceding fatal error

*   | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/schemaexpr/expr.go:251
*   | github.com/cockroachdb/cockroach/pkg/sql.formatViewQueryTypesForDisplay.func1
*   | 	github.com/cockroachdb/cockroach/pkg/sql/show_create_clauses.go:271
*   | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*simpleVisitor).VisitPre
*   | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:2005
*   | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.WalkExpr
*   | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:831
*   | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*ComparisonExpr).Walk
*   | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:191
*   | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.WalkExpr
*   | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:834
*   | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*SelectClause).walkStmt
*   | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:1702
*   | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.walkStmt
*   | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:1990
*   | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*Select).walkStmt
*   | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:1606
*   | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.walkStmt
*   | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:1990
*   | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.SimpleStmtVisit
*   | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:2037
*   | github.com/cockroachdb/cockroach/pkg/sql.formatViewQueryTypesForDisplay
*   | 	github.com/cockroachdb/cockroach/pkg/sql/show_create_clauses.go:290
*   | github.com/cockroachdb/cockroach/pkg/sql.formatViewQueryForDisplay
*   | 	github.com/cockroachdb/cockroach/pkg/sql/show_create_clauses.go:175
*   | github.com/cockroachdb/cockroach/pkg/sql.ShowCreateView
*   | 	github.com/cockroachdb/cockroach/pkg/sql/show_create_clauses.go:144
*   | github.com/cockroachdb/cockroach/pkg/sql.glob..func66
*   | 	github.com/cockroachdb/cockroach/pkg/sql/crdb_internal.go:3401
*   | github.com/cockroachdb/cockroach/pkg/sql.makeAllRelationsVirtualTableWithDescriptorIDIndex.func1.1
*   | 	github.com/cockroachdb/cockroach/pkg/sql/pg_catalog.go:1107
*   | github.com/cockroachdb/cockroach/pkg/sql.forEachTableDescWithTableLookupInternalFromDescriptors
*   | 	github.com/cockroachdb/cockroach/pkg/sql/information_schema.go:2657
*   | github.com/cockroachdb/cockroach/pkg/sql.forEachTableDescWithTableLookupInternal
*   | 	github.com/cockroachdb/cockroach/pkg/sql/information_schema.go:2530
*   | github.com/cockroachdb/cockroach/pkg/sql.forEachTableDescWithTableLookup
*   | 	github.com/cockroachdb/cockroach/pkg/sql/information_schema.go:2501
*   | github.com/cockroachdb/cockroach/pkg/sql.makeAllRelationsVirtualTableWithDescriptorIDIndex.func1
*   | 	github.com/cockroachdb/cockroach/pkg/sql/pg_catalog.go:1105
*   | github.com/cockroachdb/cockroach/pkg/sql.(*virtualDefEntry).getPlanInfo.func1.1
*   | 	github.com/cockroachdb/cockroach/pkg/sql/virtual_schema.go:678
*   | github.com/cockroachdb/cockroach/pkg/sql.setupGenerator.func3
*   | 	github.com/cockroachdb/cockroach/pkg/sql/virtual_table.go:127
*   | github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2
*   | 	github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:470
*   | runtime.goexit
*   | 	GOROOT/src/runtime/asm_amd64.s:1594
* Wraps: (4) ReturnType called on TypedExpr with empty typeAnnotation. Was the underlying Expr type-checked before asserting a type of TypedExpr?
* Error types: (1) *withstack.withStack (2) *assert.withAssertionFailure (3) *withstack.withStack (4) *errutil.leafError
*

Parameters: TAGS=bazel,gss

Help

See also: How To Investigate a Go Test Failure (internal)

/cc @cockroachdb/sql-queries

This test on roachdash | Improve this report!

Jira issue: CRDB-30692

@cockroach-teamcity cockroach-teamcity added branch-release-23.1.9-rc C-test-failure Broken test (automatically or manually discovered). O-robot Originated from a bot. labels Aug 17, 2023
@cockroach-teamcity cockroach-teamcity added this to the 23.1 milestone Aug 17, 2023
@blathers-crl blathers-crl bot added the T-sql-queries SQL Queries Team label Aug 17, 2023
@github-project-automation github-project-automation bot moved this to Triage in SQL Queries Aug 17, 2023
@yuzefovich yuzefovich moved this from Triage to Active in SQL Queries Aug 22, 2023
@mgartner
Copy link
Collaborator

This is a duplicate of #105259 and #107654. It's been partially fixed on release-23.1 by #106868 and should be fully fixed by the backport of #108188, which should merge soon.

Here's a logic test that produces the same error and stacktrace:

statement ok
CREATE TYPE t AS ENUM ('foo')

statement ok
CREATE VIEW v AS SELECT (SELECT 'foo')::t

query T
SHOW CREATE VIEW v
----

@mgartner
Copy link
Collaborator

I'll need to backport #108188 to release-23.1.9-rc.

@mgartner
Copy link
Collaborator

Closed by #109331.

@github-project-automation github-project-automation bot moved this from Active to Done in SQL Queries Aug 23, 2023
@michae2 michae2 added the O-rsg Random Syntax Generator label Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-test-failure Broken test (automatically or manually discovered). O-robot Originated from a bot. O-rsg Random Syntax Generator T-sql-queries SQL Queries Team
Projects
Archived in project
Development

No branches or pull requests

3 participants