~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzledump.cc

  • Committer: Eric Day
  • Date: 2009-03-19 06:22:27 UTC
  • mto: (968.1.1 lib-merge)
  • mto: This revision was merged to the branch mainline in revision 969.
  • Revision ID: eday@oddments.org-20090319062227-u4k093nxgnz17hip
More changes towards getting the client utilities converted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
static bool debug_info_flag= false, debug_check_flag= false;
97
97
static uint32_t opt_max_allowed_packet, opt_net_buffer_length, show_progress_size= 0;
98
98
static uint64_t total_rows= 0;
99
 
static DRIZZLE drizzleclient_connection, *drizzle= 0;
 
99
static drizzle_st drizzle;
 
100
static drizzle_con_st dcon;
100
101
static string insert_pat;
101
102
static char  *opt_password= NULL, *current_user= NULL,
102
103
             *current_host= NULL, *path= NULL, *fields_terminated= NULL,
415
416
static void die(int error, const char* reason, ...);
416
417
static void maybe_die(int error, const char* reason, ...);
417
418
static void write_header(FILE *sql_file, char *db_name);
418
 
static void print_value(FILE *file, DRIZZLE_RES  *result, DRIZZLE_ROW row,
419
 
                        const char *prefix,const char *name,
 
419
static void print_value(FILE *file, drizzle_result_st *result,
 
420
                        drizzle_row_t row, const char *prefix, const char *name,
420
421
                        int string_value);
421
 
static const char* fetch_named_row(DRIZZLE_RES *result, DRIZZLE_ROW row, const char* name);
 
422
static const char* fetch_named_row(drizzle_result_st *result, drizzle_row_t row,
 
423
                                   const char* name);
422
424
static int dump_selected_tables(char *db, char **table_names, int tables);
423
425
static int dump_all_tables_in_db(char *db);
424
426
static int init_dumping_tables(char *);
469
471
static void print_version(void)
470
472
{
471
473
  printf(_("%s  Ver %s Distrib %s, for %s (%s)\n"),my_progname,DUMP_VERSION,
472
 
         drizzleclient_get_client_info(),SYSTEM_TYPE,MACHINE_TYPE);
 
474
         drizzle_version(),SYSTEM_TYPE,MACHINE_TYPE);
473
475
} /* print_version */
474
476
 
475
477
 
522
524
    {
523
525
      fprintf(sql_file,
524
526
              "-- DRIZZLE dump %s  Distrib %s, for %s (%s)\n--\n",
525
 
              DUMP_VERSION, drizzleclient_get_client_info(),
526
 
              SYSTEM_TYPE, MACHINE_TYPE);
 
527
              DUMP_VERSION, drizzle_version(), SYSTEM_TYPE, MACHINE_TYPE);
527
528
      fprintf(sql_file, "-- Host: %s    Database: %s\n",
528
529
              current_host ? current_host : "localhost", db_name ? db_name :
529
530
              "");
530
531
      fputs("-- ------------------------------------------------------\n",
531
532
            sql_file);
532
533
      fprintf(sql_file, "-- Server version\t%s\n",
533
 
              drizzleclient_get_server_info(&drizzleclient_connection));
 
534
              drizzle_con_server_version(&dcon));
534
535
    }
535
536
    if (opt_set_charset)
536
537
      fprintf(sql_file,