~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-24 23:55:45 UTC
  • mto: (1273.13.101 build)
  • mto: This revision was merged to the branch mainline in revision 1309.
  • Revision ID: brian@gaz-20100224235545-amlr2y9rfv6ctl2r
Move Alter schema to SE interface.

Show diffs side-by-side

added added

removed removed

Lines of Context:
834
834
  return true;
835
835
}
836
836
 
 
837
class AlterSchema : 
 
838
  public unary_function<StorageEngine *, void>
 
839
{
 
840
  const drizzled::message::Schema &schema_message;
 
841
 
 
842
public:
 
843
 
 
844
  AlterSchema(const drizzled::message::Schema &arg) :
 
845
    schema_message(arg)
 
846
  {
 
847
  }
 
848
 
 
849
  result_type operator() (argument_type engine)
 
850
  {
 
851
    // @todo eomeday check that at least one engine said "true"
 
852
    (void)engine->doAlterSchema(schema_message);
 
853
  }
 
854
};
 
855
 
 
856
bool StorageEngine::alterSchema(const drizzled::message::Schema &schema_message)
 
857
{
 
858
  // Add hook here for engines to register schema.
 
859
  for_each(vector_of_engines.begin(), vector_of_engines.end(),
 
860
           AlterSchema(schema_message));
 
861
 
 
862
  return true;
 
863
}
 
864
 
 
865
 
837
866
void StorageEngine::getTableNames(const string& db, set<string>& set_of_names)
838
867
{
839
868
  char tmp_path[FN_REFLEN];