Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
79129: docs: add or update alter changefeed diagram r=ericharmeling a=kathancox

Release note: None

79150: sqlutils: don't panic on nil err r=dt a=dt

Release note: none.

Co-authored-by: Kathryn Hancox <[email protected]>
Co-authored-by: David Taylor <[email protected]>
  • Loading branch information
3 people committed Apr 1, 2022
3 parents cfae482 + d9be120 + 9d732b6 commit fa02911
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/generated/sql/bnf/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FILES = [
"abort_stmt",
"add_column",
"add_constraint",
"alter_changefeed_stmt",
"alter_changefeed",
"alter_backup_stmt",
"alter_column",
"alter_database_add_region_stmt",
Expand Down
2 changes: 2 additions & 0 deletions docs/generated/sql/bnf/alter_changefeed.bnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter_changefeed_stmt ::=
'ALTER' 'CHANGEFEED' job_id ( 'ADD' 'target' ( 'WITH' ( 'initial_scan' | 'no_initial_scan' ) )? | 'DROP' 'target' | ( 'SET' | 'UNSET' ) 'option' )+
2 changes: 0 additions & 2 deletions docs/generated/sql/bnf/alter_changefeed_stmt.bnf

This file was deleted.

5 changes: 5 additions & 0 deletions pkg/cmd/docgen/diagrams.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,11 @@ var specs = []stmtSpec{
replace: map[string]string{"relation_expr": "table_name", "alter_table_cmds": "'ADD' 'CONSTRAINT' constraint_name constraint_elem opt_validate_behavior"},
unlink: []string{"table_name"},
},
{
name: "alter_changefeed",
stmt: "alter_changefeed_stmt",
replace: map[string]string{"a_expr": "job_id", "alter_changefeed_cmds": "( 'ADD' 'target' ( 'WITH' ( 'initial_scan' | 'no_initial_scan' ) )? | 'DROP' 'target' | ( 'SET' | 'UNSET' ) 'option' )+"},
},
{
name: "alter_column",
stmt: "alter_onetable_stmt",
Expand Down
2 changes: 1 addition & 1 deletion pkg/gen/docs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ DOCS_SRCS = [
"//docs/generated/sql/bnf:add_column.bnf",
"//docs/generated/sql/bnf:add_constraint.bnf",
"//docs/generated/sql/bnf:alter_backup_stmt.bnf",
"//docs/generated/sql/bnf:alter_changefeed_stmt.bnf",
"//docs/generated/sql/bnf:alter_changefeed.bnf",
"//docs/generated/sql/bnf:alter_column.bnf",
"//docs/generated/sql/bnf:alter_database_add_region_stmt.bnf",
"//docs/generated/sql/bnf:alter_database_add_super_region.bnf",
Expand Down
6 changes: 5 additions & 1 deletion pkg/testutils/sqlutils/sql_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ func (sr *SQLRunner) ExpectErr(t testutils.TB, errRE string, query string, args
t.Helper()
_, err := sr.DB.ExecContext(context.Background(), query, args...)
if !testutils.IsError(err, errRE) {
t.Fatalf("expected error '%s', got: %s", errRE, pgerror.FullError(err))
s := "nil"
if err != nil {
s = pgerror.FullError(err)
}
t.Fatalf("expected error '%s', got: %s", errRE, s)
}
}

Expand Down

0 comments on commit fa02911

Please sign in to comment.