Skip to content

Commit

Permalink
Merge #71079
Browse files Browse the repository at this point in the history
71079: Added SET LOCAL syntax diagram; Updated SET SESSION syntax diagram r=ericharmeling a=ericharmeling

Syntax diagram updates for cockroachdb/docs#11874

Release note: None

Co-authored-by: Eric Harmeling <[email protected]>
  • Loading branch information
craig[bot] and ericharmeling committed Oct 7, 2021
2 parents 617beac + fc2e5ca commit f612208
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 24 deletions.
1 change: 0 additions & 1 deletion docs/generated/sql/bnf/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ genrule(
"set_session_stmt.bnf",
"set_transaction.bnf",
"set_transaction_stmt.bnf",
"set_var.bnf",
"show_backup.bnf",
"show_cluster_setting.bnf",
"show_columns_stmt.bnf",
Expand Down
3 changes: 2 additions & 1 deletion docs/generated/sql/bnf/set_local_stmt.bnf
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
set_local_stmt ::=
'SET' 'LOCAL' set_rest
'SET' 'LOCAL' var_name '=' var_value ( ( ',' var_value ) )*
| 'SET' 'LOCAL' var_name 'TO' var_value ( ( ',' var_value ) )*
7 changes: 4 additions & 3 deletions docs/generated/sql/bnf/set_session_stmt.bnf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set_session_stmt ::=
'SET' 'SESSION' set_rest_more
| 'SET' set_rest_more
| 'SET' 'SESSION' 'CHARACTERISTICS' 'AS' 'TRANSACTION' transaction_mode_list
'SET' 'SESSION' var_name '=' var_value ( ( ',' var_value ) )*
| 'SET' 'SESSION' var_name 'TO' var_value ( ( ',' var_value ) )*
| 'SET' var_name '=' var_value ( ( ',' var_value ) )*
| 'SET' var_name 'TO' var_value ( ( ',' var_value ) )*
6 changes: 0 additions & 6 deletions docs/generated/sql/bnf/set_var.bnf

This file was deleted.

22 changes: 9 additions & 13 deletions pkg/cmd/docgen/diagrams.go
Original file line number Diff line number Diff line change
Expand Up @@ -1190,21 +1190,17 @@ var specs = []stmtSpec{
nosplit: true,
},
{
name: "set_var",
stmt: "preparable_set_stmt",
inline: []string{"set_session_stmt", "set_rest_more", "generic_set", "var_list", "to_or_eq"},
name: "set_session_stmt",
stmt: "set_session_stmt",
exclude: []*regexp.Regexp{
regexp.MustCompile(`'SET' . 'TRANSACTION'`),
regexp.MustCompile(`'SET' 'TRANSACTION'`),
regexp.MustCompile(`'SET' 'SESSION' var_name`),
regexp.MustCompile(`'SET' 'SESSION' 'TRANSACTION'`),
regexp.MustCompile(`'SET' 'SESSION' 'CHARACTERISTICS'`),
regexp.MustCompile("'SET' 'CLUSTER'"),
},
replace: map[string]string{
"'=' 'DEFAULT'": "'=' 'DEFAULT' | 'SET' 'TIME' 'ZONE' ( var_value | 'DEFAULT' | 'LOCAL' )",
"'SET' var_name": "'SET' ( 'SESSION' | ) var_name",
regexp.MustCompile("'CHARACTERISTICS' 'AS' 'TRANSACTION' transaction_mode_list"),
},
inline: []string{"set_rest_more", "set_rest", "generic_set", "var_list", "to_or_eq"},
},
{
name: "set_local_stmt",
stmt: "set_local_stmt",
inline: []string{"set_rest", "generic_set", "var_list", "to_or_eq"},
},
{
name: "set_cluster_setting",
Expand Down

0 comments on commit f612208

Please sign in to comment.