Skip to content

Commit

Permalink
sql: fix comment on prepareInsertOrUpdateBatch
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
nvanbenschoten committed Nov 12, 2018
1 parent a1f2510 commit 7204e2e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/sql/row/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ func (ri *Inserter) InsertRow(
// (must be adapted depending on whether 'overwrite' is set)
// - helper is the rowHelper that knows about the table being modified.
// - primaryIndexKey is the PK prefix for the current row.
// - updatedCols is the list of schema columns being updated.
// - fetchedCols is the list of schema columns that have been fetched
// in preparation for this update.
// - values is the SQL-level row values that are being written.
// - marshaledValues contains the pre-encoded KV-level row values.
// marshaledValues is only used when writing single column families.
Expand All @@ -241,7 +242,7 @@ func prepareInsertOrUpdateBatch(
batch putter,
helper *rowHelper,
primaryIndexKey []byte,
updatedCols []sqlbase.ColumnDescriptor,
fetchedCols []sqlbase.ColumnDescriptor,
values []tree.Datum,
valColIDMapping map[sqlbase.ColumnID]int,
marshaledValues []roachpb.Value,
Expand Down Expand Up @@ -317,7 +318,7 @@ func prepareInsertOrUpdateBatch(
continue
}

col := updatedCols[idx]
col := fetchedCols[idx]

if lastColID > col.ID {
return nil, pgerror.NewAssertionErrorf("cannot write column id %d after %d", col.ID, lastColID)
Expand Down

0 comments on commit 7204e2e

Please sign in to comment.