~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/identifier/catalog.cc

  • Committer: Brian Aker
  • Date: 2010-12-03 04:10:23 UTC
  • mto: (2017.3.1 catalogs)
  • mto: This revision was merged to the branch mainline in revision 2073.
  • Revision ID: brian@tangent.org-20101203041023-hd0cwx8jgwcrivck
Big hunk of burning create/drop work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
namespace identifier
45
45
{
46
46
 
47
 
static size_t build_schema_filename(string &path, const string &name)
 
47
static void build_schema_filename(string &path, const string &name)
48
48
{
49
 
  path.append("");
 
49
  path.append("../");
50
50
  bool conversion_error= false;
51
51
 
52
52
  conversion_error= util::tablename_to_filename(name, path);
55
55
    errmsg_printf(ERRMSG_LVL_ERROR,
56
56
                  _("Catalog name cannot be encoded and fit within filesystem "
57
57
                    "name length restrictions."));
58
 
    return 0;
59
58
  }
60
 
 
61
 
  return path.length();
62
59
}
63
60
 
64
61
Catalog::Catalog(const std::string &name_arg) :
65
 
  name(name_arg),
66
 
  path("")
 
62
  name(name_arg)
67
63
68
 
  if (not name_arg.empty())
69
 
  {
70
 
    build_schema_filename(path, name);
71
 
    assert(path.length()); // TODO throw exception, this is a possibility
72
 
  }
 
64
  assert(not name_arg.empty());
 
65
 
 
66
  build_schema_filename(path, name);
 
67
  assert(path.length()); // TODO throw exception, this is a possibility
73
68
 
74
69
  util::insensitive_hash hasher;
75
70
  hash_value= hasher(path);