~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_load.cc

MergedĀ fromĀ me.

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
    If this is not set, we will use the directory where the table to be
129
129
    loaded is located
130
130
  */
131
 
  char *tdb= session->db ? session->db : db;            // Result is never null
 
131
  const char *tdb= session->db.empty() ? db  : session->db.c_str();             // Result is never null
132
132
  assert(tdb);
133
133
  uint32_t skip_lines= ex->skip_lines;
134
134
  bool transactional_table;
158
158
    table is marked to be 'used for insert' in which case we should never
159
159
    mark this table as 'const table' (ie, one that has only one row).
160
160
  */
161
 
  if (unique_table(session, table_list, table_list->next_global, 0))
 
161
  if (unique_table(table_list, table_list->next_global))
162
162
  {
163
163
    my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->table_name);
164
164
    return(true);
301
301
  info.escape_char=escaped->length() ? (*escaped)[0] : INT_MAX;
302
302
 
303
303
  READ_INFO read_info(file, tot_length,
304
 
                      ex->cs ? ex->cs : get_default_db_collation(session->db),
 
304
                      ex->cs ? ex->cs : get_default_db_collation(session->db.c_str()),
305
305
                      *field_term,*ex->line_start, *ex->line_term, *enclosed,
306
306
                      info.escape_char, is_fifo);
307
307
  if (read_info.error)
357
357
                            *enclosed, skip_lines, ignore);
358
358
    if (table->cursor->ha_end_bulk_insert() && !error)
359
359
    {
360
 
      table->cursor->print_error(my_errno, MYF(0));
 
360
      table->print_error(my_errno, MYF(0));
361
361
      error= 1;
362
362
    }
363
363
    table->cursor->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);