~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzledump_drizzle.cc

  • Committer: pcrews
  • Date: 2011-05-24 17:36:24 UTC
  • mfrom: (1099.4.232 drizzle)
  • Revision ID: pcrews@lucid32-20110524173624-mwr1bvq6fa1r01ao
Updated translations + 2011.05.18 tarball tag

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, TABLE_COMMENT FROM DATA_DICTIONARY.TABLES WHERE TABLE_SCHEMA='";
 
43
  query="SELECT TABLE_NAME, TABLE_COLLATION, ENGINE, AUTO_INCREMENT, TABLE_COMMENT, IS_REPLICATED FROM DATA_DICTIONARY.TABLES WHERE TABLE_SCHEMA='";
44
44
  query.append(databaseName);
45
45
  query.append("' ORDER BY TABLE_NAME");
46
46
 
67
67
      table->comment= DrizzleDumpData::escape(row[4], row_sizes[4]);
68
68
    else
69
69
      table->comment= "";
 
70
 
 
71
    table->replicate= (strcmp(row[5], "1") == 0) ? true : false;
70
72
    table->database= this;
71
73
    if ((not table->populateFields()) or (not table->populateIndexes()) or
72
74
      (not table->populateFkeys()))
104
106
    if (not ignoreTable(displayName))
105
107
      continue;
106
108
 
107
 
    query="SELECT TABLE_NAME, TABLE_COLLATION, ENGINE FROM DATA_DICTIONARY.TABLES WHERE TABLE_SCHEMA='";
 
109
    query="SELECT TABLE_NAME, TABLE_COLLATION, ENGINE, IS_REPLICATED FROM DATA_DICTIONARY.TABLES WHERE TABLE_SCHEMA='";
108
110
    query.append(databaseName);
109
111
    query.append("' AND TABLE_NAME = '");
110
112
    query.append(tableName);
124
126
      table->displayName= displayName;
125
127
      table->collate= row[1];
126
128
      table->engineName= row[2];
 
129
      table->replicate= (strcmp(row[3], "1") == 0) ? true : false;
127
130
      table->autoIncrement= 0;
128
131
      table->database= this;
129
132
      if ((not table->populateFields()) or (not table->populateIndexes()))
195
198
    else
196
199
      field->defaultValue= "";
197
200
 
198
 
    field->isNull= (strcmp(row[4], "YES") == 0) ? true : false;
199
 
    field->isAutoIncrement= (strcmp(row[9], "YES") == 0) ? true : false;
200
 
    field->defaultIsNull= (strcmp(row[3], "YES") == 0) ? true : false;
 
201
    field->isNull= (boost::lexical_cast<uint32_t>(row[4])) ? true : false;
 
202
    field->isAutoIncrement= (boost::lexical_cast<uint32_t>(row[9])) ? true : false;
 
203
    field->defaultIsNull= (boost::lexical_cast<uint32_t>(row[3])) ? true : false;
201
204
    field->enumValues= (row[10]) ? row[10] : "";
202
205
    field->length= (row[5]) ? boost::lexical_cast<uint32_t>(row[5]) : 0;
203
206
    field->decimalPrecision= (row[6]) ? boost::lexical_cast<uint32_t>(row[6]) : 0;
244
247
        indexes.push_back(index);
245
248
      index = new DrizzleDumpIndexDrizzle(indexName, dcon);
246
249
      index->isPrimary= (strcmp(row[0], "PRIMARY") == 0);
247
 
      index->isUnique= (strcmp(row[3], "YES") == 0);
 
250
      index->isUnique= boost::lexical_cast<uint32_t>(row[3]);
248
251
      index->isHash= 0;
249
 
      index->length= (row[4]) ? boost::lexical_cast<uint32_t>(row[4]) : 0;
250
252
      lastKey= row[0];
251
253
      firstIndex= false;
252
254
    }
253
 
    index->columns.push_back(row[1]);
 
255
    uint32_t length= (row[4]) ? boost::lexical_cast<uint32_t>(row[4]) : 0;
 
256
    index->columns.push_back(std::make_pair(row[1],length));
254
257
  }
255
258
  if (!firstIndex)
256
259
    indexes.push_back(index);