You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First. I do not usually code in Python, so I had problems running it in version 3 of Python.
Second, there is a bug causing PK out of bounds.
If you have two databases: first_database, second_database
By incrementing first_database, you get primary keys like 1000001 and second_database primary keys like 2000001.
Then there is a step : " 7/9 Mapping pk in case of uniques conflict", which finds conflicts. In case of conflict second_database primary key change to 1000001.
In step 9: Decrementing pks: it tries to decrement - 2000000 primary keys in second database. But in those, where was conflict it goes out of bounds because it has changed.
my solution was to change function rollback_pks
where = ""
if len(table_map['pk_changed_to_resolve_unique_conficts']):
where = "WHERE %(pk_col)s NOT IN (%(ids)s)" % {
'pk_col': list(table_map['primary'].keys())[0],
'ids': ",".join(table_map['pk_changed_to_resolve_unique_conficts'])
}
self._logger.qs = "UPDATE `%(table)s` SET `%(pk)s` = `%(pk)s` - %(step)d %(where)s" % {"table": table_name,
"pk": col_name,
'step': self._increment_value,
'where': where}
where = ""
if len(table_map['pk_changed_to_resolve_unique_conficts']):
where = "WHERE %(pk_col)s IN (%(ids)s)" % {
'pk_col': list(table_map['primary'].keys())[0],
'ids': ",".join(table_map['pk_changed_to_resolve_unique_conficts'])
}
self._logger.qs = "UPDATE `%(table)s` SET `%(pk)s` = `%(pk)s` - %(step)d %(where)s" % {"table": table_name,
"pk": col_name,
'step': self._increment_step,
'where': where}
The text was updated successfully, but these errors were encountered:
Thank you so much for sharing that @stanlay01! Would you like to contribute to the codebase? If you turned this change into a Pull Request, I'd be more than happy to review and merge it.
Hello,
First. I do not usually code in Python, so I had problems running it in version 3 of Python.
Second, there is a bug causing PK out of bounds.
If you have two databases: first_database, second_database
By incrementing first_database, you get primary keys like 1000001 and second_database primary keys like 2000001.
Then there is a step : " 7/9 Mapping pk in case of uniques conflict", which finds conflicts. In case of conflict second_database primary key change to 1000001.
In step 9: Decrementing pks: it tries to decrement - 2000000 primary keys in second database. But in those, where was conflict it goes out of bounds because it has changed.
my solution was to change function rollback_pks
The text was updated successfully, but these errors were encountered: