~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_insert.cc

  • Committer: Monty Taylor
  • Date: 2010-05-12 05:00:55 UTC
  • mto: (1527.1.5 staging)
  • mto: This revision was merged to the branch mainline in revision 1529.
  • Revision ID: mordred@inaugust.com-20100512050055-i0kvg8xpr9dupz54
Wrap the libraries in if BUILD_*_PLUGIN so that they don't build when we're
disabling.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
/* Insert of records */
18
18
 
19
19
#include "config.h"
 
20
#include <cstdio>
20
21
#include <drizzled/sql_select.h>
21
22
#include <drizzled/show.h>
22
23
#include <drizzled/error.h>
721
722
 
722
723
  if (info->handle_duplicates == DUP_REPLACE || info->handle_duplicates == DUP_UPDATE)
723
724
  {
724
 
    while ((error=table->cursor->ha_write_row(table->record[0])))
 
725
    while ((error=table->cursor->insertRecord(table->record[0])))
725
726
    {
726
727
      uint32_t key_nr;
727
728
      /*
820
821
             !bitmap_is_subset(table->write_set, table->read_set)) ||
821
822
            table->compare_record())
822
823
        {
823
 
          if ((error=table->cursor->ha_update_row(table->record[1],
 
824
          if ((error=table->cursor->updateRecord(table->record[1],
824
825
                                                table->record[0])) &&
825
826
              error != HA_ERR_RECORD_IS_THE_SAME)
826
827
          {
875
876
            (table->timestamp_field_type == TIMESTAMP_NO_AUTO_SET ||
876
877
             table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_BOTH))
877
878
        {
878
 
          if ((error=table->cursor->ha_update_row(table->record[1],
 
879
          if ((error=table->cursor->updateRecord(table->record[1],
879
880
                                                table->record[0])) &&
880
881
              error != HA_ERR_RECORD_IS_THE_SAME)
881
882
            goto err;
892
893
        }
893
894
        else
894
895
        {
895
 
          if ((error=table->cursor->ha_delete_row(table->record[1])))
 
896
          if ((error=table->cursor->deleteRecord(table->record[1])))
896
897
            goto err;
897
898
          info->deleted++;
898
899
          if (!table->cursor->has_transactions())
910
911
        table->write_set != save_write_set)
911
912
      table->column_bitmaps_set(save_read_set, save_write_set);
912
913
  }
913
 
  else if ((error=table->cursor->ha_write_row(table->record[0])))
 
914
  else if ((error=table->cursor->insertRecord(table->record[0])))
914
915
  {
915
916
    if (!info->ignore ||
916
917
        table->cursor->is_fatal_error(error, HA_CHECK_DUP))
1325
1326
  {
1326
1327
    /*
1327
1328
      We must invalidate the table in the query cache before binlog writing
1328
 
      and ha_autocommit_or_rollback.
 
1329
      and autocommitOrRollback.
1329
1330
    */
1330
1331
    if (session->transaction.stmt.hasModifiedNonTransData())
1331
1332
      session->transaction.all.markModifiedNonTransData();
1711
1712
    if (!table->s->tmp_table)
1712
1713
    {
1713
1714
      TransactionServices &transaction_services= TransactionServices::singleton();
1714
 
      transaction_services.ha_autocommit_or_rollback(session, 0);
 
1715
      transaction_services.autocommitOrRollback(session, 0);
1715
1716
      (void) session->endActiveTransaction();
1716
1717
    }
1717
1718