Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
112393: sql: remove redundant conditional paths r=stevendanna a=Shikhar03Stark

Fixes: cockroachdb#111781 
Remove redundant conditional path in sql package

Co-authored-by: Harshit Vishwakarma <[email protected]>
  • Loading branch information
craig[bot] and Shikhar03Stark committed Oct 19, 2023
2 parents fbee076 + 64441a1 commit eb148c0
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions pkg/sql/sem/tree/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,9 @@ func (node *Restore) Format(ctx *FmtCtx) {
ctx.FormatNode(&node.AsOf)
}
if !node.Options.IsDefault() {
if ctx.HasFlags(FmtHideConstants) {
ctx.WriteString(" WITH OPTIONS (")
ctx.FormatNode(&node.Options)
ctx.WriteString(")")
} else {
ctx.WriteString(" WITH OPTIONS (")
ctx.FormatNode(&node.Options)
ctx.WriteString(")")
}
ctx.WriteString(" WITH OPTIONS (")
ctx.FormatNode(&node.Options)
ctx.WriteString(")")
}
}

Expand Down Expand Up @@ -520,15 +514,9 @@ func (o *RestoreOptions) Format(ctx *FmtCtx) {
}

if o.ExecutionLocality != nil {
if ctx.HasFlags(FmtHideConstants) {
maybeAddSep()
ctx.WriteString("execution locality = ")
ctx.FormatNode(o.ExecutionLocality)
} else {
maybeAddSep()
ctx.WriteString("execution locality = ")
ctx.FormatNode(o.ExecutionLocality)
}
maybeAddSep()
ctx.WriteString("execution locality = ")
ctx.FormatNode(o.ExecutionLocality)
}

if o.ExperimentalOnline {
Expand Down

0 comments on commit eb148c0

Please sign in to comment.