merge pread version with 'binlog addition' changes