Giter Site home page Giter Site logo

mysql_merge's People

Contributors

adamziel avatar mikedld avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mysql_merge's Issues

unique conflicts-> then decrementing cause out of bounds error

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

                   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}

Config Now Reading

screenshot_2018-09-05_16-39-56

It is showing me error. I added my config setting and error screen shot with this. Please reply. I need something like this. I'm running this as normal user.

screenshot_2018-09-05_16-43-53

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.