~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/archive/archive_reader.cc

Remove PLUGIN and MODULES.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include "drizzled/global.h"
 
21
#include "config.h"
22
22
 
23
23
#include "azio.h"
24
24
#include <string.h>
25
25
#include <assert.h>
26
26
#include <stdio.h>
27
27
#include <stdarg.h>
28
 
#include <mystrings/m_ctype.h>
29
 
#include <mystrings/m_string.h>
30
 
#include <mysys/my_getopt.h>
 
28
#include <fcntl.h>
 
29
#include "drizzled/charset_info.h"
 
30
#include "drizzled/internal/m_string.h"
 
31
#include "drizzled/my_getopt.h"
31
32
 
32
33
#define SHOW_VERSION "0.1"
33
34
 
42
43
uint64_t new_auto_increment_value;
43
44
static const char *load_default_groups[]= { "archive_reader", 0 };
44
45
static char **default_argv;
45
 
int opt_check, opt_force, opt_quiet, opt_backup= 0, opt_extract_frm;
 
46
int opt_check, opt_force, opt_quiet, opt_backup= 0, opt_extract_table_message;
46
47
int opt_autoincrement;
47
48
 
48
49
int main(int argc, char *argv[])
109
110
    printf("\tLongest Row %u\n", reader_handle.longest_row);
110
111
    printf("\tShortest Row %u\n", reader_handle.shortest_row);
111
112
    printf("\tState %s\n", ( reader_handle.dirty ? "dirty" : "clean"));
112
 
    printf("\tFRM stored at %u\n", reader_handle.frm_start_pos);
 
113
    printf("\tTable protobuf message stored at %u\n",
 
114
           reader_handle.frm_start_pos);
113
115
    printf("\tComment stored at %u\n", reader_handle.comment_start_pos);
114
116
    printf("\tData starts at %u\n", (unsigned int)reader_handle.start);
115
117
    if (reader_handle.frm_start_pos)
116
 
      printf("\tFRM length %u\n", reader_handle.frm_length);
 
118
      printf("\tTable proto message length %u\n", reader_handle.frm_length);
117
119
    if (reader_handle.comment_start_pos)
118
120
    {
119
121
      char *comment =
230
232
    azclose(&writer_handle);
231
233
  }
232
234
 
233
 
  if (opt_extract_frm)
 
235
  if (opt_extract_table_message)
234
236
  {
235
 
    File frm_file;
 
237
    int frm_file;
236
238
    char *ptr;
237
239
    frm_file= my_open(argv[1], O_CREAT|O_RDWR, MYF(0));
238
240
    ptr= (char *)malloc(sizeof(char) * reader_handle.frm_length);
266
268
    opt_check= 1;
267
269
    break;
268
270
  case 'e':
269
 
    opt_extract_frm= 1;
 
271
    opt_extract_table_message= 1;
270
272
    break;
271
273
  case 'f':
272
274
    opt_force= 1;
303
305
   0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
304
306
  {"check", 'c', "Check table for errors.",
305
307
   0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
306
 
  {"extract-frm", 'e',
307
 
   "Extract the frm file.",
 
308
  {"extract-table-message", 'e',
 
309
   "Extract the table protobuf message.",
308
310
   0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
309
311
  {"force", 'f',
310
312
   "Restart with -r if there are any errors in the table.",