~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzledump.cc

  • Committer: Monty Taylor
  • Date: 2008-12-01 23:28:29 UTC
  • mto: This revision was merged to the branch mainline in revision 637.
  • Revision ID: monty@bitters-20081201232829-064u8x3u1pmv7pc9
Fixed more sun studio warnings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
604
604
}
605
605
 
606
606
 
607
 
static unsigned char* get_table_key(const char *entry, size_t *length,
608
 
                            bool not_used __attribute__((unused)))
 
607
static unsigned char* get_table_key(const char *entry, size_t *length, bool)
609
608
{
610
609
  *length= strlen(entry);
611
610
  return (unsigned char*) entry;
612
611
}
613
612
 
614
613
 
 
614
extern "C"
615
615
static bool
616
 
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
617
 
               char *argument)
 
616
get_one_option(int optid, const struct my_option *, char *argument)
618
617
{
619
618
  switch (optid) {
620
619
  case 'p':
963
962
 
964
963
  @returns  whether there was an error or not
965
964
*/
966
 
static int switch_character_set_results(DRIZZLE *drizzle, const char *cs_name)
 
965
static int switch_character_set_results(const char *cs_name)
967
966
{
968
967
  char query_buffer[QUERY_LENGTH];
969
968
  size_t query_length;
975
974
  query_length= snprintf(query_buffer,
976
975
                         sizeof (query_buffer),
977
976
                         "SET SESSION character_set_results = '%s'",
978
 
                         (const char *) cs_name);
 
977
                         cs_name);
979
978
 
980
979
  return drizzle_real_query(drizzle, query_buffer, query_length);
981
980
}
1415
1414
  if ((write_data= !(*ignore_flag & IGNORE_DATA)))
1416
1415
  {
1417
1416
    complete_insert= opt_complete_insert;
1418
 
    insert_pat= "";
 
1417
    insert_pat.clear();
1419
1418
  }
1420
1419
 
1421
1420
  insert_option= ((delayed && opt_ignore) ? " DELAYED IGNORE " :
1447
1446
 
1448
1447
      snprintf(buff, sizeof(buff), "show create table %s", result_table);
1449
1448
 
1450
 
      if (switch_character_set_results(drizzle, "binary") ||
 
1449
      if (switch_character_set_results("binary") ||
1451
1450
          drizzle_query_with_error_report(drizzle, &result, buff) ||
1452
 
          switch_character_set_results(drizzle, default_charset))
 
1451
          switch_character_set_results(default_charset))
1453
1452
        return(0);
1454
1453
 
1455
1454
      if (path)
1506
1505
        */
1507
1506
        snprintf(query_buff, sizeof(query_buff),
1508
1507
                 "SHOW FIELDS FROM %s", result_table);
1509
 
        if (switch_character_set_results(drizzle, "binary") ||
 
1508
        if (switch_character_set_results("binary") ||
1510
1509
            drizzle_query_with_error_report(drizzle, &result, query_buff) ||
1511
 
            switch_character_set_results(drizzle, default_charset))
 
1510
            switch_character_set_results(default_charset))
1512
1511
        {
1513
1512
          /*
1514
1513
            View references invalid or privileged table/col/fun (err 1356),
2204
2203
        if (extended_insert && !opt_xml)
2205
2204
        {
2206
2205
          if (i == 0)
2207
 
            extended_row= "(";
 
2206
          {
 
2207
            extended_row.clear();
 
2208
            extended_row.append("(");
 
2209
          }
2208
2210
          else
2209
2211
            extended_row.append(",");
2210
2212
 
2589
2591
    print_xml_tag(md_result_file, "", "\n", "database", "name=", database, NULL);
2590
2592
  if (lock_tables)
2591
2593
  {
2592
 
    string query;
2593
 
    query= "LOCK TABLES ";
 
2594
    string query("LOCK TABLES ");
2594
2595
    for (numrows= 0 ; (table= getTableName(1)) ; )
2595
2596
    {
2596
2597
      char *end= my_stpcpy(afterdot, table);
2689
2690
static int dump_selected_tables(char *db, char **table_names, int tables)
2690
2691
{
2691
2692
  char table_buff[NAME_LEN*2+3];
2692
 
  string lock_tables_query;
 
2693
  string lock_tables_query("LOCK TABLES ");
2693
2694
  MEM_ROOT root;
2694
2695
  char **dump_tables, **pos, **end;
2695
2696
 
2701
2702
  if (!(dump_tables= pos= (char**) alloc_root(&root, tables * sizeof(char *))))
2702
2703
     die(EX_EOM, "alloc_root failure.");
2703
2704
 
2704
 
  lock_tables_query= "LOCK TABLES ";
2705
2705
  for (; tables > 0 ; tables-- , table_names++)
2706
2706
  {
2707
2707
    /* the table name passed on commandline may be wrong case */
3055
3055
        *err_len= var_len;
3056
3056
      }
3057
3057
      else
3058
 
        found|= ((int64_t) 1 << (find - 1));
 
3058
        found|= (uint32_t)((int64_t) 1 << (find - 1));
3059
3059
      if (pos == end)
3060
3060
        break;
3061
3061
      start= pos + 1;