Skip to content

Commit 55cfe4c

Browse files
committed
.
1 parent bf72d2c commit 55cfe4c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

pkg/common/event/row_change.go

+4-6
Original file line numberDiff line numberDiff line change
@@ -125,24 +125,22 @@ func (e *RowEvent) PrimaryKeyColumnNames() []string {
125125
var result []string
126126

127127
result = make([]string, 0)
128-
tableInfo := e.TableInfo
129128
columns := e.TableInfo.GetColumns()
130129
for _, col := range columns {
131130
if col != nil && mysql.HasPriKeyFlag(col.GetFlag()) {
132-
result = append(result, tableInfo.ForceGetColumnName(col.ID))
131+
result = append(result, col.Name.O)
133132
}
134133
}
135134
return result
136135
}
137136

138137
// PrimaryKeyColumn return all primary key's indexes and column infos
139-
func (e *RowEvent) PrimaryKeyColumn() ([]int, []*model.ColumnInfo) {
140-
infos := make([]*model.ColumnInfo, 0)
138+
func (e *RowEvent) PrimaryKeyColumn() ([]int, []*timodel.ColumnInfo) {
139+
infos := make([]*timodel.ColumnInfo, 0)
141140
index := make([]int, 0)
142-
tableInfo := e.TableInfo
143141
columns := e.TableInfo.GetColumns()
144142
for i, col := range columns {
145-
if col != nil && tableInfo.ForceGetColumnFlagType(col.ID).IsPrimaryKey() {
143+
if col != nil && mysql.HasPriKeyFlag(col.GetFlag()) {
146144
infos = append(infos, col)
147145
index = append(index, i)
148146
}

0 commit comments

Comments
 (0)