~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/catalog.cc

  • Committer: Brian Aker
  • Date: 2010-12-30 00:52:57 UTC
  • mto: (2060.4.1 clean)
  • mto: This revision was merged to the branch mainline in revision 2073.
  • Revision ID: brian@tangent.org-20101230005257-82j4x64gijal0u3q
Update code to test/handle conflicting create/drop schema.

Show diffs side-by-side

added added

removed removed

Lines of Context:
162
162
    return false;
163
163
  }
164
164
 
 
165
  size_t create_count= 0;
165
166
  BOOST_FOREACH(catalog::Engine::vector::const_reference ref, Engines::singleton().catalogs())
166
167
  {
167
168
    if (ref->create(identifier, message))
168
 
    {
169
 
      return false;
170
 
    }
 
169
      create_count++;
 
170
  }
 
171
  assert(create_count < 2);
 
172
 
 
173
  if (not create_count)
 
174
  {
 
175
    my_error(ER_CATALOG_CANNOT_CREATE, MYF(0), identifier.getName().c_str());
 
176
    return false;
171
177
  }
172
178
 
173
179
  return true;
190
196
  }
191
197
 
192
198
  
 
199
  size_t drop_count= 0;
193
200
  BOOST_FOREACH(catalog::Engine::vector::const_reference ref, Engines::singleton().catalogs())
194
201
  {
195
 
    if (not ref->drop(identifier))
196
 
    {
197
 
      return false;
198
 
    }
 
202
    if (ref->drop(identifier))
 
203
      drop_count++;
 
204
  }
 
205
  assert(drop_count < 2);
 
206
 
 
207
  if (not drop_count)
 
208
  {
 
209
    my_error(ER_CATALOG_DOES_NOT_EXIST, MYF(0), identifier.getName().c_str());
 
210
    return false;
199
211
  }
200
212
 
201
213
  return true;