cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.19k stars 3.82k forks source link

sql/tests: TestRandomSyntaxSchemaChangeColumn failed [expected element collection size 1, not 2] #134753

Open cockroach-teamcity opened 2 weeks ago

cockroach-teamcity commented 2 weeks ago

This issue was initially opened for v23.2.15, but the issue filer is now using this for a failure on master. See the latest comments.

Click for the original failure sql/tests.TestRandomSyntaxSchemaChangeColumn [failed](https://teamcity.cockroachdb.com/buildConfiguration/Cockroach_Nightlies_RandomSyntaxTestsBazel/17671371?buildTab=log) with [artifacts](https://teamcity.cockroachdb.com/buildConfiguration/Cockroach_Nightlies_RandomSyntaxTestsBazel/17671371?buildTab=artifacts#/) on release-23.2.15-rc @ [26288c52c45180e56d308694a41dcebccda467ce](https://github.com/cockroachdb/cockroach/commits/26288c52c45180e56d308694a41dcebccda467ce): Random syntax error: ``` rsg_test.go:962: Crash detected: server panic: pq: internal error: building declarative schema change targets for ALTER TABLE: unresolved name inside annotated AST (error) ``` Query: ``` ALTER TABLE ident.ident1 ADD COLUMN IF NOT EXISTS ident FORMAT ARRAY CREATE FAMILY CONSTRAINT OUT ON UPDATE ARRAY ( TABLE error ) [ : ]; ```

See also: [How To Investigate a Go Test Failure \(internal\)](https://cockroachlabs.atlassian.net/l/c/HgfXfJgM)

/cc @cockroachdb/sql-foundations [This test on roachdash](https://roachdash.crdb.dev/?filter=status:open%20t:.*TestRandomSyntaxSchemaChangeColumn.*&sort=title+created&display=lastcommented+project) | [Improve this report!](https://github.com/cockroachdb/cockroach/tree/master/pkg/cmd/internal/issues)

Jira issue: CRDB-44214

annrpom commented 2 weeks ago

[triage meeting] Let's see if this repros on 23.2.15; if it doesn't we should just close this.

annrpom commented 1 week ago

We do end up hitting the panic in the following :

-- create table ident.ident1(i int);

demo@127.0.0.1:26257/demoapp/movr> create table ident1(i int, ident int);                            
CREATE TABLE

Time: 8ms total (execution 7ms / network 1ms)

demo@127.0.0.1:26257/demoapp/movr> ALTER TABLE ident1 ADD COLUMN IF NOT EXISTS ident FORMAT ARRAY    
                                -> CREATE FAMILY CONSTRAINT OUT ON UPDATE ARRAY ( TABLE error ) [ :  
                                -> ]; 
ERROR: internal error: building declarative schema change targets for ALTER TABLE: unresolved name inside annotated AST (error)
SQLSTATE: XX000
DETAIL: stack trace:
github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/ast_annotator.go:80: func1()
github.com/cockroachdb/cockroach/pkg/sql/sem/tree/table_name.go:27: Format()
github.com/cockroachdb/cockroach/pkg/sql/sem/tree/format.go:759: formatNodeMaybeMarkRedaction()
github.com/cockroachdb/cockroach/pkg/sql/sem/tree/format.go:533: FormatNode()
github.com/cockroachdb/cockroach/pkg/sql/sem/tree/select.go:599: Format()
github.com/cockroachdb/cockroach/pkg/sql/sem/tree/format.go:759: formatNodeMaybeMarkRedaction()
github.com/cockroachdb/cockroach/pkg/sql/sem/tree/format.go:533: FormatNode()
github.com/cockroachdb/cockroach/pkg/sql/sem/tree/select.go:102: Format()
github.com/cockroachdb/cockroach/pkg/sql/sem/tree/format.go:759: formatNodeMaybeMarkRedaction()

This bug exists up until master as well

cockroach-teamcity commented 2 days ago

sql/tests.TestRandomSyntaxSchemaChangeColumn failed with artifacts on master @ f717f6bd218121bb5e3376af658545f6bff30c22:

Random syntax error:

    rsg_test.go:964: Crash detected: server panic: pq: internal error: building declarative schema change targets for ALTER TABLE: expected element collection size 1, not 2

Query:

        ALTER TABLE ident.ident6 ALTER GREATEST SET DATA TYPE INTERVAL HOUR ARRAY [ 402 ];
Help

See also: [How To Investigate a Go Test Failure \(internal\)](https://cockroachlabs.atlassian.net/l/c/HgfXfJgM)

This test on roachdash | Improve this report!

cockroach-teamcity commented 20 hours ago

sql/tests.TestRandomSyntaxSchemaChangeColumn failed with artifacts on master @ 97965d4a2a614f2ac7fc9b10e6b5f4a92ed1d502:

Random syntax error:

    rsg_test.go:964: Crash detected: server panic: pq: internal error: building declarative schema change targets for ALTER TABLE: expected element collection size 1, not 2

Query:

        ALTER TABLE ident.ident6 ALTER BOOLEAN SET DATA TYPE CHAR ARRAY;
Help

See also: [How To Investigate a Go Test Failure \(internal\)](https://cockroachlabs.atlassian.net/l/c/HgfXfJgM)

This test on roachdash | Improve this report!

rafiss commented 5 hours ago

The latest failures seem specific to master, which also means it may be specific to the new ALTER COLUMN ... SET TYPE implementation. cc @spilchen