~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/binlog_reader.cc

  • Committer: Stewart Smith
  • Date: 2009-06-16 03:02:59 UTC
  • mto: This revision was merged to the branch mainline in revision 1065.
  • Revision ID: stewart@flamingspork.com-20090616030259-tn2thqrajk6cappd
ER_NISAMCHK is unused, mark it as so. Thanks to Paul DuBois for researching this for MySQL.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include "binary_log.h"
 
1
#include <drizzled/global.h>
 
2
 
 
3
#include <drizzled/message/binary_log.h>
2
4
 
3
5
#include <iostream>
 
6
#include <fstream>
4
7
 
5
8
#include <google/protobuf/io/coded_stream.h>
6
9
#include <google/protobuf/io/zero_copy_stream_impl.h>
29
32
 
30
33
 
31
34
void
32
 
print_event(BinaryLog::Event *event)
 
35
print_event(BinaryLog::Event *)
33
36
{
34
37
}
35
38
 
62
65
  if (optind > argc)
63
66
    print_usage_and_exit(argv[0]);
64
67
 
65
 
  int fd = open(file_name, O_RDONLY);
66
 
  ZeroCopyInputStream* raw_input = new FileInputStream(fd);
 
68
  filebuf fb;
 
69
 
 
70
  fb.open(file_name, std::ios::in);
 
71
  istream is(&fb);
 
72
 
 
73
  ZeroCopyInputStream* raw_input = new IstreamInputStream(&is);
67
74
  CodedInputStream *coded_input = new CodedInputStream(raw_input);
68
75
 
69
76
  BinaryLog::Event event;
72
79
 
73
80
  delete coded_input;
74
81
  delete raw_input;
75
 
  close(fd);
 
82
  fb.close();
76
83
}