Skip to content

Commit

Permalink
sql: fix lint error
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
hueypark committed Dec 7, 2018
1 parent 88e5da3 commit 9f235c8
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pkg/sql/truncate.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func (p *planner) truncateTable(
}

// Reassign comment.
if err := reassignComment(p, ctx, id, newID); err != nil {
if err := reassignComment(ctx, p, id, newID); err != nil {
return err
}

Expand Down Expand Up @@ -384,7 +384,7 @@ func reassignReferencedTables(
}

// reassignComment reassign comment on table
func reassignComment(p *planner, ctx context.Context, oldID, newID sqlbase.ID) error {
func reassignComment(ctx context.Context, p *planner, oldID, newID sqlbase.ID) error {
comment, err := p.ExtendedEvalContext().ExecCfg.InternalExecutor.QueryRow(
ctx,
"select-comment",
Expand Down Expand Up @@ -416,11 +416,7 @@ func reassignComment(p *planner, ctx context.Context, oldID, newID sqlbase.ID) e
"DELETE FROM system.comments WHERE type=$1 AND object_id=$2 AND sub_id=0",
keys.TableCommentType,
oldID)
if err != nil {
return err
}

return nil
return err
}

// truncateTableInChunks truncates the data of a table in chunks. It deletes a
Expand Down

0 comments on commit 9f235c8

Please sign in to comment.