~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/cursor.cc

  • Committer: Brian Aker
  • Date: 2009-12-05 01:48:28 UTC
  • mfrom: (1237.2.12 push)
  • Revision ID: brian@gaz-20091205014828-xd4e29ujttx2xe2j
MergeĀ forĀ staging.

Show diffs side-by-side

added added

removed removed

Lines of Context:
255
255
    TODO remove the test for HA_READ_ORDER
256
256
  */
257
257
  if (stats.deleted < 10 || primary_key >= MAX_KEY ||
258
 
      !(index_flags(primary_key, 0, 0) & HA_READ_ORDER))
 
258
      !(table->index_flags(primary_key) & HA_READ_ORDER))
259
259
  {
260
260
    (void) ha_rnd_init(1);
261
261
    while ((error= rnd_next(buf)) == HA_ERR_RECORD_DELETED) ;
695
695
  }
696
696
}
697
697
 
698
 
/**
699
 
  Bulk update row: public interface.
700
 
 
701
 
  @sa Cursor::bulk_update_row()
702
 
*/
703
 
 
704
 
int
705
 
Cursor::ha_bulk_update_row(const unsigned char *old_data, unsigned char *new_data,
706
 
                            uint32_t *dup_key_found)
707
 
{
708
 
  mark_trx_read_write();
709
 
 
710
 
  return bulk_update_row(old_data, new_data, dup_key_found);
711
 
}
712
 
 
713
698
 
714
699
/**
715
700
  Delete all rows: public interface.
716
701
 
717
702
  @sa Cursor::delete_all_rows()
 
703
 
 
704
  @note
 
705
 
 
706
  This is now equalivalent to TRUNCATE TABLE.
718
707
*/
719
708
 
720
709
int
722
711
{
723
712
  mark_trx_read_write();
724
713
 
725
 
  return delete_all_rows();
 
714
  int result= delete_all_rows();
 
715
 
 
716
  if (result == 0)
 
717
  {
 
718
    /** 
 
719
     * Trigger post-truncate notification to plugins... 
 
720
     *
 
721
     * @todo Make ReplicationServices generic to AfterTriggerServices
 
722
     * or similar...
 
723
     */
 
724
    Session *const session= table->in_use;
 
725
    ReplicationServices &replication_services= ReplicationServices::singleton();
 
726
    replication_services.truncateTable(session, table);
 
727
  }
 
728
 
 
729
  return result;
726
730
}
727
731
 
728
732
 
1468
1472
{
1469
1473
  int error;
1470
1474
 
1471
 
  /* 
1472
 
   * If we have a timestamp column, update it to the current time 
1473
 
   * 
 
1475
  /*
 
1476
   * If we have a timestamp column, update it to the current time
 
1477
   *
1474
1478
   * @TODO Technically, the below two lines can be take even further out of the
1475
1479
   * Cursor interface and into the fill_record() method.
1476
1480
   */