Run
sudo python2 ~/MyUndelete/MyUndelete.py -b binlog.000117 -s 148418658 -e 484776616
only gives me the following error in mysql error log:
[ERROR] [MY-010584] [Repl] Replica SQL: Could not execute Delete_rows event on table db.table; Can't find record in 'table', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's source log FIRST, end_log_pos 148425162, Error_code: MY-001032
but it's able to replace the event type with the original awk script in http://thenoyes.com/littlenoise/?p=307:
BEGIN { regexp = "$^" }
/^BINLOG/ {
print;
getline;
regexp = "^" substr($0, 1, 5) "[CSiy][ABCD]" substr($0, 8, 4);
}
$0 ~ regexp {
n = $0;
$0 = substr(n, 1, 5)
$0 = $0 substr("BRhx", index("CSiy", substr(n, 6, 1)), 1)
$0 = $0 substr("4567", index("ABCD", substr(n, 7, 1)), 1)
$0 = $0 substr(n, 8) ;
}
{ print; }
sudo mysqlbinlog --start-position=148418658 --stop-position=484776616 binlog.000117 | awk -f undelete.awk | mysql
Run
sudo python2 ~/MyUndelete/MyUndelete.py -b binlog.000117 -s 148418658 -e 484776616only gives me the following error in mysql error log:
but it's able to replace the event type with the original awk script in http://thenoyes.com/littlenoise/?p=307: