Skip to content

Commit

Permalink
Merge pull request #63499 from rytaft/backport21.1-63493
Browse files Browse the repository at this point in the history
release-21.1: sql,docs: hide UNIQUE WITHOUT INDEX from the docs
  • Loading branch information
rytaft authored Apr 13, 2021
2 parents 89c16b1 + 14f356f commit cf1a794
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
4 changes: 2 additions & 2 deletions docs/generated/sql/bnf/col_qualification.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ col_qualification ::=
'CONSTRAINT' constraint_name 'NOT' 'NULL'
| 'CONSTRAINT' constraint_name 'NULL'
| 'CONSTRAINT' constraint_name 'NOT' 'VISIBLE'
| 'CONSTRAINT' constraint_name 'UNIQUE' opt_without_index
| 'CONSTRAINT' constraint_name 'UNIQUE'
| 'CONSTRAINT' constraint_name 'PRIMARY' 'KEY'
| 'CONSTRAINT' constraint_name 'PRIMARY' 'KEY' 'USING' 'HASH' 'WITH' 'BUCKET_COUNT' '=' n_buckets
| 'CONSTRAINT' constraint_name 'CHECK' '(' a_expr ')'
Expand All @@ -15,7 +15,7 @@ col_qualification ::=
| 'NOT' 'NULL'
| 'NULL'
| 'NOT' 'VISIBLE'
| 'UNIQUE' opt_without_index
| 'UNIQUE'
| 'PRIMARY' 'KEY'
| 'PRIMARY' 'KEY' 'USING' 'HASH' 'WITH' 'BUCKET_COUNT' '=' n_buckets
| 'CHECK' '(' a_expr ')'
Expand Down
8 changes: 2 additions & 6 deletions docs/generated/sql/bnf/stmt_block.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -2388,7 +2388,7 @@ constraint_name ::=

constraint_elem ::=
'CHECK' '(' a_expr ')'
| 'UNIQUE' opt_without_index '(' index_params ')' opt_storing opt_interleave opt_partition_by_index opt_where_clause
| 'UNIQUE' '(' index_params ')' opt_storing opt_interleave opt_partition_by_index opt_where_clause
| 'PRIMARY' 'KEY' '(' index_params ')' opt_hash_sharded opt_interleave
| 'FOREIGN' 'KEY' '(' name_list ')' 'REFERENCES' table_name opt_column_list key_match reference_actions

Expand Down Expand Up @@ -2679,10 +2679,6 @@ col_qualification ::=
| 'CREATE' 'FAMILY'
| 'CREATE' 'IF' 'NOT' 'EXISTS' 'FAMILY' family_name

opt_without_index ::=
'WITHOUT' 'INDEX'
|

