~clint-fewbar/drizzle/regex-policy-cache-limiter

« back to all changes in this revision

Viewing changes to drizzled/catalog/local.cc

  • Committer: Clint Byrum
  • Date: 2012-03-15 18:05:43 UTC
  • mfrom: (2224.1.302 workspace)
  • Revision ID: clint@ubuntu.com-20120315180543-9jxxm4q10k3np2ws
merging with latest trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2010 Brian Aker
 
4
 *  Copyright (C) 2010-2011 Brian Aker, Stewart Smith
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
 
22
21
#include <config.h>
23
 
 
24
22
#include <drizzled/catalog/local.h>
25
23
#include <drizzled/plugin/catalog.h>
26
 
 
27
24
#include <boost/thread/once.hpp>
28
25
 
29
 
namespace drizzled
30
 
{
31
 
namespace catalog
32
 
{
 
26
namespace drizzled {
 
27
namespace catalog {
33
28
 
34
29
/* Setup the local catalog for us to use with session */
35
 
static identifier::Catalog default_catalog("LOCAL");
 
30
static identifier::Catalog default_catalog(str_ref("LOCAL"));
36
31
static catalog::Instance::shared_ptr _local_catalog;
37
32
 
38
33
static boost::once_flag run_once= BOOST_ONCE_INIT;
42
37
  _local_catalog= plugin::Catalog::getInstance(default_catalog);
43
38
}
44
39
 
45
 
identifier::Catalog::const_reference local_identifier()
 
40
const identifier::Catalog& local_identifier()
46
41
{
47
42
  return default_catalog;
48
43
}
49
44
 
 
45
void resetPath_for_local_identifier()
 
46
{
 
47
  /* this is currently commented out to do nothing as we don't need
 
48
     to reset the relative path ../local to anything but that.
 
49
     We will need to enable this when we don't chdir into local on startup */
 
50
//  default_catalog.resetPath();
 
51
}
 
52
 
50
53
Instance::shared_ptr local()
51
54
{
52
55
  boost::call_once(&init, run_once);