~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-19 23:42:02 UTC
  • mto: (1273.19.18 fix_is)
  • mto: This revision was merged to the branch mainline in revision 1309.
  • Revision ID: brian@gir.tangent.org-20100219234202-boogaw8j3folts51
Basic engine with test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
690
690
  }
691
691
};
692
692
 
 
693
void StorageEngine::doGetSchemaNames(std::set<std::string>& )
 
694
{
 
695
}
 
696
 
 
697
class AddSchemaNames : 
 
698
  public unary_function<StorageEngine *, void>
 
699
{
 
700
  set<string>& set_of_names;
 
701
 
 
702
public:
 
703
 
 
704
  AddSchemaNames(set<string>& of_names) :
 
705
    set_of_names(of_names)
 
706
  {
 
707
  }
 
708
 
 
709
  result_type operator() (argument_type engine)
 
710
  {
 
711
    engine->doGetSchemaNames(set_of_names);
 
712
  }
 
713
};
 
714
 
693
715
void StorageEngine::getSchemaNames(set<string>& set_of_names)
694
716
{
695
 
  CachedDirectory directory(drizzle_data_home, CachedDirectory::DIRECTORY);
696
 
 
697
 
  CachedDirectory::Entries files= directory.getEntries();
698
 
 
699
 
  for (CachedDirectory::Entries::iterator fileIter= files.begin();
700
 
       fileIter != files.end(); fileIter++)
701
 
  {
702
 
    CachedDirectory::Entry *entry= *fileIter;
703
 
    set_of_names.insert(entry->filename);
704
 
  }
705
 
 
706
 
  set_of_names.insert("information_schema"); // special cases suck
707
 
 
708
717
  // Add hook here for engines to register schema.
709
 
#if 0
710
718
  for_each(vector_of_engines.begin(), vector_of_engines.end(),
711
 
           AddTableName(directory, db, set_of_names));
712
 
#endif
 
719
           AddSchemaNames(set_of_names));
713
720
}
714
721
 
715
722
/*