~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzledump.c

  • Committer: Brian Aker
  • Date: 2008-08-10 01:37:46 UTC
  • Revision ID: brian@tangent.org-20080810013746-9hp3l1f59j9xdmm0
ulong cleanp in client apps

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
 
76
76
static void add_load_option(DYNAMIC_STRING *str, const char *option,
77
77
                             const char *option_value);
78
 
static ulong find_set(TYPELIB *lib, const char *x, uint length,
 
78
static uint32_t find_set(TYPELIB *lib, const char *x, uint length,
79
79
                      char **err_pos, uint *err_len);
80
80
 
81
81
static void field_escape(DYNAMIC_STRING* in, const char *from);
98
98
                opt_events= 0,
99
99
                opt_alltspcs=0, opt_notspcs= 0;
100
100
static bool insert_pat_inited= 0, debug_info_flag= 0, debug_check_flag= 0;
101
 
static ulong opt_max_allowed_packet, opt_net_buffer_length;
 
101
static uint32_t opt_max_allowed_packet, opt_net_buffer_length;
102
102
static DRIZZLE drizzle_connection,*drizzle=0;
103
103
static DYNAMIC_STRING insert_pat;
104
104
static char  *opt_password=0,*current_user=0,
112
112
static char compatible_mode_normal_str[255];
113
113
/* Server supports character_set_results session variable? */
114
114
static bool server_supports_switching_charsets= true;
115
 
static ulong opt_compatible_mode= 0;
 
115
static uint32_t opt_compatible_mode= 0;
116
116
#define DRIZZLE_OPT_MASTER_DATA_EFFECTIVE_SQL 1
117
117
#define DRIZZLE_OPT_MASTER_DATA_COMMENTED_SQL 2
118
118
#define DRIZZLE_OPT_SLAVE_DATA_EFFECTIVE_SQL 1
138
138
static void dynstr_set_checked(DYNAMIC_STRING *str, const char *init_str);
139
139
static void dynstr_append_mem_checked(DYNAMIC_STRING *str, const char *append,
140
140
                          uint length);
141
 
static void dynstr_realloc_checked(DYNAMIC_STRING *str, ulong additional_size);
 
141
static void dynstr_realloc_checked(DYNAMIC_STRING *str, uint32_t additional_size);
142
142
/*
143
143
  Constant for detection of default value of default_charset.
144
144
  If default_charset is equal to drizzle_universal_client_charset, then
753
753
      char buff[255];
754
754
      char *end= compatible_mode_normal_str;
755
755
      int i;
756
 
      ulong mode;
 
756
      uint32_t mode;
757
757
      uint err_len;
758
758
 
759
759
      opt_quoted= 1;
1255
1255
    Quote '<' '>' '&' '\"' chars and print a string to the xml_file.
1256
1256
*/
1257
1257
 
1258
 
static void print_quoted_xml(FILE *xml_file, const char *str, ulong len)
 
1258
static void print_quoted_xml(FILE *xml_file, const char *str, uint32_t len)
1259
1259
{
1260
1260
  const char *end;
1261
1261
 
1438
1438
    Print hex value for blob data.
1439
1439
*/
1440
1440
 
1441
 
static void print_blob_as_hex(FILE *output_file, const char *str, ulong len)
 
1441
static void print_blob_as_hex(FILE *output_file, const char *str, uint32_t len)
1442
1442
{
1443
1443
    /* sakaik got the idea to to provide blob's in hex notation. */
1444
1444
    const char *ptr= str, *end= ptr + len;
2050
2050
  char table_type[NAME_LEN];
2051
2051
  char *result_table, table_buff2[NAME_LEN*2+3], *opt_quoted_table;
2052
2052
  int error= 0;
2053
 
  ulong         rownr, row_break, total_length, init_length;
 
2053
  uint32_t         rownr, row_break, total_length, init_length;
2054
2054
  uint num_fields;
2055
2055
  DRIZZLE_RES     *res;
2056
2056
  DRIZZLE_FIELD   *field;
2279
2279
      for (i= 0; i < drizzle_num_fields(res); i++)
2280
2280
      {
2281
2281
        int is_blob;
2282
 
        ulong length= lengths[i];
 
2282
        uint32_t length= lengths[i];
2283
2283
 
2284
2284
        if (!(field= drizzle_fetch_field(res)))
2285
2285
          die(EX_CONSCHECK,
2432
2432
 
2433
2433
      if (extended_insert)
2434
2434
      {
2435
 
        ulong row_length;
 
2435
        uint32_t row_length;
2436
2436
        dynstr_append_checked(&extended_row,")");
2437
2437
        row_length= 2 + extended_row.length;
2438
2438
        if (total_length + row_length < opt_net_buffer_length)
2470
2470
    if (drizzle_errno(drizzle))
2471
2471
    {
2472
2472
      snprintf(buf, sizeof(buf),
2473
 
               "%s: Error %d: %s when dumping table %s at row: %ld\n",
 
2473
               "%s: Error %d: %s when dumping table %s at row: %d\n",
2474
2474
               my_progname,
2475
2475
               drizzle_errno(drizzle),
2476
2476
               drizzle_error(drizzle),
3128
3128
}
3129
3129
 
3130
3130
 
3131
 
static ulong find_set(TYPELIB *lib, const char *x, uint length,
 
3131
static uint32_t find_set(TYPELIB *lib, const char *x, uint length,
3132
3132
                      char **err_pos, uint *err_len)
3133
3133
{
3134
3134
  const char *end= x + length;
3135
 
  ulong found= 0;
 
3135
  uint32_t found= 0;
3136
3136
  uint find;
3137
3137
  char buff[255];
3138
3138
 
3404
3404
    die(EX_DRIZZLEERR, DYNAMIC_STR_ERROR_MSG);
3405
3405
}
3406
3406
 
3407
 
static void dynstr_realloc_checked(DYNAMIC_STRING *str, ulong additional_size)
 
3407
static void dynstr_realloc_checked(DYNAMIC_STRING *str, uint32_t additional_size)
3408
3408
{
3409
3409
  if (dynstr_realloc(str, additional_size))
3410
3410
    die(EX_DRIZZLEERR, DYNAMIC_STR_ERROR_MSG);