Comment 1 for bug 1003014

Revision history for this message
Daniel Nichter (daniel-nichter) wrote : Re: pt-table-sync --replicate false-positive error "index does not exist"

This bug only affects 2.1.1. 2.0 has different code that is not affected. Both versions have tests to prevent a regression.

This originated in 2.1.1 at https://code.launchpad.net/~percona-toolkit-dev/percona-toolkit/fix-table-status-bug-960513/+merge/100295

2.0 has an inefficiency which is the point of https://code.launchpad.net/~percona-toolkit-dev/percona-toolkit/fix-table-status-bug-960513/+merge/100296: it does SHOW CREATE TABLE for *every diff*. So if table foo has 100 diffs, the tool does SHOW CREATE TABLE foo 100 times. The change that caused this bug in 2.1.1 fixed that by only doing SHOW CREATE TALBE once. However, as the fix shows: it neglected to SHOW CREATE TABLE ever again, so the first table's def was used for every subsequent table. This could have potentially bad consequences/side-effects because the tool uses columns, indexes, etc. from table foo to work on table bar. In most cases, this probably causes errors (undefined values, use of uninitialized values, SQL statement errors, etc.).