Used the source column definition to fetch and convert insert values
When processing binlog insert statements, we want to use `sharedColumns` to decide which values to fetch and convert from the insert DML event. We only want to `mappedShareColumns` to define the column names in the `replace into ...` statement.
This commit is contained in:
parent
25b5474cfa
commit
2f80c9d424
@ -344,7 +344,7 @@ func BuildDMLInsertQuery(databaseName, tableName string, tableColumns, sharedCol
|
|||||||
databaseName = EscapeName(databaseName)
|
databaseName = EscapeName(databaseName)
|
||||||
tableName = EscapeName(tableName)
|
tableName = EscapeName(tableName)
|
||||||
|
|
||||||
for _, column := range mappedSharedColumns.Columns() {
|
for _, column := range sharedColumns.Columns() {
|
||||||
tableOrdinal := tableColumns.Ordinals[column.Name]
|
tableOrdinal := tableColumns.Ordinals[column.Name]
|
||||||
arg := column.convertArg(args[tableOrdinal])
|
arg := column.convertArg(args[tableOrdinal])
|
||||||
sharedArgs = append(sharedArgs, arg)
|
sharedArgs = append(sharedArgs, arg)
|
||||||
|
Loading…
Reference in New Issue
Block a user