~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_load.cc

  • Committer: Monty Taylor
  • Date: 2010-11-25 01:53:19 UTC
  • mto: (1953.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1955.
  • Revision ID: mordred@inaugust.com-20101125015319-ia85msn25uemopgc
Re-enabled -Wformat and then cleaned up the carnage.

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
 
  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
 
141
  const char *tdb= session->db.empty() ? table_list->getSchemaName()  : session->db.c_str();            // Result is never null
143
142
  assert(tdb);
144
143
  uint32_t skip_lines= ex->skip_lines;
145
144
  bool transactional_table;
206
205
    */
207
206
    if (table->timestamp_field)
208
207
    {
209
 
      if (table->isWriteSet(table->timestamp_field->position()))
210
 
      {
 
208
      if (table->isWriteSet(table->timestamp_field->field_index))
211
209
        table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
212
 
      }
213
210
      else
214
211
      {
215
 
        table->setWriteSet(table->timestamp_field->position());
 
212
        table->setWriteSet(table->timestamp_field->field_index);
216
213
      }
217
214
    }
218
215
    /* Fix the expressions in SET clause */
319
316
  info.handle_duplicates=handle_duplicates;
320
317
  info.escape_char=escaped->length() ? (*escaped)[0] : INT_MAX;
321
318
 
322
 
  SchemaIdentifier identifier(*schema);
 
319
  SchemaIdentifier identifier(session->db);
323
320
  READ_INFO read_info(file, tot_length,
324
321
                      ex->cs ? ex->cs : plugin::StorageEngine::getSchemaCollation(identifier),
325
322
                      *field_term, *ex->line_start, *ex->line_term, *enclosed,