~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/identifier/table.cc

  • Committer: Olaf van der Spek
  • Date: 2011-07-07 13:28:01 UTC
  • mto: This revision was merged to the branch mainline in revision 2385.
  • Revision ID: olafvdspek@gmail.com-20110707132801-dki21sirljv1x4ny
Refactor build_table_filename

Show diffs side-by-side

added added

removed removed

Lines of Context:
177
177
    path length on success, 0 on failure
178
178
*/
179
179
 
180
 
void Table::build_table_filename(std::string &in_path, const std::string &in_db, const std::string &in_table_name, bool is_tmp)
 
180
std::string Table::build_table_filename(const std::string &in_db, const std::string &in_table_name, bool is_tmp)
181
181
{
182
 
  in_path += util::tablename_to_filename(in_db);
183
 
  in_path += FN_LIBCHAR;
184
 
  in_path += is_tmp ? in_table_name : util::tablename_to_filename(in_table_name);
 
182
  string in_path= util::tablename_to_filename(in_db) + FN_LIBCHAR;
 
183
  return in_path + (is_tmp ? in_table_name : util::tablename_to_filename(in_table_name));
185
184
}
186
185
 
187
186
Table::Table(const drizzled::Table &table) :
202
201
  case message::Table::FUNCTION:
203
202
  case message::Table::STANDARD:
204
203
    assert(path.empty());
205
 
    build_table_filename(path, getSchemaName(), table_name, false);
 
204
    path= build_table_filename(getSchemaName(), table_name, false);
206
205
    break;
207
206
  case message::Table::INTERNAL:
208
207
    assert(path.empty());
209
 
    build_table_filename(path, getSchemaName(), table_name, true);
 
208
    path= build_table_filename(getSchemaName(), table_name, true);
210
209
    break;
211
210
  case message::Table::TEMPORARY:
212
211
    if (path.empty())