~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/identifier/schema.cc

  • Committer: Mark Atwood
  • Date: 2011-08-04 16:21:21 UTC
  • mfrom: (2318.9.14 refactor3)
  • Revision ID: me@mark.atwood.name-20110804162121-6b9ay1b1de3yfgvl
mergeĀ lp:~olafvdspek/drizzle/refactor3

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
namespace drizzled {
42
42
namespace identifier {
43
43
 
44
 
extern string drizzle_tmpdir;
45
 
 
46
 
static size_t build_schema_filename(string &path, const string &db)
47
 
{
48
 
  path.append("");
49
 
  bool conversion_error= false;
50
 
 
51
 
  conversion_error= util::tablename_to_filename(db, path);
52
 
  if (conversion_error)
53
 
  {
54
 
    errmsg_printf(error::ERROR,
55
 
                  _("Schema name cannot be encoded and fit within filesystem "
56
 
                    "name length restrictions."));
57
 
    return 0;
58
 
  }
59
 
 
60
 
  return path.length();
61
 
}
62
 
 
63
44
Schema::Schema(const std::string &db_arg) :
64
45
  db(db_arg)
65
46
75
56
 
76
57
  if (not db_arg.empty())
77
58
  {
78
 
    build_schema_filename(db_path, db);
 
59
    db_path += util::tablename_to_filename(db);
79
60
    assert(db_path.length()); // TODO throw exception, this is a possibility
80
61
  }
81
62
}