Skip to content

Commit

Permalink
fix last order column only when DML
Browse files Browse the repository at this point in the history
When we do not know columnInformation
values dictionary key is always null
so overwrite value Object.
Thus always values dictionary has last order column object value

To avoid user confusion, it is marked and displayed as UNKNOWN_COL.
  • Loading branch information
sean-k1 committed Oct 13, 2023
1 parent 513b274 commit 97c9e2b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pymysqlreplication/row_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,13 @@ def _read_column_data(self, cols_bitmap):
column = self.columns[i]
name = self.table_map[self.table_id].columns[i].name
unsigned = self.table_map[self.table_id].columns[i].unsigned

if not name:
# If you are using mysql 5.7 or mysql 8, but binlog_row_metadata = "MINIMAL",
# we do not know the column information.
# If you know column information,
# mysql 5.7 version Users Use Under 1.0 version
# mysql 8.0 version Users Set binlog_row_metadata = "FULL"
name = "UNKNOWN_COL" + str(i)
values[name] = self.__read_values_name(
column,
null_bitmap,
Expand Down

0 comments on commit 97c9e2b

Please sign in to comment.