~mysqlatfacebook/mysqlatfacebook/tools

« back to all changes in this revision

Viewing changes to faker/test-binlog.c

  • Committer: Domas Mituzas
  • Date: 2012-09-04 10:46:59 UTC
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: domas@fb.com-20120904104659-pvzx1973dli3iv6u
Faker: C implementation of InnoDB fake changes based replication prefetcher

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "faker.h"
 
2
 
 
3
int main(int argc, char **argv)
 
4
{
 
5
 
 
6
    if (argc < 2) {
 
7
        g_critical("Need binlog file name");
 
8
        exit(EXIT_FAILURE);
 
9
    }
 
10
 
 
11
    BINLOG *binlog = open_binlog(argv[1]);
 
12
    EVENT *event;
 
13
 
 
14
    if (!binlog)
 
15
        exit(EXIT_FAILURE);
 
16
 
 
17
    while ((event = read_binlog(binlog))) {
 
18
        printf("%*s\n", event->query_length, (char *) event->query);
 
19
    }
 
20
}