~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_update.cc

  • Committer: Lee Bieber
  • Date: 2010-10-27 02:00:05 UTC
  • mfrom: (1882.1.2 build)
  • Revision ID: kalebral@gmail.com-20101027020005-jqiq89je9lhpidux
Merge Shrews - add options to the transaction_reader utility program
Merge Shrews - fix bug 660779: Transaction log retaining partial information from an aborted transaction

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "drizzled/records.h"
30
30
#include "drizzled/internal/my_sys.h"
31
31
#include "drizzled/internal/iocache.h"
 
32
#include "drizzled/transaction_services.h"
32
33
 
33
34
#include <boost/dynamic_bitset.hpp>
34
35
#include <list>
473
474
 
474
475
      table->storeRecord();
475
476
      if (fill_record(session, fields, values))
 
477
      {
 
478
        /*
 
479
         * If we updated some rows before this one failed (updated > 0),
 
480
         * then we will need to undo adding those records to the
 
481
         * replication Statement message.
 
482
         */
 
483
        if (updated > 0)
 
484
        {
 
485
          TransactionServices &ts= TransactionServices::singleton();
 
486
          ts.removeStatementRecords(session, updated);
 
487
        }
 
488
 
476
489
        break;
 
490
      }
477
491
 
478
492
      found++;
479
493
 
486
500
        table->auto_increment_field_not_null= false;
487
501
 
488
502
        if (!error || error == HA_ERR_RECORD_IS_THE_SAME)
489
 
        {
 
503
        {
490
504
          if (error != HA_ERR_RECORD_IS_THE_SAME)
491
505
            updated++;
492
506
          else
493
507
            error= 0;
494
 
        }
495
 
        else if (! ignore ||
 
508
        }
 
509
        else if (! ignore ||
496
510
                 table->cursor->is_fatal_error(error, HA_CHECK_DUP_KEY))
497
 
        {
 
511
        {
498
512
          /*
499
513
            If (ignore && error is ignorable) we don't have to
500
514
            do anything; otherwise...
505
519
            flags|= ME_FATALERROR; /* Other handler errors are fatal */
506
520
 
507
521
          prepare_record_for_error_message(error, table);
508
 
          table->print_error(error,MYF(flags));
509
 
          error= 1;
510
 
          break;
511
 
        }
 
522
          table->print_error(error,MYF(flags));
 
523
          error= 1;
 
524
          break;
 
525
        }
512
526
      }
513
527
 
514
528
      if (!--limit && using_limit)