lefred / MyUndelete

Undelete deleted rows from MySQL ROW binary logs
GNU General Public License v2.0
26 stars 13 forks source link

Validate mulitple events in the position range #2

Open lefred opened 9 years ago

lefred commented 9 years ago

This doesn't work, only one BEGIN and COMMIT needs to be run at the time.

| mysql-bin.000008 | 1514 | Query       |         1 |        1586 | BEGIN                                 |
| mysql-bin.000008 | 1586 | Table_map   |         1 |        1636 | table_id: 72 (fred.fred)              |
| mysql-bin.000008 | 1636 | Delete_rows |         1 |        1694 | table_id: 72 flags: STMT_END_F        |
| mysql-bin.000008 | 1694 | Xid         |         1 |        1725 | COMMIT /* xid=146 */                  |
| mysql-bin.000008 | 1725 | Query       |         1 |        1797 | BEGIN                                 |
| mysql-bin.000008 | 1797 | Table_map   |         1 |        1847 | table_id: 72 (fred.fred)              |
| mysql-bin.000008 | 1847 | Delete_rows |         1 |        1898 | table_id: 72 flags: STMT_END_F        |
| mysql-bin.000008 | 1898 | Xid         |         1 |        1929 | COMMIT /* xid=147 */                  |

This requires 2 runs, one from 1586 to 1725 and one from 1797 to 1929.

I'll have to add some verification in the code.