~linuxjedi/drizzle/elliott-bug-653300

« back to all changes in this revision

Viewing changes to client/drizzledump_mysql.cc

  • Committer: Andrew Hutchings
  • Date: 2010-10-01 23:19:59 UTC
  • Revision ID: andrew@linuxjedi.co.uk-20101001231959-z3y56nwatrffwkhi
1. date regex was broken
2. a pointer was set to output when processing date/time
3. a '%' was output with progress dumping

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
    return;
217
217
  }
218
218
 
219
 
  boost::regex date_regex("([0-9]{3}[1-9]-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]))");
 
219
  boost::regex date_regex("(0000|-00)");
220
220
 
221
 
  if (regex_search(oldDefault, date_regex, flags))
 
221
  if (not regex_search(oldDefault, date_regex, flags))
222
222
  {
223
223
    defaultValue= oldDefault;
224
224
  }
464
464
{
465
465
  boost::match_flag_type flags = boost::match_default;
466
466
  std::string output;
467
 
  boost::regex date_regex("([0-9]{3}[1-9]-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]))");
 
467
  boost::regex date_regex("(0000|-00)");
468
468
 
469
 
  if (regex_search(oldDate, date_regex, flags))
 
469
  if (not regex_search(oldDate, date_regex, flags))
470
470
  {
471
471
    output.push_back('\'');
472
472
    output.append(oldDate);
478
478
  return output;
479
479
}
480
480
 
481
 
std::ostream& DrizzleDumpDataMySQL::checkDateTime(std::ostream &os, const char* item, uint32_t field) const
 
481
std::string DrizzleDumpDataMySQL::checkDateTime(const char* item, uint32_t field) const
482
482
{
 
483
  std::string ret;
 
484
 
483
485
  if (table->fields[field]->convertDateTime)
484
486
  {
485
487
    if (table->fields[field]->type.compare("INT") == 0)
486
 
      os << convertTime(item);
 
488
      ret= boost::lexical_cast<std::string>(convertTime(item));
487
489
    else
488
 
      os << convertDate(item);
 
490
      ret= convertDate(item);
489
491
  }
490
 
  return os;
 
492
  return ret;
491
493
}
492
494