~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/cursor.cc

merged with latest trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
  */
84
84
  if (!(new_handler->ref= (unsigned char*) mem_root->alloc_root(ALIGN_SIZE(ref_length)*2)))
85
85
    return NULL;
 
86
 
86
87
  if (new_handler && !new_handler->ha_open(table,
87
88
                                           table->getMutableShare()->getNormalizedPath(),
88
89
                                           table->getDBStat(),
918
919
  range_seq_t seq_it;
919
920
  ha_rows rows, total_rows= 0;
920
921
  uint32_t n_ranges=0;
921
 
  Session *session= current_session;
922
922
 
923
923
  /* Default MRR implementation doesn't need buffer */
924
924
  *bufsz= 0;
926
926
  seq_it= seq->init(seq_init_param, n_ranges, *flags);
927
927
  while (!seq->next(seq_it, &range))
928
928
  {
929
 
    if (unlikely(session->killed != 0))
930
 
      return HA_POS_ERROR;
931
 
 
932
929
    n_ranges++;
933
930
    key_range *min_endp, *max_endp;
934
931
    {
1463
1460
  DRIZZLE_INSERT_ROW_START(table_share->getSchemaName(), table_share->getTableName());
1464
1461
  setTransactionReadWrite();
1465
1462
  
1466
 
  if (unlikely(plugin::EventObserver::beforeInsertRecord(*(table->in_use), *table_share, buf)))
 
1463
  if (unlikely(plugin::EventObserver::beforeInsertRecord(*table, buf)))
1467
1464
  {
1468
1465
    error= ER_EVENT_OBSERVER_PLUGIN;
1469
1466
  }
1470
1467
  else
1471
1468
  {
1472
1469
    error= doInsertRecord(buf);
1473
 
    if (unlikely(plugin::EventObserver::afterInsertRecord(*(table->in_use), *table_share, buf, error))) 
 
1470
    if (unlikely(plugin::EventObserver::afterInsertRecord(*table, buf, error))) 
1474
1471
    {
1475
1472
      error= ER_EVENT_OBSERVER_PLUGIN;
1476
1473
    }
1502
1499
 
1503
1500
  DRIZZLE_UPDATE_ROW_START(table_share->getSchemaName(), table_share->getTableName());
1504
1501
  setTransactionReadWrite();
1505
 
  if (unlikely(plugin::EventObserver::beforeUpdateRecord(*(table->in_use), *table_share, old_data, new_data)))
 
1502
  if (unlikely(plugin::EventObserver::beforeUpdateRecord(*table, old_data, new_data)))
1506
1503
  {
1507
1504
    error= ER_EVENT_OBSERVER_PLUGIN;
1508
1505
  }
1509
1506
  else
1510
1507
  {
1511
1508
    error= doUpdateRecord(old_data, new_data);
1512
 
    if (unlikely(plugin::EventObserver::afterUpdateRecord(*(table->in_use), *table_share, old_data, new_data, error)))
 
1509
    if (unlikely(plugin::EventObserver::afterUpdateRecord(*table, old_data, new_data, error)))
1513
1510
    {
1514
1511
      error= ER_EVENT_OBSERVER_PLUGIN;
1515
1512
    }
1534
1531
 
1535
1532
  DRIZZLE_DELETE_ROW_START(table_share->getSchemaName(), table_share->getTableName());
1536
1533
  setTransactionReadWrite();
1537
 
  if (unlikely(plugin::EventObserver::beforeDeleteRecord(*(table->in_use), *table_share, buf)))
 
1534
  if (unlikely(plugin::EventObserver::beforeDeleteRecord(*table, buf)))
1538
1535
  {
1539
1536
    error= ER_EVENT_OBSERVER_PLUGIN;
1540
1537
  }
1541
1538
  else
1542
1539
  {
1543
1540
    error= doDeleteRecord(buf);
1544
 
    if (unlikely(plugin::EventObserver::afterDeleteRecord(*(table->in_use), *table_share, buf, error)))
 
1541
    if (unlikely(plugin::EventObserver::afterDeleteRecord(*table, buf, error)))
1545
1542
    {
1546
1543
      error= ER_EVENT_OBSERVER_PLUGIN;
1547
1544
    }