~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_update.cc

Merge of Jay

Show diffs side-by-side

added added

removed removed

Lines of Context:
139
139
  List<Item> all_fields;
140
140
  Session::killed_state killed_status= Session::NOT_KILLED;
141
141
 
142
 
  DRIZZLE_UPDATE_START();
 
142
  DRIZZLE_UPDATE_START(session->query);
143
143
  if (session->openTablesLock(table_list))
 
144
  {
 
145
    DRIZZLE_UPDATE_DONE(1, 0, 0);
144
146
    return 1;
 
147
  }
145
148
 
146
149
  session->set_proc_info("init");
147
150
  table= table_list->table;
179
182
  if (select_lex->inner_refs_list.elements &&
180
183
    fix_inner_refs(session, all_fields, select_lex, select_lex->ref_pointer_array))
181
184
  {
182
 
    DRIZZLE_UPDATE_END();
183
 
    return(-1);
 
185
    DRIZZLE_UPDATE_DONE(1, 0, 0);
 
186
    return -1;
184
187
  }
185
188
 
186
189
  if (conds)
215
218
    free_underlaid_joins(session, select_lex);
216
219
    if (error)
217
220
      goto abort;                               // Error in where
218
 
    DRIZZLE_UPDATE_END();
 
221
    DRIZZLE_UPDATE_DONE(0, 0, 0);
219
222
    session->my_ok();                           // No matching records
220
 
    return(0);
 
223
    return 0;
221
224
  }
222
225
  if (!select && limit != HA_POS_ERROR)
223
226
  {
627
630
  id= session->arg_of_last_insert_id_function ?
628
631
    session->first_successful_insert_id_in_prev_stmt : 0;
629
632
 
630
 
  DRIZZLE_UPDATE_END();
631
633
  if (error < 0)
632
634
  {
633
635
    char buff[STRING_BUFFER_USUAL_SIZE];
638
640
  }
639
641
  session->count_cuted_fields= CHECK_FIELD_IGNORE;              /* calc cuted fields */
640
642
  session->abort_on_warning= 0;
641
 
  return((error >= 0 || session->is_error()) ? 1 : 0);
 
643
  DRIZZLE_UPDATE_DONE((error >= 0 || session->is_error()), found, updated);
 
644
  return ((error >= 0 || session->is_error()) ? 1 : 0);
642
645
 
643
646
err:
644
647
  delete select;
651
654
  session->abort_on_warning= 0;
652
655
 
653
656
abort:
654
 
  DRIZZLE_UPDATE_END();
655
 
  return(1);
 
657
  DRIZZLE_UPDATE_DONE(1, 0, 0);
 
658
  return 1;
656
659
}
657
660
 
658
661
/*