~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzledump_drizzle.cc

  • Committer: lbieber
  • Date: 2010-10-02 15:03:20 UTC
  • mfrom: (1808.1.3 build)
  • Revision ID: lbieber@orisndriz08-20101002150320-b4h2za7uf98juxql
Merge Andrew - fix bug 652645 - Bad error handling with Drizzledump connect
Merge Andrew - fix bug 652228 - drizzledump not dumping auto-inc when connecting to drizzle servers
Merge Andrew - fix bug 649844 - Clean up and fix some drizzledump options along with some documentation fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <drizzled/gettext.h>
26
26
#include <boost/lexical_cast.hpp>
27
27
 
28
 
extern bool  verbose;
 
28
extern bool verbose;
 
29
extern bool ignore_errors;
29
30
 
30
31
bool DrizzleDumpDatabaseDrizzle::populateTables()
31
32
{
39
40
  if (verbose)
40
41
    std::cerr << _("-- Retrieving table structures for ") << databaseName << "..." << std::endl;
41
42
 
42
 
  query="SELECT TABLE_NAME, TABLE_COLLATION, ENGINE FROM DATA_DICTIONARY.TABLES WHERE TABLE_SCHEMA='";
 
43
  query="SELECT TABLE_NAME, TABLE_COLLATION, ENGINE, AUTO_INCREMENT FROM DATA_DICTIONARY.TABLES WHERE TABLE_SCHEMA='";
43
44
  query.append(databaseName);
44
45
  query.append("' ORDER BY TABLE_NAME");
45
46
 
60
61
    table->displayName= displayName;
61
62
    table->collate= row[1];
62
63
    table->engineName= row[2];
63
 
    table->autoIncrement= 0;
 
64
    table->autoIncrement= boost::lexical_cast<uint64_t>(row[3]);
64
65
    table->database= this;
65
66
    if ((not table->populateFields()) or (not table->populateIndexes()))
66
67
    {
67
68
      delete table;
68
 
      return false;
 
69
      if (not ignore_errors)
 
70
        return false;
 
71
      else
 
72
        continue;
69
73
    }
70
74
    tables.push_back(table);
71
75
  }
121
125
        std::cerr  << "Error: Could not get fields and/ot indexes for table " << displayName << std::endl;
122
126
        delete table;
123
127
        dcon->freeResult(result);
124
 
        return false;
 
128
        if (not ignore_errors)
 
129
          return false;
 
130
        else
 
131
          continue;
125
132
      }
126
133
      tables.push_back(table);
127
134
      dcon->freeResult(result);
130
137
    {
131
138
      std::cerr << "Error: Table " << displayName << " not found." << std::endl;
132
139
      dcon->freeResult(result);
133
 
      return false;
 
140
      if (not ignore_errors)
 
141
        return false;
 
142
      else
 
143
        continue;
134
144
    }
135
145
  }
136
146