Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: use 'NONVOTERS' as keyword for 'RELOCATE', not 'NON_VOTERS' #73802

Merged
merged 3 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/generated/sql/bnf/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ FILES = [
"alter_index_stmt",
"alter_partition_stmt",
"alter_primary_key",
"alter_range_relocate_lease_stmt",
"alter_range_relocate_stmt",
"alter_range_stmt",
"alter_rename_view_stmt",
Expand Down
3 changes: 0 additions & 3 deletions docs/generated/sql/bnf/alter_range_relocate_lease_stmt.bnf

This file was deleted.

8 changes: 5 additions & 3 deletions docs/generated/sql/bnf/alter_range_relocate_stmt.bnf
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
alter_range_relocate_stmt ::=
'ALTER' 'RANGE' relocate_kw voters_kw 'FROM' iconst64 'TO' iconst64 'FOR' select_stmt
'ALTER' 'RANGE' relocate_kw 'LEASE' 'TO' iconst64 'FOR' select_stmt
| 'ALTER' 'RANGE' iconst64 relocate_kw 'LEASE' 'TO' iconst64
| 'ALTER' 'RANGE' relocate_kw voters_kw 'FROM' iconst64 'TO' iconst64 'FOR' select_stmt
| 'ALTER' 'RANGE' iconst64 relocate_kw voters_kw 'FROM' iconst64 'TO' iconst64
| 'ALTER' 'RANGE' relocate_kw 'NON_VOTERS' 'FROM' iconst64 'TO' iconst64 'FOR' select_stmt
| 'ALTER' 'RANGE' iconst64 relocate_kw 'NON_VOTERS' 'FROM' iconst64 'TO' iconst64
| 'ALTER' 'RANGE' relocate_kw 'NONVOTERS' 'FROM' iconst64 'TO' iconst64 'FOR' select_stmt
| 'ALTER' 'RANGE' iconst64 relocate_kw 'NONVOTERS' 'FROM' iconst64 'TO' iconst64
1 change: 0 additions & 1 deletion docs/generated/sql/bnf/alter_range_stmt.bnf
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
alter_range_stmt ::=
alter_zone_range_stmt
| alter_range_relocate_lease_stmt
| alter_range_relocate_stmt
13 changes: 5 additions & 8 deletions docs/generated/sql/bnf/stmt_block.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ unreserved_keyword ::=
| 'NOCONTROLJOB'
| 'NOLOGIN'
| 'NOMODIFYCLUSTERSETTING'
| 'NON_VOTERS'
| 'NONVOTERS'
| 'NOVIEWACTIVITY'
| 'NOWAIT'
| 'NULLS'
Expand Down Expand Up @@ -1354,7 +1354,6 @@ alter_database_stmt ::=

alter_range_stmt ::=
alter_zone_range_stmt
| alter_range_relocate_lease_stmt
| alter_range_relocate_stmt

alter_partition_stmt ::=
Expand Down Expand Up @@ -1846,15 +1845,13 @@ alter_database_primary_region_stmt ::=
alter_zone_range_stmt ::=
'ALTER' 'RANGE' zone_name set_zone_config

alter_range_relocate_lease_stmt ::=
alter_range_relocate_stmt ::=
'ALTER' 'RANGE' relocate_kw 'LEASE' 'TO' iconst64 'FOR' select_stmt
| 'ALTER' 'RANGE' iconst64 relocate_kw 'LEASE' 'TO' iconst64

alter_range_relocate_stmt ::=
'ALTER' 'RANGE' relocate_kw voters_kw 'FROM' iconst64 'TO' iconst64 'FOR' select_stmt
| 'ALTER' 'RANGE' relocate_kw voters_kw 'FROM' iconst64 'TO' iconst64 'FOR' select_stmt
| 'ALTER' 'RANGE' iconst64 relocate_kw voters_kw 'FROM' iconst64 'TO' iconst64
| 'ALTER' 'RANGE' relocate_kw 'NON_VOTERS' 'FROM' iconst64 'TO' iconst64 'FOR' select_stmt
| 'ALTER' 'RANGE' iconst64 relocate_kw 'NON_VOTERS' 'FROM' iconst64 'TO' iconst64
| 'ALTER' 'RANGE' relocate_kw 'NONVOTERS' 'FROM' iconst64 'TO' iconst64 'FOR' select_stmt
| 'ALTER' 'RANGE' iconst64 relocate_kw 'NONVOTERS' 'FROM' iconst64 'TO' iconst64

alter_zone_partition_stmt ::=
'ALTER' 'PARTITION' partition_name 'OF' 'TABLE' table_name set_zone_config
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/kvccl/kvfollowerreadsccl/followerreads_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ func TestFollowerReadsWithStaleDescriptor(t *testing.T) {
// Remove the follower and add a new non-voter to n3. n2 will no longer have a
// replica.
n1.Exec(t, `ALTER TABLE test EXPERIMENTAL_RELOCATE VOTERS VALUES (ARRAY[1], 1)`)
n1.Exec(t, `ALTER TABLE test EXPERIMENTAL_RELOCATE NON_VOTERS VALUES (ARRAY[3], 1)`)
n1.Exec(t, `ALTER TABLE test EXPERIMENTAL_RELOCATE NONVOTERS VALUES (ARRAY[3], 1)`)

// Execute the query again and assert the cache is updated. This query will
// not be executed as a follower read since it attempts to use n2 which
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/opt/optbuilder/testdata/alter_range
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ALTER RANGE RELOCATE FROM 1 TO 2 FOR SELECT c from abc
error (42601): RELOCATE data column 1 (range ids) must be of type int, not type string

build
ALTER RANGE 1 RELOCATE NON_VOTERS FROM 1 TO 2
ALTER RANGE 1 RELOCATE NONVOTERS FROM 1 TO 2
----
alter-range-relocate &{false true 2 1 [3 4 5] []}
├── columns: range_id:3 pretty:4 result:5
Expand All @@ -42,7 +42,7 @@ alter-range-relocate &{false true 2 1 [3 4 5] []}
└── (1,)

build
ALTER RANGE RELOCATE NON_VOTERS FROM 1 TO 2 FOR SELECT a from abc
ALTER RANGE RELOCATE NONVOTERS FROM 1 TO 2 FOR SELECT a from abc
----
alter-range-relocate &{false true 2 1 [3 4 5] []}
├── columns: range_id:3 pretty:4 result:5
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/opt/optbuilder/testdata/alter_table
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ alter-table-relocate abc [voters]
└── (ARRAY[4], 2)

build
ALTER TABLE abc EXPERIMENTAL_RELOCATE NON_VOTERS VALUES (ARRAY[1,2,3], 1), (ARRAY[4], 2)
ALTER TABLE abc EXPERIMENTAL_RELOCATE NONVOTERS VALUES (ARRAY[1,2,3], 1), (ARRAY[4], 2)
----
alter-table-relocate abc [non-voters]
├── columns: key:1 pretty:2
Expand Down Expand Up @@ -167,7 +167,7 @@ alter-table-relocate abc@bc [voters]
└── (ARRAY[6,7,8], 2, 'bar')

build
ALTER INDEX abc@bc EXPERIMENTAL_RELOCATE NON_VOTERS VALUES (ARRAY[5], 1, 'foo'), (ARRAY[6,7,8], 2, 'bar')
ALTER INDEX abc@bc EXPERIMENTAL_RELOCATE NONVOTERS VALUES (ARRAY[5], 1, 'foo'), (ARRAY[6,7,8], 2, 'bar')
----
alter-table-relocate abc@bc [non-voters]
├── columns: key:1 pretty:2
Expand Down
60 changes: 25 additions & 35 deletions pkg/sql/parser/sql.y
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ func (u *sqlSymUnion) setVar() *tree.SetVar {

%token <str> NAN NAME NAMES NATURAL NEVER NEW_DB_NAME NEXT NO NOCANCELQUERY NOCONTROLCHANGEFEED
%token <str> NOCONTROLJOB NOCREATEDB NOCREATELOGIN NOCREATEROLE NOLOGIN NOMODIFYCLUSTERSETTING
%token <str> NO_INDEX_JOIN NO_ZIGZAG_JOIN NO_FULL_SCAN NONE NON_VOTERS NORMAL NOT NOTHING NOTNULL
%token <str> NO_INDEX_JOIN NO_ZIGZAG_JOIN NO_FULL_SCAN NONE NONVOTERS NORMAL NOT NOTHING NOTNULL
%token <str> NOVIEWACTIVITY NOWAIT NULL NULLIF NULLS NUMERIC

%token <str> OF OFF OFFSET OID OIDS OIDVECTOR ON ONLY OPT OPTION OPTIONS OR
Expand Down Expand Up @@ -903,7 +903,6 @@ func (u *sqlSymUnion) setVar() *tree.SetVar {

// ALTER RANGE
%type <tree.Statement> alter_zone_range_stmt
%type <tree.Statement> alter_range_relocate_lease_stmt
%type <tree.Statement> alter_range_relocate_stmt

// ALTER TABLE
Expand All @@ -913,7 +912,6 @@ func (u *sqlSymUnion) setVar() *tree.SetVar {
%type <tree.Statement> alter_rename_table_stmt
%type <tree.Statement> alter_scatter_stmt
%type <tree.Statement> alter_relocate_stmt
%type <tree.Statement> alter_relocate_lease_stmt
%type <tree.Statement> alter_zone_table_stmt
%type <tree.Statement> alter_table_set_schema_stmt
%type <tree.Statement> alter_table_locality_stmt
Expand Down Expand Up @@ -941,7 +939,6 @@ func (u *sqlSymUnion) setVar() *tree.SetVar {
%type <tree.Statement> alter_unsplit_index_stmt
%type <tree.Statement> alter_rename_index_stmt
%type <tree.Statement> alter_relocate_index_stmt
%type <tree.Statement> alter_relocate_index_lease_stmt
%type <tree.Statement> alter_zone_index_stmt

// ALTER VIEW
Expand Down Expand Up @@ -1553,6 +1550,7 @@ alter_ddl_stmt:
// ALTER TABLE ... UNSPLIT ALL
// ALTER TABLE ... SCATTER [ FROM ( <exprs...> ) TO ( <exprs...> ) ]
// ALTER TABLE ... INJECT STATISTICS ... (experimental)
// ALTER TABLE ... RELOCATE [ LEASE | VOTERS | NONVOTERS ] FOR <selectclause> (experimental)
// ALTER TABLE ... PARTITION BY RANGE ( <name...> ) ( <rangespec> )
// ALTER TABLE ... PARTITION BY LIST ( <name...> ) ( <listspec> )
// ALTER TABLE ... PARTITION BY NOTHING
Expand All @@ -1576,7 +1574,6 @@ alter_ddl_stmt:
alter_table_stmt:
alter_onetable_stmt
| alter_relocate_stmt
| alter_relocate_lease_stmt
| alter_split_stmt
| alter_unsplit_stmt
| alter_scatter_stmt
Expand Down Expand Up @@ -1781,10 +1778,10 @@ alter_database_primary_region_stmt:
//
// Commands:
// ALTER RANGE ... CONFIGURE ZONE <zoneconfig>
// ALTER RANGE RELOCATE from <store_id> to <store_id> FOR <selectclause>
// ALTER RANGE r RELOCATE from <store_id> to <store_id>
// ALTER RANGE RELOCATE LEASE to <store_id> FOR <selectclause>
// ALTER RANGE r RELOCATE LEASE to <store_id>
// ALTER RANGE RELOCATE { VOTERS | NONVOTERS } FROM <store_id> TO <store_id> FOR <selectclause>
// ALTER RANGE r RELOCATE { VOTERS | NONVOTERS } FROM <store_id> TO <store_id>
// ALTER RANGE RELOCATE LEASE TO <store_id> FOR <selectclause>
// ALTER RANGE r RELOCATE LEASE TO <store_id>
//
// Zone configurations:
// DISCARD
Expand All @@ -1795,7 +1792,6 @@ alter_database_primary_region_stmt:
// %SeeAlso: ALTER TABLE
alter_range_stmt:
alter_zone_range_stmt
| alter_range_relocate_lease_stmt
| alter_range_relocate_stmt
| ALTER RANGE error // SHOW HELP: ALTER RANGE

Expand All @@ -1810,6 +1806,7 @@ alter_range_stmt:
// ALTER INDEX ... UNSPLIT AT <selectclause>
// ALTER INDEX ... UNSPLIT ALL
// ALTER INDEX ... SCATTER [ FROM ( <exprs...> ) TO ( <exprs...> ) ]
// ALTER INDEX ... RELOCATE [ LEASE | VOTERS | NONVOTERS ] FOR <selectclause>
//
// Zone configurations:
// DISCARD
Expand All @@ -1821,7 +1818,6 @@ alter_range_stmt:
alter_index_stmt:
alter_oneindex_stmt
| alter_relocate_index_stmt
| alter_relocate_index_lease_stmt
| alter_split_index_stmt
| alter_unsplit_index_stmt
| alter_scatter_index_stmt
Expand Down Expand Up @@ -1928,7 +1924,7 @@ alter_relocate_stmt:
Rows: $6.slct(),
}
}
| ALTER TABLE table_name relocate_kw NON_VOTERS select_stmt
| ALTER TABLE table_name relocate_kw NONVOTERS select_stmt
{
/* SKIP DOC */
name := $3.unresolvedObjectName().ToTableName()
Expand All @@ -1938,33 +1934,29 @@ alter_relocate_stmt:
RelocateNonVoters: true,
}
}
| ALTER TABLE table_name relocate_kw LEASE select_stmt
{
/* SKIP DOC */
name := $3.unresolvedObjectName().ToTableName()
$$.val = &tree.Relocate{
TableOrIndex: tree.TableIndexName{Table: name},
Rows: $6.slct(),
RelocateLease: true,
}
}

alter_relocate_index_stmt:
ALTER INDEX table_index_name relocate_kw voters_kw select_stmt
{
/* SKIP DOC */
$$.val = &tree.Relocate{TableOrIndex: $3.tableIndexName(), Rows: $6.slct()}
}
| ALTER INDEX table_index_name relocate_kw NON_VOTERS select_stmt
| ALTER INDEX table_index_name relocate_kw NONVOTERS select_stmt
{
/* SKIP DOC */
$$.val = &tree.Relocate{TableOrIndex: $3.tableIndexName(), Rows: $6.slct(), RelocateNonVoters: true}
}

alter_relocate_lease_stmt:
ALTER TABLE table_name relocate_kw LEASE select_stmt
{
/* SKIP DOC */
name := $3.unresolvedObjectName().ToTableName()
$$.val = &tree.Relocate{
TableOrIndex: tree.TableIndexName{Table: name},
Rows: $6.slct(),
RelocateLease: true,
}
}

alter_relocate_index_lease_stmt:
ALTER INDEX table_index_name relocate_kw LEASE select_stmt
| ALTER INDEX table_index_name relocate_kw LEASE select_stmt
{
/* SKIP DOC */
$$.val = &tree.Relocate{TableOrIndex: $3.tableIndexName(), Rows: $6.slct(), RelocateLease: true}
Expand All @@ -1978,7 +1970,7 @@ alter_zone_range_stmt:
$$.val = s
}

alter_range_relocate_lease_stmt:
alter_range_relocate_stmt:
ALTER RANGE relocate_kw LEASE TO iconst64 FOR select_stmt
{
$$.val = &tree.RelocateRange{
Expand All @@ -1999,9 +1991,7 @@ alter_range_relocate_lease_stmt:
RelocateNonVoters: false,
}
}

alter_range_relocate_stmt:
ALTER RANGE relocate_kw voters_kw FROM iconst64 TO iconst64 FOR select_stmt
| ALTER RANGE relocate_kw voters_kw FROM iconst64 TO iconst64 FOR select_stmt
{
$$.val = &tree.RelocateRange{
Rows: $10.slct(),
Expand All @@ -2023,7 +2013,7 @@ ALTER RANGE relocate_kw voters_kw FROM iconst64 TO iconst64 FOR select_stmt
RelocateNonVoters: false,
}
}
| ALTER RANGE relocate_kw NON_VOTERS FROM iconst64 TO iconst64 FOR select_stmt
| ALTER RANGE relocate_kw NONVOTERS FROM iconst64 TO iconst64 FOR select_stmt
{
$$.val = &tree.RelocateRange{
Rows: $10.slct(),
Expand All @@ -2033,7 +2023,7 @@ ALTER RANGE relocate_kw voters_kw FROM iconst64 TO iconst64 FOR select_stmt
RelocateNonVoters: true,
}
}
| ALTER RANGE iconst64 relocate_kw NON_VOTERS FROM iconst64 TO iconst64
| ALTER RANGE iconst64 relocate_kw NONVOTERS FROM iconst64 TO iconst64
{
$$.val = &tree.RelocateRange{
Rows: &tree.Select{
Expand Down Expand Up @@ -13445,7 +13435,7 @@ unreserved_keyword:
| NOCONTROLJOB
| NOLOGIN
| NOMODIFYCLUSTERSETTING
| NON_VOTERS
| NONVOTERS
| NOVIEWACTIVITY
| NOWAIT
| NULLS
Expand Down
20 changes: 10 additions & 10 deletions pkg/sql/parser/testdata/alter_range
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ ALTER RANGE RELOCATE VOTERS FROM 3 TO 2 FOR VALUES (_) -- literals removed
ALTER RANGE RELOCATE VOTERS FROM 3 TO 2 FOR VALUES (1) -- identifiers removed

parse
ALTER RANGE 1 RELOCATE NON_VOTERS FROM 3 TO 2
ALTER RANGE 1 RELOCATE NONVOTERS FROM 3 TO 2
----
ALTER RANGE RELOCATE NON_VOTERS FROM 3 TO 2 FOR VALUES (1) -- normalized!
ALTER RANGE RELOCATE NON_VOTERS FROM 3 TO 2 FOR VALUES ((1)) -- fully parenthesized
ALTER RANGE RELOCATE NON_VOTERS FROM 3 TO 2 FOR VALUES (_) -- literals removed
ALTER RANGE RELOCATE NON_VOTERS FROM 3 TO 2 FOR VALUES (1) -- identifiers removed
ALTER RANGE RELOCATE NONVOTERS FROM 3 TO 2 FOR VALUES (1) -- normalized!
ALTER RANGE RELOCATE NONVOTERS FROM 3 TO 2 FOR VALUES ((1)) -- fully parenthesized
ALTER RANGE RELOCATE NONVOTERS FROM 3 TO 2 FOR VALUES (_) -- literals removed
ALTER RANGE RELOCATE NONVOTERS FROM 3 TO 2 FOR VALUES (1) -- identifiers removed

parse
ALTER RANGE RELOCATE FROM 3 TO 2 FOR SELECT range_id FROM foo
Expand All @@ -135,9 +135,9 @@ ALTER RANGE RELOCATE VOTERS FROM 3 TO 2 FOR SELECT range_id FROM foo -- literals
ALTER RANGE RELOCATE VOTERS FROM 3 TO 2 FOR SELECT _ FROM _ -- identifiers removed

parse
ALTER RANGE RELOCATE NON_VOTERS FROM 3 TO 2 FOR SELECT range_id FROM foo
ALTER RANGE RELOCATE NONVOTERS FROM 3 TO 2 FOR SELECT range_id FROM foo
----
ALTER RANGE RELOCATE NON_VOTERS FROM 3 TO 2 FOR SELECT range_id FROM foo
ALTER RANGE RELOCATE NON_VOTERS FROM 3 TO 2 FOR SELECT (range_id) FROM foo -- fully parenthesized
ALTER RANGE RELOCATE NON_VOTERS FROM 3 TO 2 FOR SELECT range_id FROM foo -- literals removed
ALTER RANGE RELOCATE NON_VOTERS FROM 3 TO 2 FOR SELECT _ FROM _ -- identifiers removed
ALTER RANGE RELOCATE NONVOTERS FROM 3 TO 2 FOR SELECT range_id FROM foo
ALTER RANGE RELOCATE NONVOTERS FROM 3 TO 2 FOR SELECT (range_id) FROM foo -- fully parenthesized
ALTER RANGE RELOCATE NONVOTERS FROM 3 TO 2 FOR SELECT range_id FROM foo -- literals removed
ALTER RANGE RELOCATE NONVOTERS FROM 3 TO 2 FOR SELECT _ FROM _ -- identifiers removed
40 changes: 20 additions & 20 deletions pkg/sql/parser/testdata/alter_table
Original file line number Diff line number Diff line change
Expand Up @@ -794,36 +794,36 @@ ALTER TABLE d.a EXPERIMENTAL_RELOCATE VOTERS VALUES (ARRAY[_, _, __more1__], '_'
ALTER TABLE _._ EXPERIMENTAL_RELOCATE VOTERS VALUES (ARRAY[1, 2, 3], 'b', 2) -- identifiers removed

parse
ALTER TABLE a EXPERIMENTAL_RELOCATE NON_VOTERS VALUES (ARRAY[1], 1)
ALTER TABLE a EXPERIMENTAL_RELOCATE NONVOTERS VALUES (ARRAY[1], 1)
----
ALTER TABLE a EXPERIMENTAL_RELOCATE NON_VOTERS VALUES (ARRAY[1], 1)
ALTER TABLE a EXPERIMENTAL_RELOCATE NON_VOTERS VALUES ((ARRAY[(1)]), (1)) -- fully parenthesized
ALTER TABLE a EXPERIMENTAL_RELOCATE NON_VOTERS VALUES (ARRAY[_], _) -- literals removed
ALTER TABLE _ EXPERIMENTAL_RELOCATE NON_VOTERS VALUES (ARRAY[1], 1) -- identifiers removed
ALTER TABLE a EXPERIMENTAL_RELOCATE NONVOTERS VALUES (ARRAY[1], 1)
ALTER TABLE a EXPERIMENTAL_RELOCATE NONVOTERS VALUES ((ARRAY[(1)]), (1)) -- fully parenthesized
ALTER TABLE a EXPERIMENTAL_RELOCATE NONVOTERS VALUES (ARRAY[_], _) -- literals removed
ALTER TABLE _ EXPERIMENTAL_RELOCATE NONVOTERS VALUES (ARRAY[1], 1) -- identifiers removed

parse
EXPLAIN ALTER TABLE a EXPERIMENTAL_RELOCATE NON_VOTERS TABLE b
EXPLAIN ALTER TABLE a EXPERIMENTAL_RELOCATE NONVOTERS TABLE b
----
EXPLAIN ALTER TABLE a EXPERIMENTAL_RELOCATE NON_VOTERS TABLE b
EXPLAIN ALTER TABLE a EXPERIMENTAL_RELOCATE NON_VOTERS TABLE b -- fully parenthesized
EXPLAIN ALTER TABLE a EXPERIMENTAL_RELOCATE NON_VOTERS TABLE b -- literals removed
EXPLAIN ALTER TABLE _ EXPERIMENTAL_RELOCATE NON_VOTERS TABLE _ -- identifiers removed
EXPLAIN ALTER TABLE a EXPERIMENTAL_RELOCATE NONVOTERS TABLE b
EXPLAIN ALTER TABLE a EXPERIMENTAL_RELOCATE NONVOTERS TABLE b -- fully parenthesized
EXPLAIN ALTER TABLE a EXPERIMENTAL_RELOCATE NONVOTERS TABLE b -- literals removed
EXPLAIN ALTER TABLE _ EXPERIMENTAL_RELOCATE NONVOTERS TABLE _ -- identifiers removed

parse
ALTER TABLE a EXPERIMENTAL_RELOCATE NON_VOTERS SELECT * FROM t
ALTER TABLE a EXPERIMENTAL_RELOCATE NONVOTERS SELECT * FROM t
----
ALTER TABLE a EXPERIMENTAL_RELOCATE NON_VOTERS SELECT * FROM t
ALTER TABLE a EXPERIMENTAL_RELOCATE NON_VOTERS SELECT (*) FROM t -- fully parenthesized
ALTER TABLE a EXPERIMENTAL_RELOCATE NON_VOTERS SELECT * FROM t -- literals removed
ALTER TABLE _ EXPERIMENTAL_RELOCATE NON_VOTERS SELECT * FROM _ -- identifiers removed
ALTER TABLE a EXPERIMENTAL_RELOCATE NONVOTERS SELECT * FROM t
ALTER TABLE a EXPERIMENTAL_RELOCATE NONVOTERS SELECT (*) FROM t -- fully parenthesized
ALTER TABLE a EXPERIMENTAL_RELOCATE NONVOTERS SELECT * FROM t -- literals removed
ALTER TABLE _ EXPERIMENTAL_RELOCATE NONVOTERS SELECT * FROM _ -- identifiers removed

parse
ALTER TABLE d.a EXPERIMENTAL_RELOCATE NON_VOTERS VALUES (ARRAY[1, 2, 3], 'b', 2)
ALTER TABLE d.a EXPERIMENTAL_RELOCATE NONVOTERS VALUES (ARRAY[1, 2, 3], 'b', 2)
----
ALTER TABLE d.a EXPERIMENTAL_RELOCATE NON_VOTERS VALUES (ARRAY[1, 2, 3], 'b', 2)
ALTER TABLE d.a EXPERIMENTAL_RELOCATE NON_VOTERS VALUES ((ARRAY[(1), (2), (3)]), ('b'), (2)) -- fully parenthesized
ALTER TABLE d.a EXPERIMENTAL_RELOCATE NON_VOTERS VALUES (ARRAY[_, _, __more1__], '_', _) -- literals removed
ALTER TABLE _._ EXPERIMENTAL_RELOCATE NON_VOTERS VALUES (ARRAY[1, 2, 3], 'b', 2) -- identifiers removed
ALTER TABLE d.a EXPERIMENTAL_RELOCATE NONVOTERS VALUES (ARRAY[1, 2, 3], 'b', 2)
ALTER TABLE d.a EXPERIMENTAL_RELOCATE NONVOTERS VALUES ((ARRAY[(1), (2), (3)]), ('b'), (2)) -- fully parenthesized
ALTER TABLE d.a EXPERIMENTAL_RELOCATE NONVOTERS VALUES (ARRAY[_, _, __more1__], '_', _) -- literals removed
ALTER TABLE _._ EXPERIMENTAL_RELOCATE NONVOTERS VALUES (ARRAY[1, 2, 3], 'b', 2) -- identifiers removed

parse
ALTER TABLE a EXPERIMENTAL_RELOCATE LEASE VALUES (1, 1)
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/sem/tree/alter_range.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (node *RelocateRange) Format(ctx *FmtCtx) {
if node.RelocateLease {
ctx.WriteString("LEASE ")
} else if node.RelocateNonVoters {
ctx.WriteString("NON_VOTERS ")
ctx.WriteString("NONVOTERS ")
} else {
ctx.WriteString("VOTERS ")
}
Expand Down
Loading