Skip to content

Commit

Permalink
tables: remove unnecessary function (#55361)
Browse files Browse the repository at this point in the history
  • Loading branch information
Defined2014 authored Aug 12, 2024
1 parent e767f86 commit 66e192d
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions pkg/table/tables/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ func (t *TableCommon) updateRecord(sctx table.MutateContext, h kv.Handle, oldDat
encodeRowBuffer.AddColVal(col.ID, value)
}
checkRowBuffer.AddColVal(value)
if shouldWriteBinlog && !t.canSkipUpdateBinlog(col, value) {
if shouldWriteBinlog && !t.canSkipUpdateBinlog(col) {
binlogColIDs = append(binlogColIDs, col.ID)
binlogOldRow = append(binlogOldRow, oldData[col.Offset])
binlogNewRow = append(binlogNewRow, value)
Expand Down Expand Up @@ -624,7 +624,7 @@ func (t *TableCommon) rebuildUpdateRecordIndices(
if err != nil {
return err
}
if err = t.removeRowIndex(ctx, h, oldVs, idx, txn); err != nil {
if err = idx.Delete(ctx, txn, oldVs, h); err != nil {
return err
}
break
Expand Down Expand Up @@ -1413,11 +1413,6 @@ func (t *TableCommon) removeRowIndices(ctx table.MutateContext, h kv.Handle, rec
return nil
}

// removeRowIndex implements table.Table RemoveRowIndex interface.
func (t *TableCommon) removeRowIndex(ctx table.MutateContext, h kv.Handle, vals []types.Datum, idx table.Index, txn kv.Transaction) error {
return idx.Delete(ctx, txn, vals, h)
}

// buildIndexForRow implements table.Table BuildIndexForRow interface.
func (t *TableCommon) buildIndexForRow(ctx table.MutateContext, h kv.Handle, vals []types.Datum, newData []types.Datum, idx *index, txn kv.Transaction, untouched bool, opt *table.CreateIdxOpt) error {
rsData := TryGetHandleRestoredDataWrapper(t.meta, newData, nil, idx.Meta())
Expand Down Expand Up @@ -1666,7 +1661,7 @@ func CanSkip(info *model.TableInfo, col *table.Column, value *types.Datum) bool
}

// canSkipUpdateBinlog checks whether the column can be skipped or not.
func (t *TableCommon) canSkipUpdateBinlog(col *table.Column, value types.Datum) bool {
func (t *TableCommon) canSkipUpdateBinlog(col *table.Column) bool {
return col.IsVirtualGenerated()
}

Expand Down

0 comments on commit 66e192d

Please sign in to comment.