key_match ::=
'MATCH' 'SIMPLE'
| 'MATCH' 'FULL'
Expand Down Expand Up @@ -2927,7 +2923,7 @@ col_qualification_elem ::=
'NOT' 'NULL'
| 'NULL'
| 'NOT' 'VISIBLE'
| 'UNIQUE' opt_without_index
| 'UNIQUE'
| 'PRIMARY' 'KEY'
| 'PRIMARY' 'KEY' 'USING' 'HASH' 'WITH' 'BUCKET_COUNT' '=' a_expr
| 'CHECK' '(' a_expr ')'
Expand Down
16 changes: 8 additions & 8 deletions docs/generated/sql/bnf/table_constraint.bnf
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
table_constraint ::=
'CONSTRAINT' constraint_name 'CHECK' '(' a_expr ')'
| 'CONSTRAINT' constraint_name 'UNIQUE' opt_without_index '(' index_params ')' 'COVERING' '(' name_list ')' opt_interleave opt_partition_by_index opt_where_clause
| 'CONSTRAINT' constraint_name 'UNIQUE' opt_without_index '(' index_params ')' 'STORING' '(' name_list ')' opt_interleave opt_partition_by_index opt_where_clause
| 'CONSTRAINT' constraint_name 'UNIQUE' opt_without_index '(' index_params ')' 'INCLUDE' '(' name_list ')' opt_interleave opt_partition_by_index opt_where_clause
| 'CONSTRAINT' constraint_name 'UNIQUE' opt_without_index '(' index_params ')' opt_interleave opt_partition_by_index opt_where_clause
| 'CONSTRAINT' constraint_name 'UNIQUE' '(' index_params ')' 'COVERING' '(' name_list ')' opt_interleave opt_partition_by_index opt_where_clause
| 'CONSTRAINT' constraint_name 'UNIQUE' '(' index_params ')' 'STORING' '(' name_list ')' opt_interleave opt_partition_by_index opt_where_clause
| 'CONSTRAINT' constraint_name 'UNIQUE' '(' index_params ')' 'INCLUDE' '(' name_list ')' opt_interleave opt_partition_by_index opt_where_clause
| 'CONSTRAINT' constraint_name 'UNIQUE' '(' index_params ')' opt_interleave opt_partition_by_index opt_where_clause
| 'CONSTRAINT' constraint_name 'PRIMARY' 'KEY' '(' index_params ')' 'USING' 'HASH' 'WITH' 'BUCKET_COUNT' '=' n_buckets opt_interleave
| 'CONSTRAINT' constraint_name 'PRIMARY' 'KEY' '(' index_params ')' opt_interleave
| 'CONSTRAINT' constraint_name 'FOREIGN' 'KEY' '(' name_list ')' 'REFERENCES' table_name opt_column_list key_match reference_actions
| 'CHECK' '(' a_expr ')'
| 'UNIQUE' opt_without_index '(' index_params ')' 'COVERING' '(' name_list ')' opt_interleave opt_partition_by_index opt_where_clause
| 'UNIQUE' opt_without_index '(' index_params ')' 'STORING' '(' name_list ')' opt_interleave opt_partition_by_index opt_where_clause
| 'UNIQUE' opt_without_index '(' index_params ')' 'INCLUDE' '(' name_list ')' opt_interleave opt_partition_by_index opt_where_clause
| 'UNIQUE' opt_without_index '(' index_params ')' opt_interleave opt_partition_by_index opt_where_clause
| 'UNIQUE' '(' index_params ')' 'COVERING' '(' name_list ')' opt_interleave opt_partition_by_index opt_where_clause
| 'UNIQUE' '(' index_params ')' 'STORING' '(' name_list ')' opt_interleave opt_partition_by_index opt_where_clause
| 'UNIQUE' '(' index_params ')' 'INCLUDE' '(' name_list ')' opt_interleave opt_partition_by_index opt_where_clause
| 'UNIQUE' '(' index_params ')' opt_interleave opt_partition_by_index opt_where_clause
| 'PRIMARY' 'KEY' '(' index_params ')' 'USING' 'HASH' 'WITH' 'BUCKET_COUNT' '=' n_buckets opt_interleave
| 'PRIMARY' 'KEY' '(' index_params ')' opt_interleave
| 'FOREIGN' 'KEY' '(' name_list ')' 'REFERENCES' table_name opt_column_list key_match reference_actions
7 changes: 4 additions & 3 deletions pkg/sql/parser/sql.y
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,7 @@ alter_ddl_stmt:
// ALTER TABLE ... SET LOCALITY [REGIONAL BY [TABLE IN <region> | ROW] | GLOBAL]
//
// Column qualifiers:
// [CONSTRAINT <constraintname>] {NULL | NOT NULL | UNIQUE [WITHOUT INDEX] | PRIMARY KEY | CHECK (<expr>) | DEFAULT <expr>}
// [CONSTRAINT <constraintname>] {NULL | NOT NULL | UNIQUE | PRIMARY KEY | CHECK (<expr>) | DEFAULT <expr>}
// FAMILY <familyname>, CREATE [IF NOT EXISTS] FAMILY [<familyname>]
// REFERENCES <tablename> [( <colnames...> )]
// COLLATE <collationname>
Expand Down Expand Up @@ -5850,11 +5850,11 @@ alter_schema_stmt:
// Table constraints:
// PRIMARY KEY ( <colnames...> ) [USING HASH WITH BUCKET_COUNT = <shard_buckets>]
// FOREIGN KEY ( <colnames...> ) REFERENCES <tablename> [( <colnames...> )] [ON DELETE {NO ACTION | RESTRICT}] [ON UPDATE {NO ACTION | RESTRICT}]
// UNIQUE [WITHOUT INDEX] ( <colnames... ) [{STORING | INCLUDE | COVERING} ( <colnames...> )] [<interleave>]
// UNIQUE ( <colnames... ) [{STORING | INCLUDE | COVERING} ( <colnames...> )] [<interleave>]
// CHECK ( <expr> )
//
// Column qualifiers:
// [CONSTRAINT <constraintname>] {NULL | NOT NULL | NOT VISIBLE |UNIQUE [WITHOUT INDEX] | PRIMARY KEY | CHECK (<expr>) | DEFAULT <expr>}
// [CONSTRAINT <constraintname>] {NULL | NOT NULL | NOT VISIBLE | UNIQUE | PRIMARY KEY | CHECK (<expr>) | DEFAULT <expr>}
// FAMILY <familyname>, CREATE [IF NOT EXISTS] FAMILY [<familyname>]
// REFERENCES <tablename> [( <colnames...> )] [ON DELETE {NO ACTION | RESTRICT}] [ON UPDATE {NO ACTION | RESTRICT}]
// COLLATE <collationname>
Expand Down Expand Up @@ -6411,6 +6411,7 @@ col_qualification_elem:
opt_without_index:
WITHOUT INDEX
{
/* SKIP DOC */
$$.val = true
}
| /* EMPTY */
Expand Down

0 comments on commit cf1a794

Please sign in to comment.