Skip to content

Commit

Permalink
Merge #40258 #43075
Browse files Browse the repository at this point in the history
40258: Diagram changes for documentation r=ericharmeling a=ericharmeling

Added changes to `diagrams.go` for the following statements:
- `SHOW PARTITIONS`
- `SHOW LOCALITY` (this change is a little hacky due to the fact that `SHOW LOCALITY` is, in fact, not defined in the SQL grammar... see #39058)
- `SHOW CREATE TABLE AS`
- `SHOW COLUMNS` (`WITH COMMENT`)
- `SHOW DATABASES` (`WITH COMMENT`)

@mjibson Adding you as reviewer because you created this generator.

Release note (docs): none

43075: roachtest: update Hibernate and psycopg blacklists r=rafiss a=rafiss

Hibernate now has no expected failures with our dialect, and psycopg has
one fewer expected failure.

closes #42819
closes #42434 

Release note: None

Co-authored-by: Eric Harmeling <eric.harmeling@cockroachlabs.com>
Co-authored-by: Rafi Shamim <rafi@cockroachlabs.com>
  • Loading branch information
3 people committed Dec 10, 2019
3 parents 59acbdd + 67184b6 + 56396d4 commit 06dd5b2
Show file tree
Hide file tree
Showing 19 changed files with 116 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comment_stmt ::=
'COMMENT' 'ON' 'DATABASE' database_name 'IS' comment_text
| 'COMMENT' 'ON' 'TABLE' table_name 'IS' comment_text
| 'COMMENT' 'ON' 'COLUMN' column_path 'IS' comment_text
| 'COMMENT' 'ON' 'COLUMN' column_name 'IS' comment_text
| 'COMMENT' 'ON' 'INDEX' table_index_name 'IS' comment_text
2 changes: 2 additions & 0 deletions docs/generated/sql/bnf/create_as_col_qual_list.bnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
create_as_col_qual_list ::=
( ( ( ( 'PRIMARY' 'KEY' ) | 'FAMILY' family_name ) ) )*
2 changes: 2 additions & 0 deletions docs/generated/sql/bnf/create_as_constraint_def.bnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
create_as_constraint_def ::=
'PRIMARY' 'KEY' '(' create_as_params ')'
6 changes: 4 additions & 2 deletions docs/generated/sql/bnf/create_table_as_stmt.bnf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
create_table_as_stmt ::=
'CREATE' opt_temp_create_table 'TABLE' table_name create_as_opt_col_list 'AS' select_stmt
| 'CREATE' opt_temp_create_table 'TABLE' 'IF' 'NOT' 'EXISTS' table_name create_as_opt_col_list 'AS' select_stmt
'CREATE' opt_temp_create_table 'TABLE' table_name '(' column_name create_as_col_qual_list ( ( ',' column_name create_as_col_qual_list | ',' family_def | ',' create_as_constraint_def ) )* ')' 'AS' select_stmt
| 'CREATE' opt_temp_create_table 'TABLE' table_name 'AS' select_stmt
| 'CREATE' opt_temp_create_table 'TABLE' 'IF' 'NOT' 'EXISTS' table_name '(' column_name create_as_col_qual_list ( ( ',' column_name create_as_col_qual_list | ',' family_def | ',' create_as_constraint_def ) )* ')' 'AS' select_stmt
| 'CREATE' opt_temp_create_table 'TABLE' 'IF' 'NOT' 'EXISTS' table_name 'AS' select_stmt
2 changes: 2 additions & 0 deletions docs/generated/sql/bnf/explain_analyze_stmt.bnf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
explain_stmt ::=
'EXPLAIN' 'ANALYZE' preparable_stmt
| 'EXPLAIN' 'ANALYSE' preparable_stmt
| 'EXPLAIN' 'ANALYZE' '(' 'DISTSQL' ')' preparable_stmt
| 'EXPLAIN' 'ANALYSE' '(' 'DISTSQL' ')' preparable_stmt
4 changes: 1 addition & 3 deletions docs/generated/sql/bnf/explain_stmt.bnf
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
explain_stmt ::=
'EXPLAIN' preparable_stmt
| 'EXPLAIN' '(' ( 'VERBOSE' | 'TYPES' | 'OPT' | 'DISTSQL' ) ( ( ',' ( 'VERBOSE' | 'TYPES' | 'OPT' | 'DISTSQL' ) ) )* ')' preparable_stmt
| 'EXPLAIN' 'ANALYSE' preparable_stmt
| 'EXPLAIN' 'ANALYSE' '(' ( 'VERBOSE' | 'TYPES' | 'OPT' | 'DISTSQL' ) ( ( ',' ( 'VERBOSE' | 'TYPES' | 'OPT' | 'DISTSQL' ) ) )* ')' preparable_stmt
| 'EXPLAIN' '(' ( 'VERBOSE' | 'TYPES' | 'OPT' | 'DISTSQL' | 'VEC' ) ( ( ',' ( 'VERBOSE' | 'TYPES' | 'OPT' | 'DISTSQL' | 'VEC' ) ) )* ')' preparable_stmt
7 changes: 7 additions & 0 deletions docs/generated/sql/bnf/opt_frame_clause.bnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
opt_frame_clause ::=
'RANGE' frame_bound opt_frame_exclusion
| 'RANGE' 'BETWEEN' frame_bound 'AND' frame_bound opt_frame_exclusion
| 'ROWS' frame_bound opt_frame_exclusion
| 'ROWS' 'BETWEEN' frame_bound 'AND' frame_bound opt_frame_exclusion
| 'GROUPS' frame_bound opt_frame_exclusion
| 'GROUPS' 'BETWEEN' frame_bound 'AND' frame_bound opt_frame_exclusion
3 changes: 3 additions & 0 deletions docs/generated/sql/bnf/show_columns_stmt.bnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
show_columns_stmt ::=
'SHOW' 'COLUMNS' 'FROM' table_name 'WITH' 'COMMENT'
| 'SHOW' 'COLUMNS' 'FROM' table_name
3 changes: 3 additions & 0 deletions docs/generated/sql/bnf/show_databases_stmt.bnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
show_databases_stmt ::=
'SHOW' 'DATABASES' 'WITH' 'COMMENT'
| 'SHOW' 'DATABASES'
7 changes: 7 additions & 0 deletions docs/generated/sql/bnf/show_indexes.bnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
show_indexes_stmt ::=
'SHOW' 'INDEX' 'FROM' table_name with_comment
| 'SHOW' 'INDEX' 'FROM' 'DATABASE' database_name with_comment
| 'SHOW' 'INDEXES' 'FROM' table_name with_comment
| 'SHOW' 'INDEXES' 'FROM' 'DATABASE' database_name with_comment
| 'SHOW' 'KEYS' 'FROM' table_name with_comment
| 'SHOW' 'KEYS' 'FROM' 'DATABASE' database_name with_comment
2 changes: 2 additions & 0 deletions docs/generated/sql/bnf/show_locality.bnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
show_roles_stmt ::=
'SHOW' 'LOCALITY'
5 changes: 5 additions & 0 deletions docs/generated/sql/bnf/show_partitions_stmt.bnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
show_partitions_stmt ::=
'SHOW' 'PARTITIONS' 'FROM' 'TABLE' table_name
| 'SHOW' 'PARTITIONS' 'FROM' 'DATABASE' database_name
| 'SHOW' 'PARTITIONS' 'FROM' 'INDEX' table_index_name
| 'SHOW' 'PARTITIONS' 'FROM' 'INDEX' table_name '@' '*'
3 changes: 3 additions & 0 deletions docs/generated/sql/bnf/show_range_for_row_stmt.bnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
show_range_for_row_stmt ::=
'SHOW' 'RANGE' 'FROM' 'TABLE' table_name 'FOR' 'ROW' '(' row_vals ( ( ',' row_vals ) )* ')'
| 'SHOW' 'RANGE' 'FROM' 'INDEX' table_index_name 'FOR' 'ROW' '(' row_vals ( ( ',' row_vals ) )* ')'
5 changes: 5 additions & 0 deletions docs/generated/sql/bnf/unsplit_index_at.bnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
alter_unsplit_index_stmt ::=
'ALTER' 'INDEX' table_name '@' index_name 'UNSPLIT' 'AT' select_stmt
| 'ALTER' 'INDEX' standalone_index_name 'UNSPLIT' 'AT' select_stmt
| 'ALTER' 'INDEX' table_name '@' index_name 'UNSPLIT' 'ALL'
| 'ALTER' 'INDEX' standalone_index_name 'UNSPLIT' 'ALL'
3 changes: 3 additions & 0 deletions docs/generated/sql/bnf/unsplit_table_at.bnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
alter_unsplit_stmt ::=
'ALTER' 'TABLE' table_name 'UNSPLIT' 'AT' select_stmt
| 'ALTER' 'TABLE' table_name 'UNSPLIT' 'ALL'
2 changes: 2 additions & 0 deletions docs/generated/sql/bnf/window_definition.bnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
window_definition ::=
window_name 'AS' '(' opt_existing_window_name opt_partition_clause opt_sort_clause opt_frame_clause ')'
77 changes: 62 additions & 15 deletions pkg/cmd/docgen/diagrams.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,10 @@ var specs = []stmtSpec{
inline: []string{"col_qualification_elem"},
},
{
name: "comment_stmt",
stmt: "comment_stmt",
unlink: []string{"column_path"},
name: "comment",
stmt: "comment_stmt",
replace: map[string]string{"column_path": "column_name"},
unlink: []string{"column_path"},
},
{
name: "commit_transaction",
Expand All @@ -495,6 +496,14 @@ var specs = []stmtSpec{
replace: map[string]string{"a_expr": "job_id"},
unlink: []string{"job_id"},
},
{
name: "create_as_col_qual_list",
inline: []string{"create_as_col_qualification", "create_as_col_qualification_elem"},
},
{
name: "create_as_constraint_def",
inline: []string{"create_as_constraint_elem"},
},
{name: "cancel_query", stmt: "cancel_queries_stmt", replace: map[string]string{"a_expr": "query_id"}, unlink: []string{"query_id"}},
{name: "cancel_session", stmt: "cancel_sessions_stmt", replace: map[string]string{"a_expr": "session_id"}, unlink: []string{"session_id"}},
{name: "create_database_stmt", inline: []string{"opt_encoding_clause"}, replace: map[string]string{"'SCONST'": "encoding"}, unlink: []string{"name", "encoding"}},
Expand Down Expand Up @@ -563,7 +572,7 @@ var specs = []stmtSpec{
},
{
name: "create_table_as_stmt",
inline: []string{"opt_column_list", "name_list"},
inline: []string{"create_as_opt_col_list", "create_as_table_defs"},
},
{
name: "create_table_stmt",
Expand Down Expand Up @@ -729,14 +738,17 @@ var specs = []stmtSpec{
name: "explain_stmt",
inline: []string{"explain_option_list"},
replace: map[string]string{
"explain_option_name": "( 'VERBOSE' | 'TYPES' | 'OPT' | 'DISTSQL' )",
"explain_option_name": "( 'VERBOSE' | 'TYPES' | 'OPT' | 'DISTSQL' | 'VEC' )",
},
exclude: []*regexp.Regexp{
regexp.MustCompile("'ANALYZE'"),
regexp.MustCompile("'ANALYSE'"),
},
exclude: []*regexp.Regexp{regexp.MustCompile("'ANALYZE'")},
},
{
name: "explain_analyze_stmt",
stmt: "explain_stmt",
match: []*regexp.Regexp{regexp.MustCompile("ANALYZE")},
match: []*regexp.Regexp{regexp.MustCompile("'ANALY[SZ]E'")},
replace: map[string]string{
"explain_option_list": "'DISTSQL'",
},
Expand Down Expand Up @@ -1115,11 +1127,8 @@ var specs = []stmtSpec{
stmt: "show_csettings_stmt",
},
{
name: "show_columns",
stmt: "show_stmt",
match: []*regexp.Regexp{regexp.MustCompile("'SHOW' 'COLUMNS'")},
replace: map[string]string{"var_name": "table_name"},
unlink: []string{"table_name"},
name: "show_columns_stmt",
inline: []string{"with_comment"},
},
{
name: "show_constraints",
Expand All @@ -1134,9 +1143,8 @@ var specs = []stmtSpec{
unlink: []string{"object_name"},
},
{
name: "show_databases",
stmt: "show_stmt",
match: []*regexp.Regexp{regexp.MustCompile("'SHOW' 'DATABASES'")},
name: "show_databases_stmt",
inline: []string{"with_comment"},
},
{
name: "show_backup",
Expand All @@ -1160,6 +1168,10 @@ var specs = []stmtSpec{
},
unlink: []string{"role_name", "table_name", "database_name", "user_name"},
},
{
name: "show_indexes",
stmt: "show_indexes_stmt",
},
{
name: "show_index",
stmt: "show_stmt",
Expand All @@ -1172,6 +1184,14 @@ var specs = []stmtSpec{
stmt: "show_stmt",
match: []*regexp.Regexp{regexp.MustCompile("'SHOW' 'KEYS'")},
},
{
name: "show_locality",
stmt: "show_roles_stmt",
replace: map[string]string{"'ROLES'": "'LOCALITY'"},
},
{
name: "show_partitions_stmt",
},
{
name: "show_queries",
stmt: "show_queries_stmt",
Expand All @@ -1184,6 +1204,13 @@ var specs = []stmtSpec{
name: "show_ranges_stmt",
stmt: "show_ranges_stmt",
},
{
name: "show_range_for_row_stmt",
stmt: "show_range_for_row_stmt",
inline: []string{"expr_list"},
replace: map[string]string{"a_expr": "row_vals"},
unlink: []string{"row_vals"},
},
{
name: "show_schemas",
stmt: "show_schemas_stmt",
Expand Down Expand Up @@ -1266,6 +1293,18 @@ var specs = []stmtSpec{
replace: map[string]string{" stmt": " 'CREATE' 'TABLE' table_name '(' ( column_def ( ',' column_def )* ) ( 'CONSTRAINT' name | ) 'UNIQUE' '(' ( column_name ( ',' column_name )* ) ')' ( table_constraints | ) ')'"},
unlink: []string{"table_name", "check_expr", "table_constraints"},
},
{
name: "unsplit_index_at",
stmt: "alter_unsplit_index_stmt",
inline: []string{"table_index_name"},
replace: map[string]string{"qualified_name": "table_name", "'@' name": "'@' index_name"},
unlink: []string{"table_name", "index_name"},
},
{
name: "unsplit_table_at",
stmt: "alter_unsplit_stmt",
unlink: []string{"table_name"},
},
{
name: "update_stmt",
inline: []string{
Expand Down Expand Up @@ -1313,6 +1352,14 @@ var specs = []stmtSpec{
replace: map[string]string{"alter_table_cmds": "'VALIDATE' 'CONSTRAINT' constraint_name", "relation_expr": "table_name"},
unlink: []string{"constraint_name", "table_name"},
},
{
name: "window_definition",
inline: []string{"window_specification"},
},
{
name: "opt_frame_clause",
inline: []string{"frame_extent"},
},
}

// regList is a common regex used when removing loops from alter and drop
Expand Down
10 changes: 2 additions & 8 deletions pkg/cmd/roachtest/hibernate_blacklist.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,9 @@ var hibernateBlacklists = blacklistsForVersion{
// Please keep these lists alphabetized for easy diffing.
// After a failed run, an updated version of this blacklist should be available
// in the test log.
var hibernateBlackList20_1 = blacklist{
"org.hibernate.query.GroupByAliasTest.testCompoundIdAlias": "failing on Postgres",
"org.hibernate.query.GroupByAliasTest.testMultiIdAlias": "failing on Postgres",
}
var hibernateBlackList20_1 = blacklist{}

var hibernateBlackList19_2 = blacklist{
"org.hibernate.query.GroupByAliasTest.testCompoundIdAlias": "failing on Postgres",
"org.hibernate.query.GroupByAliasTest.testMultiIdAlias": "failing on Postgres",
}
var hibernateBlackList19_2 = blacklist{}

var hibernateBlackList19_1 = blacklist{
"org.hibernate.jpa.test.indetifier.AssignedInitialValueTableGeneratorConfiguredTest.testTheFirstGeneratedIdIsEqualToTableGeneratorInitialValuePlusOne": "6583",
Expand Down
1 change: 0 additions & 1 deletion pkg/cmd/roachtest/psycopg_blacklist.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ var psycopgBlackList20_1 = blacklist{
"tests.test_transaction.TransactionTests.test_rollback": "5807",
"tests.test_types_basic.TypesBasicTests.testArray": "32552",
"tests.test_types_basic.TypesBasicTests.testArrayOfNulls": "32552",
"tests.test_types_basic.TypesBasicTests.testEmptyArray": "23299",
"tests.test_types_basic.TypesBasicTests.testEmptyArrayRegression": "36179",
"tests.test_types_basic.TypesBasicTests.testNestedArrays": "32552",
"tests.test_types_basic.TypesBasicTests.testNestedEmptyArray": "32552",
Expand Down

0 comments on commit 06dd5b2

Please sign in to comment.