~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-23 21:18:15 UTC
  • mto: (1273.13.97 build)
  • mto: This revision was merged to the branch mainline in revision 1309.
  • Revision ID: brian@gaz-20100223211815-ckwo3eun67ikzu1e
This restores temporary tables back to being viewable via show/select.

Show diffs side-by-side

added added

removed removed

Lines of Context:
607
607
}
608
608
 
609
609
/**
 
610
  Utility method which hides some of the details of getTableDefinition()
 
611
*/
 
612
bool plugin::StorageEngine::doesTableExist(Session& session,
 
613
                                           TableIdentifier &identifier,
 
614
                                           bool include_temporary_tables)
 
615
{
 
616
  return (plugin::StorageEngine::getTableDefinition(session, identifier, NULL, include_temporary_tables) == EEXIST);
 
617
}
 
618
 
 
619
/**
610
620
  Call this function in order to give the Cursor the possiblity
611
621
  to ask engine if there are any new tables that should be written to disk
612
622
  or any dropped tables that need to be removed from disk
613
623
*/
614
624
int plugin::StorageEngine::getTableDefinition(Session& session,
615
625
                                              TableIdentifier &identifier,
616
 
                                              message::Table *table_proto)
 
626
                                              message::Table *table_proto,
 
627
                                              bool include_temporary_tables)
617
628
{
618
629
  return getTableDefinition(session,
619
630
                            identifier.getPath(), identifier.getDBName(), identifier.getTableName(), identifier.isTmp(),
620
 
                            table_proto);
 
631
                            table_proto, include_temporary_tables);
621
632
}
622
633
 
623
634
int plugin::StorageEngine::getTableDefinition(Session& session,
624
635
                                              const char* path,
625
 
                                              const char *,
626
 
                                              const char *,
 
636
                                              const char *schema_name,
 
637
                                              const char *table_name,
627
638
                                              const bool,
628
 
                                              message::Table *table_proto)
 
639
                                              message::Table *table_proto,
 
640
                                              bool include_temporary_tables)
629
641
{
630
642
  int err= ENOENT;
631
643
 
 
644
  if (include_temporary_tables)
 
645
  {
 
646
    if (session.doGetTableDefinition(path, schema_name, table_name, false, table_proto) == EEXIST)
 
647
      return EEXIST;
 
648
  }
 
649
 
632
650
  vector<plugin::StorageEngine *>::iterator iter=
633
651
    find_if(vector_of_engines.begin(), vector_of_engines.end(),
634
652
            StorageEngineGetTableDefinition(session, path, NULL, NULL, true, table_proto, &err));