From 14f356fe6d24edc41ed8538605b6dc543e8e8ce6 Mon Sep 17 00:00:00 2001 From: Rebecca Taft Date: Mon, 12 Apr 2021 16:07:27 -0500 Subject: [PATCH] sql,docs: hide UNIQUE WITHOUT INDEX from the docs This commit hides UNIQUE WITHOUT INDEX from all documentation since we do not want users to try to use this experimental feature. Release note (general change): We hid UNIQUE WITHOUT INDEX from all documentation since we do not want users to try to use this experimental feature. --- docs/generated/sql/bnf/col_qualification.bnf | 4 ++-- docs/generated/sql/bnf/stmt_block.bnf | 8 ++------ docs/generated/sql/bnf/table_constraint.bnf | 16 ++++++++-------- pkg/sql/parser/sql.y | 7 ++++--- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/docs/generated/sql/bnf/col_qualification.bnf b/docs/generated/sql/bnf/col_qualification.bnf index 33edfea78587..434cba8896a7 100644 --- a/docs/generated/sql/bnf/col_qualification.bnf +++ b/docs/generated/sql/bnf/col_qualification.bnf @@ -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 ')' @@ -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 ')' diff --git a/docs/generated/sql/bnf/stmt_block.bnf b/docs/generated/sql/bnf/stmt_block.bnf index 5412a4387075..24a2c163fc54 100644 --- a/docs/generated/sql/bnf/stmt_block.bnf +++ b/docs/generated/sql/bnf/stmt_block.bnf @@ -2386,7 +2386,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 @@ -2677,10 +2677,6 @@ col_qualification ::= | 'CREATE' 'FAMILY' | 'CREATE' 'IF' 'NOT' 'EXISTS' 'FAMILY' family_name -opt_without_index ::= - 'WITHOUT' 'INDEX' - | - key_match ::= 'MATCH' 'SIMPLE' | 'MATCH' 'FULL' @@ -2925,7 +2921,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 ')' diff --git a/docs/generated/sql/bnf/table_constraint.bnf b/docs/generated/sql/bnf/table_constraint.bnf index 10c48ff605cd..2b8830c5bc7f 100644 --- a/docs/generated/sql/bnf/table_constraint.bnf +++ b/docs/generated/sql/bnf/table_constraint.bnf @@ -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 diff --git a/pkg/sql/parser/sql.y b/pkg/sql/parser/sql.y index 15d6490dc96e..a10cef175a88 100644 --- a/pkg/sql/parser/sql.y +++ b/pkg/sql/parser/sql.y @@ -1381,7 +1381,7 @@ alter_ddl_stmt: // ALTER TABLE ... SET LOCALITY [REGIONAL BY [TABLE IN | ROW] | GLOBAL] // // Column qualifiers: -// [CONSTRAINT ] {NULL | NOT NULL | UNIQUE [WITHOUT INDEX] | PRIMARY KEY | CHECK () | DEFAULT } +// [CONSTRAINT ] {NULL | NOT NULL | UNIQUE | PRIMARY KEY | CHECK () | DEFAULT } // FAMILY , CREATE [IF NOT EXISTS] FAMILY [] // REFERENCES [( )] // COLLATE @@ -5844,11 +5844,11 @@ alter_schema_stmt: // Table constraints: // PRIMARY KEY ( ) [USING HASH WITH BUCKET_COUNT = ] // FOREIGN KEY ( ) REFERENCES [( )] [ON DELETE {NO ACTION | RESTRICT}] [ON UPDATE {NO ACTION | RESTRICT}] -// UNIQUE [WITHOUT INDEX] ( )] [] +// UNIQUE ( )] [] // CHECK ( ) // // Column qualifiers: -// [CONSTRAINT ] {NULL | NOT NULL | NOT VISIBLE |UNIQUE [WITHOUT INDEX] | PRIMARY KEY | CHECK () | DEFAULT } +// [CONSTRAINT ] {NULL | NOT NULL | NOT VISIBLE | UNIQUE | PRIMARY KEY | CHECK () | DEFAULT } // FAMILY , CREATE [IF NOT EXISTS] FAMILY [] // REFERENCES [( )] [ON DELETE {NO ACTION | RESTRICT}] [ON UPDATE {NO ACTION | RESTRICT}] // COLLATE @@ -6405,6 +6405,7 @@ col_qualification_elem: opt_without_index: WITHOUT INDEX { + /* SKIP DOC */ $$.val = true } | /* EMPTY */