~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzletest.cc

  • Committer: Monty Taylor
  • Date: 2009-09-26 20:00:08 UTC
  • mto: This revision was merged to the branch mainline in revision 1159.
  • Revision ID: mordred@inaugust.com-20090926200008-avdbjpomupa5loio
Append opt_testdir to result files being required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3324
3324
}
3325
3325
 
3326
3326
 
3327
 
static void do_get_file_name(struct st_command *command,
3328
 
                             char* dest, uint32_t dest_max_len)
 
3327
static void do_get_file_name(struct st_command *command, string &dest)
3329
3328
{
3330
3329
  char *p= command->first_argument, *name;
3331
3330
  if (!*p)
3336
3335
  if (*p)
3337
3336
    *p++= 0;
3338
3337
  command->last_argument= p;
3339
 
  strncpy(dest, name, dest_max_len - 1);
 
3338
  if (opt_testdir != NULL)
 
3339
  {
 
3340
    dest= opt_testdir;
 
3341
    if (dest[dest.length()] != '/')
 
3342
      dest.append("/");
 
3343
  }
 
3344
  dest.append(name);
3340
3345
}
3341
3346
 
3342
3347
 
5596
5601
  struct st_command *command;
5597
5602
  bool q_send_flag= 0, abort_flag= 0;
5598
5603
  uint32_t command_executed= 0, last_command_executed= 0;
5599
 
  char save_file[FN_REFLEN];
 
5604
  string save_file("");
5600
5605
  struct stat res_info;
5601
5606
  MY_INIT(argv[0]);
5602
5607
 
5603
 
  save_file[0]= 0;
5604
5608
  TMPDIR[0]= 0;
5605
5609
 
5606
5610
  /* Init expected errors */
5795
5799
        /* Check for special property for this query */
5796
5800
        display_result_vertically|= (command->type == Q_QUERY_VERTICAL);
5797
5801
 
5798
 
        if (save_file[0])
 
5802
        if (! save_file.empty())
5799
5803
        {
5800
 
          strncpy(command->require_file, save_file, sizeof(save_file) - 1);
5801
 
          save_file[0]= 0;
 
5804
          strncpy(command->require_file, save_file.c_str(), save_file.size());
 
5805
          save_file.clear();
5802
5806
        }
5803
5807
        run_query(cur_con, command, flags);
5804
5808
        command_executed++;
5835
5839
        command->last_argument= command->end;
5836
5840
        break;
5837
5841
      case Q_REQUIRE:
5838
 
        do_get_file_name(command, save_file, sizeof(save_file));
 
5842
        do_get_file_name(command, save_file);
5839
5843
        break;
5840
5844
      case Q_ERROR:
5841
5845
        do_get_errcodes(command);