~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzledump_data.cc

  • Committer: Monty Taylor
  • Date: 2010-10-05 16:22:51 UTC
  • mfrom: (1802.7.4 build)
  • Revision ID: mordred@inaugust.com-20101005162251-h1uk27p0k1bly0fm
Merge Andrew - fix bug 651950 - Table comments

Show diffs side-by-side

added added

removed removed

Lines of Context:
306
306
            (obj.table->fields[i]->type.compare("VARBINARY") == 0)))
307
307
            os << obj.convertHex((unsigned char*)row[i], row_sizes[i]);
308
308
          else
309
 
            os << "'" << obj.escape(row[i], row_sizes[i]) << "'";
 
309
            os << "'" << DrizzleDumpData::escape(row[i], row_sizes[i]) << "'";
310
310
        }
311
311
        else
312
312
          os << row[i];
353
353
}
354
354
 
355
355
/* Ripped out of libdrizzle, hopefully a little safer */
356
 
std::string DrizzleDumpData::escape(const char* from, size_t from_size) const
 
356
std::string DrizzleDumpData::escape(const char* from, size_t from_size)
357
357
{
358
358
  std::string output;
359
359
 
421
421
    os << "AUTO_INCREMENT=" << obj.autoIncrement << " ";
422
422
  }
423
423
 
424
 
  os << "COLLATE = " << obj.collate << ";" << std::endl << std::endl;
 
424
  os << "COLLATE = " << obj.collate;
 
425
 
 
426
  if (not obj.comment.empty())
 
427
  {
 
428
    os << " COMMENT = '" << obj.comment << "'";
 
429
  }
 
430
 
 
431
  os << ";" << std::endl << std::endl;
425
432
 
426
433
  return os;
427
434
}