~mysqlatfacebook/mysqlatfacebook/tools

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "faker.h"

int main(int argc, char **argv)
{

    if (argc < 2) {
        g_critical("Need binlog file name");
        exit(EXIT_FAILURE);
    }

    BINLOG *binlog = open_binlog(argv[1]);
    EVENT *event;

    if (!binlog)
        exit(EXIT_FAILURE);

    while ((event = read_binlog(binlog))) {
        printf("%*s\n", event->query_length, (char *) event->query);
    }
}