~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/storage_engine.cc

  • Committer: Brian Aker
  • Date: 2010-02-25 07:52:23 UTC
  • mto: (1273.13.101 build)
  • mto: This revision was merged to the branch mainline in revision 1309.
  • Revision ID: brian@gaz-20100225075223-125dkr0n8kpmobkj
Fix dropSchema().

Show diffs side-by-side

added added

removed removed

Lines of Context:
839
839
  return true;
840
840
}
841
841
 
 
842
class DropSchema : 
 
843
  public unary_function<StorageEngine *, void>
 
844
{
 
845
  uint64_t &success_count;
 
846
  const string &schema_name;
 
847
 
 
848
public:
 
849
 
 
850
  DropSchema(const string &arg, uint64_t &count_arg) :
 
851
    success_count(count_arg),
 
852
    schema_name(arg)
 
853
  {
 
854
  }
 
855
 
 
856
  result_type operator() (argument_type engine)
 
857
  {
 
858
    // @todo eomeday check that at least one engine said "true"
 
859
    bool success= engine->doDropSchema(schema_name);
 
860
 
 
861
    if (success)
 
862
      success_count++;
 
863
  }
 
864
};
 
865
 
 
866
bool StorageEngine::dropSchema(const string &schema_name)
 
867
{
 
868
  uint64_t counter= 0;
 
869
  // Add hook here for engines to register schema.
 
870
  for_each(vector_of_schema_engines.begin(), vector_of_schema_engines.end(),
 
871
           DropSchema(schema_name, counter));
 
872
 
 
873
  return counter ? true : false;
 
874
}
 
875
 
842
876
class AlterSchema : 
843
877
  public unary_function<StorageEngine *, void>
844
878
{