~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_load.cc

  • Committer: Brian Aker
  • Date: 2010-12-07 18:30:53 UTC
  • mto: This revision was merged to the branch mainline in revision 1983.
  • Revision ID: brian@tangent.org-20101207183053-eg32l3701i5qvkh7
This resolves the issue where one thread may be looking at schema while
another thread could be updating it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
138
138
    If this is not set, we will use the directory where the table to be
139
139
    loaded is located
140
140
  */
141
 
  const char *tdb= session->db.empty() ? table_list->getSchemaName()  : session->db.c_str();            // Result is never null
 
141
  util::string::const_shared_ptr schema(session->schema());
 
142
  const char *tdb= (schema and not schema->empty()) ? schema->c_str() : table_list->getSchemaName(); // Result should never be null
142
143
  assert(tdb);
143
144
  uint32_t skip_lines= ex->skip_lines;
144
145
  bool transactional_table;
316
317
  info.handle_duplicates=handle_duplicates;
317
318
  info.escape_char=escaped->length() ? (*escaped)[0] : INT_MAX;
318
319
 
319
 
  SchemaIdentifier identifier(session->db);
 
320
  SchemaIdentifier identifier(*schema);
320
321
  READ_INFO read_info(file, tot_length,
321
322
                      ex->cs ? ex->cs : plugin::StorageEngine::getSchemaCollation(identifier),
322
323
                      *field_term, *ex->line_start, *ex->line_term, *enclosed,