~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzledump_drizzle.cc

 Merge Andrew - fix bug 651950 - Table comments not retrieved using drizzledump

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
  if (verbose)
41
41
    std::cerr << _("-- Retrieving table structures for ") << databaseName << "..." << std::endl;
42
42
 
43
 
  query="SELECT TABLE_NAME, TABLE_COLLATION, ENGINE, AUTO_INCREMENT FROM DATA_DICTIONARY.TABLES WHERE TABLE_SCHEMA='";
 
43
  query="SELECT TABLE_NAME, TABLE_COLLATION, ENGINE, AUTO_INCREMENT, TABLE_COMMENT FROM DATA_DICTIONARY.TABLES WHERE TABLE_SCHEMA='";
44
44
  query.append(databaseName);
45
45
  query.append("' ORDER BY TABLE_NAME");
46
46
 
51
51
 
52
52
  while ((row= drizzle_row_next(result)))
53
53
  {
 
54
    size_t* row_sizes= drizzle_row_field_sizes(result);
54
55
    std::string tableName(row[0]);
55
56
    std::string displayName(tableName);
56
57
    cleanTableName(displayName);
62
63
    table->collate= row[1];
63
64
    table->engineName= row[2];
64
65
    table->autoIncrement= boost::lexical_cast<uint64_t>(row[3]);
 
66
    if (row[4])
 
67
      table->comment= DrizzleDumpData::escape(row[4], row_sizes[4]);
 
68
    else
 
69
      table->comment= "";
65
70
    table->database= this;
66
71
    if ((not table->populateFields()) or (not table->populateIndexes()))
67
72
    {