~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_insert.cc

Removed client_capabilities from session and pushed functionality into protocol plugin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
448
448
  if (values_list.elements == 1 && (!(session->options & OPTION_WARNINGS) ||
449
449
                                    !session->cuted_fields))
450
450
  {
451
 
    session->row_count_func= info.copied + info.deleted +
452
 
                         ((session->client_capabilities & CLIENT_FOUND_ROWS) ?
453
 
                          info.touched : info.updated);
454
 
    session->my_ok((ulong) session->row_count_func, id);
 
451
    session->row_count_func= info.copied + info.deleted + info.updated;
 
452
    session->my_ok((ulong) session->row_count_func,
 
453
                   info.copied + info.deleted + info.touched, id);
455
454
  }
456
455
  else
457
456
  {
458
457
    char buff[160];
459
 
    ha_rows updated=((session->client_capabilities & CLIENT_FOUND_ROWS) ?
460
 
                     info.touched : info.updated);
461
458
    if (ignore)
462
459
      sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
463
460
              (ulong) (info.records - info.copied), (ulong) session->cuted_fields);
464
461
    else
465
462
      sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
466
 
              (ulong) (info.deleted + updated), (ulong) session->cuted_fields);
467
 
    session->row_count_func= info.copied + info.deleted + updated;
468
 
    session->my_ok((ulong) session->row_count_func, id, buff);
 
463
              (ulong) (info.deleted + info.updated), (ulong) session->cuted_fields);
 
464
    session->row_count_func= info.copied + info.deleted + info.updated;
 
465
    session->my_ok((ulong) session->row_count_func,
 
466
                   info.copied + info.deleted + info.touched, id, buff);
469
467
  }
470
468
  session->abort_on_warning= 0;
471
469
  DRIZZLE_INSERT_END();
1347
1345
  else
1348
1346
    sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
1349
1347
            (ulong) (info.deleted+info.updated), (ulong) session->cuted_fields);
1350
 
  session->row_count_func= info.copied + info.deleted +
1351
 
                       ((session->client_capabilities & CLIENT_FOUND_ROWS) ?
1352
 
                        info.touched : info.updated);
 
1348
  session->row_count_func= info.copied + info.deleted + info.updated;
1353
1349
 
1354
1350
  id= (session->first_successful_insert_id_in_cur_stmt > 0) ?
1355
1351
    session->first_successful_insert_id_in_cur_stmt :
1356
1352
    (session->arg_of_last_insert_id_function ?
1357
1353
     session->first_successful_insert_id_in_prev_stmt :
1358
1354
     (info.copied ? autoinc_value_of_last_inserted_row : 0));
1359
 
  session->my_ok((ulong) session->row_count_func, id, buff);
 
1355
  session->my_ok((ulong) session->row_count_func,
 
1356
                 info.copied + info.deleted + info.touched, id, buff);
1360
1357
  return(0);
1361
1358
}
1362
1359