Skip to content

Commit

Permalink
parser: delete RESTORE TENANT ... FROM REPLICATION
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
adityamaru committed Nov 21, 2022
1 parent ae919e3 commit ba5f911
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 94 deletions.
6 changes: 0 additions & 6 deletions docs/generated/sql/bnf/stmt_block.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ restore_stmt ::=
| 'RESTORE' backup_targets 'FROM' string_or_placeholder 'IN' list_of_string_or_placeholder_opt_list opt_as_of_clause opt_with_restore_options
| 'RESTORE' 'SYSTEM' 'USERS' 'FROM' list_of_string_or_placeholder_opt_list opt_as_of_clause opt_with_restore_options
| 'RESTORE' 'SYSTEM' 'USERS' 'FROM' string_or_placeholder 'IN' list_of_string_or_placeholder_opt_list opt_as_of_clause opt_with_restore_options
| 'RESTORE' backup_targets 'FROM' 'REPLICATION' 'STREAM' 'FROM' string_or_placeholder_opt_list opt_as_tenant_clause

resume_stmt ::=
resume_jobs_stmt
Expand Down Expand Up @@ -728,11 +727,6 @@ backup_targets ::=
| 'TENANT' 'identifier'
| 'DATABASE' name_list

opt_as_tenant_clause ::=
'AS' 'TENANT' iconst64
| 'AS' 'TENANT' 'identifier'
|

resume_jobs_stmt ::=
'RESUME' 'JOB' a_expr
| 'RESUME' 'JOBS' select_stmt
Expand Down
1 change: 0 additions & 1 deletion pkg/sql/opaque.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ func init() {
&tree.CreateChangefeed{},
&tree.Import{},
&tree.ScheduledBackup{},
&tree.StreamIngestion{},
&tree.CreateTenantFromReplication{},
} {
typ := optbuilder.OpaqueReadOnly
Expand Down
8 changes: 0 additions & 8 deletions pkg/sql/parser/sql.y
Original file line number Diff line number Diff line change
Expand Up @@ -3556,14 +3556,6 @@ restore_stmt:
Options: *($9.restoreOptions()),
}
}
| RESTORE backup_targets FROM REPLICATION STREAM FROM string_or_placeholder_opt_list opt_as_tenant_clause
{
$$.val = &tree.StreamIngestion{
Targets: $2.backupTargetList(),
From: $7.stringOrPlaceholderOptList(),
AsTenant: $8.asTenantClause(),
}
}
| RESTORE error // SHOW HELP: RESTORE

string_or_placeholder_opt_list:
Expand Down
32 changes: 0 additions & 32 deletions pkg/sql/parser/testdata/backup_restore
Original file line number Diff line number Diff line change
Expand Up @@ -713,38 +713,6 @@ RESTORE TENANT 36 FROM (($1), ($2)) WITH tenant = ('5') -- fully parenthesized
RESTORE TENANT _ FROM ($1, $1) WITH tenant = '_' -- literals removed
RESTORE TENANT 36 FROM ($1, $2) WITH tenant = '5' -- identifiers removed

parse
RESTORE TENANT 123 FROM REPLICATION STREAM FROM 'bar' AS TENANT 321
----
RESTORE TENANT 123 FROM REPLICATION STREAM FROM 'bar' AS TENANT 321
RESTORE TENANT 123 FROM REPLICATION STREAM FROM ('bar') AS TENANT 321 -- fully parenthesized
RESTORE TENANT _ FROM REPLICATION STREAM FROM '_' AS TENANT _ -- literals removed
RESTORE TENANT 123 FROM REPLICATION STREAM FROM 'bar' AS TENANT 321 -- identifiers removed

parse
RESTORE TENANT 123 FROM REPLICATION STREAM FROM $1
----
RESTORE TENANT 123 FROM REPLICATION STREAM FROM $1
RESTORE TENANT 123 FROM REPLICATION STREAM FROM ($1) -- fully parenthesized
RESTORE TENANT _ FROM REPLICATION STREAM FROM $1 -- literals removed
RESTORE TENANT 123 FROM REPLICATION STREAM FROM $1 -- identifiers removed

parse
RESTORE TENANT 123 FROM REPLICATION STREAM FROM 'bar'
----
RESTORE TENANT 123 FROM REPLICATION STREAM FROM 'bar'
RESTORE TENANT 123 FROM REPLICATION STREAM FROM ('bar') -- fully parenthesized
RESTORE TENANT _ FROM REPLICATION STREAM FROM '_' -- literals removed
RESTORE TENANT 123 FROM REPLICATION STREAM FROM 'bar' -- identifiers removed

parse
RESTORE TENANT 123 FROM REPLICATION STREAM FROM $1
----
RESTORE TENANT 123 FROM REPLICATION STREAM FROM $1
RESTORE TENANT 123 FROM REPLICATION STREAM FROM ($1) -- fully parenthesized
RESTORE TENANT _ FROM REPLICATION STREAM FROM $1 -- literals removed
RESTORE TENANT 123 FROM REPLICATION STREAM FROM $1 -- identifiers removed

parse
BACKUP TABLE foo TO 'bar' WITH revision_history, detached
----
Expand Down
1 change: 0 additions & 1 deletion pkg/sql/sem/tree/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ go_library(
"show.go",
"split.go",
"stmt.go",
"stream_ingestion.go",
"survival_goal.go",
"table_name.go",
"table_pattern.go",
Expand Down
13 changes: 0 additions & 13 deletions pkg/sql/sem/tree/stmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ var _ CCLOnlyStatement = &AlterChangefeed{}
var _ CCLOnlyStatement = &Import{}
var _ CCLOnlyStatement = &Export{}
var _ CCLOnlyStatement = &ScheduledBackup{}
var _ CCLOnlyStatement = &StreamIngestion{}
var _ CCLOnlyStatement = &CreateTenantFromReplication{}

// StatementReturnType implements the Statement interface.
Expand Down Expand Up @@ -1888,17 +1887,6 @@ func (*Split) StatementType() StatementType { return TypeDML }
// StatementTag returns a short string identifying the type of statement.
func (*Split) StatementTag() string { return "SPLIT" }

// StatementReturnType implements the Statement interface.
func (*StreamIngestion) StatementReturnType() StatementReturnType { return Rows }

// StatementType implements the Statement interface.
func (*StreamIngestion) StatementType() StatementType { return TypeDML }

// StatementTag returns a short string identifying the type of statement.
func (*StreamIngestion) StatementTag() string { return "RESTORE FROM REPLICATION STREAM" }

func (*StreamIngestion) cclOnlyStatement() {}

// StatementReturnType implements the Statement interface.
func (*Unsplit) StatementReturnType() StatementReturnType { return Rows }

Expand Down Expand Up @@ -2218,7 +2206,6 @@ func (n *ShowFingerprints) String() string { return AsString(
func (n *ShowDefaultPrivileges) String() string { return AsString(n) }
func (n *ShowCompletions) String() string { return AsString(n) }
func (n *Split) String() string { return AsString(n) }
func (n *StreamIngestion) String() string { return AsString(n) }
func (n *Unsplit) String() string { return AsString(n) }
func (n *Truncate) String() string { return AsString(n) }
func (n *UnionClause) String() string { return AsString(n) }
Expand Down
33 changes: 0 additions & 33 deletions pkg/sql/sem/tree/stream_ingestion.go

This file was deleted.

0 comments on commit ba5f911

Please sign in to comment.