~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/identifier/catalog.cc

  • Committer: Stewart Smith
  • Date: 2011-01-14 05:16:49 UTC
  • mto: (2086.1.3 build)
  • mto: This revision was merged to the branch mainline in revision 2087.
  • Revision ID: stewart@flamingspork.com-20110114051649-4kg0mdrgdtako8vp
add a FIXME to flesh out insert docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include <config.h>
 
21
#include "config.h"
22
22
 
23
23
#include <assert.h>
24
24
 
25
 
#include <drizzled/identifier.h>
26
 
#include <drizzled/session.h>
27
 
#include <drizzled/internal/my_sys.h>
 
25
#include "drizzled/identifier.h"
 
26
#include "drizzled/session.h"
 
27
#include "drizzled/current_session.h"
 
28
#include "drizzled/internal/my_sys.h"
28
29
 
29
 
#include <drizzled/util/tablename_to_filename.h>
30
 
#include <drizzled/util/backtrace.h>
 
30
#include "drizzled/util/tablename_to_filename.h"
 
31
#include "drizzled/util/backtrace.h"
31
32
 
32
33
#include <algorithm>
33
34
#include <sstream>
51
52
  conversion_error= util::tablename_to_filename(name_arg, path);
52
53
  if (conversion_error)
53
54
  {
54
 
    errmsg_printf(error::ERROR,
 
55
    errmsg_printf(ERRMSG_LVL_ERROR,
55
56
                  _("Catalog name cannot be encoded and fit within filesystem "
56
57
                    "name length restrictions."));
57
58
  }
60
61
Catalog::Catalog(const std::string &name_arg) :
61
62
  _name(name_arg)
62
63
63
 
  init();
64
 
}
65
 
 
66
 
Catalog::Catalog(const drizzled::LEX_STRING &name_arg) :
67
 
  _name(name_arg.str, name_arg.length)
68
 
{
69
 
  init();
70
 
}
71
 
 
72
 
void  Catalog::init()
73
 
74
 
  assert(not _name.empty());
 
64
  assert(not name_arg.empty());
75
65
 
76
66
  build_schema_filename(path, _name);
77
67
  assert(path.length()); // TODO throw exception, this is a possibility
124
114
  return b.getHashValue();
125
115
}
126
116
 
127
 
void Catalog::getSQLPath(std::string &sql_path) const
128
 
{
129
 
  sql_path= _name;
130
 
}
131
 
 
132
 
 
133
117
 
134
118
} /* namespace identifier */
135
119
} /* namespace drizzled */