~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/schema_engine/schema.cc

  • Committer: Stewart Smith
  • Date: 2011-12-27 06:49:23 UTC
  • mto: This revision was merged to the branch mainline in revision 2485.
  • Revision ID: stewart@flamingspork.com-20111227064923-tw8ccr27tpx98waq
Partially move towards using LOCAL catalog in all path generation by removing getDataHomeCatalog() and instead using catalog::local_identifier() around the place. We do a bit of prep work in the schema engine too. Next step is to remove chdir to 'local' and generate local as part of path to all objects.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <drizzled/sql_table.h>
27
27
#include <drizzled/charset.h>
28
28
#include <drizzled/cursor.h>
29
 
#include <drizzled/data_home.h>
 
29
#include <drizzled/catalog/local.h>
30
30
 
31
31
#include <drizzled/pthread_globals.h>
32
32
 
71
71
 
72
72
void Schema::prime()
73
73
{
74
 
  CachedDirectory directory(getDataHomeCatalog().file_string(), CachedDirectory::DIRECTORY);
 
74
  CachedDirectory directory(catalog::local_identifier().getPath(),
 
75
                            CachedDirectory::DIRECTORY, true);
 
76
 
75
77
  CachedDirectory::Entries files= directory.getEntries();
76
78
  boost::unique_lock<boost::shared_mutex> scopedLock(mutex);
77
79
 
80
82
    if (not entry->filename.compare(GLOBAL_TEMPORARY_EXT))
81
83
      continue;
82
84
    message::Schema schema_message;
83
 
    if (readSchemaFile(entry->filename, schema_message))
 
85
 
 
86
    std::string filename= catalog::local_identifier().getPath();
 
87
    filename+= FN_LIBCHAR;
 
88
    filename+= entry->filename;
 
89
 
 
90
    if (readSchemaFile(filename, schema_message))
84
91
    {
85
92
      identifier::Schema schema_identifier(schema_message.name());
86
93