Skip to content

Commit

Permalink
docgen: update savepoint-related definitions, bnfs
Browse files Browse the repository at this point in the history
This change updates the syntax diagram definitions and generated BNF for
several SAVEPOINT-related statements, specifically:

- Add the SHOW SAVEPOINT STATUS statement to the list of syntax diagrams
  generated by pkg/cmd/docgen

- Add the SHOW SAVEPOINT STATUS BNF file to the other generated BNF
  files

- Update ROLLBACK TO SAVEPOINT to note that the savepoint name does not
  have to be 'cockroach_restart'

It uses the changes in #45794, which enabled docgen for SHOW SAVEPOINT
STATUS.

It is part of the work surrounding #45566, which added preliminary SQL
savepoints support.

Release justification: low-risk update to documentation diagrams

Release note: None
  • Loading branch information
rmloveland committed Mar 13, 2020
1 parent 0373c81 commit b967d1a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/generated/sql/bnf/rollback_transaction.bnf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rollback_stmt ::=
'ROLLBACK'
| 'ROLLBACK'
| 'ROLLBACK' 'TO' 'SAVEPOINT' cockroach_restart
| 'ROLLBACK' 'TO' 'SAVEPOINT' cockroach_restart
| 'ROLLBACK' 'TO' 'SAVEPOINT' savepoint_name
| 'ROLLBACK' 'TO' 'SAVEPOINT' savepoint_name
2 changes: 2 additions & 0 deletions docs/generated/sql/bnf/show_savepoint_status.bnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
show_savepoint_stmt ::=
'SHOW' 'SAVEPOINT' 'STATUS'
8 changes: 6 additions & 2 deletions pkg/cmd/docgen/diagrams.go
Original file line number Diff line number Diff line change
Expand Up @@ -1012,8 +1012,7 @@ var specs = []stmtSpec{
stmt: "rollback_stmt",
inline: []string{"opt_transaction"},
match: []*regexp.Regexp{regexp.MustCompile("'ROLLBACK'")},
replace: map[string]string{"'TRANSACTION'": "", "'TO'": "'TO' 'SAVEPOINT'", "savepoint_name": "cockroach_restart"},
unlink: []string{"cockroach_restart"},
replace: map[string]string{"'TRANSACTION'": "", "'TO'": "'TO' 'SAVEPOINT'"},
},
{
name: "limit_clause",
Expand Down Expand Up @@ -1264,6 +1263,11 @@ var specs = []stmtSpec{
stmt: "show_stmt",
match: []*regexp.Regexp{regexp.MustCompile("'SHOW' 'TRANSACTION'")},
},
{
name: "show_savepoint_status",
stmt: "show_savepoint_stmt",
match: []*regexp.Regexp{regexp.MustCompile("'SHOW' 'SAVEPOINT' 'STATUS'")},
},
{
name: "show_users",
stmt: "show_stmt",
Expand Down

0 comments on commit b967d1a

Please sign in to comment.