~mdcallag/+junk/5.1-map

« back to all changes in this revision

Viewing changes to sql/sql_load.cc

  • Committer: msvensson at pilot
  • Date: 2007-04-24 09:11:45 UTC
  • mfrom: (2469.1.106)
  • Revision ID: sp1r-msvensson@pilot.blaudden-20070424091145-10463
Merge pilot.blaudden:/home/msvensson/mysql/my51-m-mysql_upgrade
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint

Show diffs side-by-side

added added

removed removed

Lines of Context:
175
175
    table is marked to be 'used for insert' in which case we should never
176
176
    mark this table as 'const table' (ie, one that has only one row).
177
177
  */
178
 
  if (unique_table(thd, table_list, table_list->next_global))
 
178
  if (unique_table(thd, table_list, table_list->next_global, 0))
179
179
  {
180
180
    my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->table_name);
181
181
    DBUG_RETURN(TRUE);
226
226
      DBUG_RETURN(TRUE);
227
227
  }
228
228
 
229
 
  table->mark_columns_needed_for_insert();
 
229
  prepare_triggers_for_insert_stmt(table);
230
230
 
231
231
  uint tot_length=0;
232
232
  bool use_blobs= 0, use_vars= 0;
376
376
      table->file->ha_start_bulk_insert((ha_rows) 0);
377
377
    table->copy_blobs=1;
378
378
 
379
 
    thd->no_trans_update= 0;
 
379
    thd->no_trans_update.stmt= FALSE;
380
380
    thd->abort_on_warning= (!ignore &&
381
381
                            (thd->variables.sql_mode &
382
382
                             (MODE_STRICT_TRANS_TABLES |
470
470
          (ulong) (info.records - info.copied), (ulong) thd->cuted_fields);
471
471
 
472
472
  if (!transactional_table)
473
 
    thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
 
473
    thd->no_trans_update.all= TRUE;
474
474
#ifndef EMBEDDED_LIBRARY
475
475
  if (mysql_bin_log.is_open())
476
476
  {
512
512
    mysql_unlock_tables(thd, thd->lock);
513
513
    thd->lock=0;
514
514
  }
 
515
  table->auto_increment_field_not_null= FALSE;
515
516
  thd->abort_on_warning= 0;
516
517
  DBUG_RETURN(error);
517
518
}
551
552
  Item_field *sql_field;
552
553
  TABLE *table= table_list->table;
553
554
  ulonglong id;
554
 
  bool no_trans_update;
 
555
  bool no_trans_update_stmt, err;
555
556
  DBUG_ENTER("read_fixed_length");
556
557
 
557
558
  id= 0;
579
580
#ifdef HAVE_purify
580
581
    read_info.row_end[0]=0;
581
582
#endif
582
 
    no_trans_update= !table->file->has_transactions();
 
583
    no_trans_update_stmt= !table->file->has_transactions();
583
584
 
584
585
    restore_record(table, s->default_values);
585
586
    /*
609
610
      {
610
611
        uint length;
611
612
        byte save_chr;
612
 
        if (field == table->next_number_field)
613
 
          table->auto_increment_field_not_null= TRUE;
614
613
        if ((length=(uint) (read_info.row_end-pos)) >
615
614
            field->field_length)
616
615
          length=field->field_length;
645
644
      DBUG_RETURN(-1);
646
645
    }
647
646
 
648
 
    if (write_record(thd, table, &info))
 
647
    err= write_record(thd, table, &info);
 
648
    table->auto_increment_field_not_null= FALSE;
 
649
    if (err)
649
650
      DBUG_RETURN(1);
650
 
    thd->no_trans_update= no_trans_update;
 
651
    thd->no_trans_update.stmt= no_trans_update_stmt;
651
652
   
652
653
    /*
653
654
      We don't need to reset auto-increment field since we are restoring
682
683
  TABLE *table= table_list->table;
683
684
  uint enclosed_length;
684
685
  ulonglong id;
685
 
  bool no_trans_update;
 
686
  bool no_trans_update_stmt, err;
686
687
  DBUG_ENTER("read_sep_field");
687
688
 
688
689
  enclosed_length=enclosed.length();
689
690
  id= 0;
690
 
  no_trans_update= !table->file->has_transactions();
 
691
  no_trans_update_stmt= !table->file->has_transactions();
691
692
 
692
693
  for (;;it.rewind())
693
694
  {
729
730
            DBUG_RETURN(1);
730
731
          }
731
732
          field->set_null();
732
 
          if (field == table->next_number_field)
733
 
            table->auto_increment_field_not_null= TRUE;
734
733
          if (!field->maybe_null())
735
734
          {
736
735
            if (field->type() == MYSQL_TYPE_TIMESTAMP)
816
815
      DBUG_RETURN(-1);
817
816
    }
818
817
 
819
 
 
820
 
    if (write_record(thd, table, &info))
 
818
    err= write_record(thd, table, &info);
 
819
    table->auto_increment_field_not_null= FALSE;
 
820
    if (err)
821
821
      DBUG_RETURN(1);
822
822
    /*
823
823
      We don't need to reset auto-increment field since we are restoring
824
824
      its default value at the beginning of each loop iteration.
825
825
    */
826
 
    thd->no_trans_update= no_trans_update;
 
826
    thd->no_trans_update.stmt= no_trans_update_stmt;
827
827
    if (read_info.next_line())                  // Skip to next line
828
828
      break;
829
829
    if (read_info.line_cuted)