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

sql: pg_statistic_ext crashes with statistics with no names #93430

Closed
jordanlewis opened this issue Dec 12, 2022 · 0 comments · Fixed by #93274
Closed

sql: pg_statistic_ext crashes with statistics with no names #93430

jordanlewis opened this issue Dec 12, 2022 · 0 comments · Fixed by #93274
Assignees
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-pg-regress Originated from the pg_regress test suite. S-2-temp-unavailability Temp crashes or other availability problems. Can be worked around or resolved by restarting. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@jordanlewis
Copy link
Member

jordanlewis commented Dec 12, 2022

The following sequence of commands crashes the DB on 22.2:

CREATE TABLE a(a) AS generate_series(1,100);
ANALYZE a;
SELECT * FROM pg_statistic_ext
[email protected]:26257/defaultdb> create table a (a) as select generate_series(1,100);                                                                                                                      CREATE TABLE AS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               Time: 18ms total (execution 18ms / network 0ms)                                                                                                                                                                                                                                                                                                                                                                     [email protected]:26257/defaultdb> analyze a;                                                                                                                                                                ANALYZE                                                                                                                                                                                                   

Time: 15ms total (execution 15ms / network 0ms)

[email protected]:26257/defaultdb> select * from pg_statistic_ext;
*
* ERROR: a panic has occurred!
* expected *DString, found tree.dNull
* (1) attached stack trace
*   -- stack trace:
*   | runtime.gopanic
*   |   GOROOT/src/runtime/panic.go:884
*   | [...repeated from below...]
* Wraps: (2) assertion failure
* Wraps: (3) attached stack trace
*   -- stack trace:
*   | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.MustBeDString
*   |   github.com/cockroachdb/cockroach/pkg/sql/sem/tree/datum.go:1228
*   | github.com/cockroachdb/cockroach/pkg/sql.glob..func244
*   |   github.com/cockroachdb/cockroach/pkg/sql/pg_catalog.go:3431
*   | github.com/cockroachdb/cockroach/pkg/sql.(*virtualDefEntry).getPlanInfo.func1.1
*   |   github.com/cockroachdb/cockroach/pkg/sql/virtual_schema.go:572
*   | 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:489
*   | runtime.goexit
*   |   GOROOT/src/runtime/asm_amd64.s:1594
* Wraps: (4) expected *DString, found tree.dNull
* Error types: (1) *withstack.withStack (2) *assert.withAssertionFailure (3) *withstack.withStack (4) *errutil.leafError
* ```

Jira issue: CRDB-22397




Epic CRDB-23454
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-pg-regress Originated from the pg_regress test suite. S-2-temp-unavailability Temp crashes or other availability problems. Can be worked around or resolved by restarting. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants