~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.cc

  • Committer: Mark Atwood
  • Date: 2011-06-24 11:45:17 UTC
  • mfrom: (2318.6.64 rf)
  • Revision ID: me@mark.atwood.name-20110624114517-1mq8no6jlp2nrg7m
mergeĀ lp:~olafvdspek/drizzle/refactor15

Show diffs side-by-side

added added

removed removed

Lines of Context:
406
406
  }
407
407
#endif
408
408
  {
409
 
    TransactionServices &transaction_services= TransactionServices::singleton();
410
 
    transaction_services.rollbackTransaction(*this, true);
 
409
    TransactionServices::rollbackTransaction(*this, true);
411
410
  }
412
411
 
413
412
  BOOST_FOREACH(UserVars::reference iter, user_vars)
745
744
{
746
745
  bool do_release= 0;
747
746
  bool result= true;
748
 
  TransactionServices &transaction_services= TransactionServices::singleton();
749
747
 
750
748
  if (transaction.xid_state.xa_state != XA_NOTR)
751
749
  {
761
759
       * (Which of course should never happen...)
762
760
       */
763
761
      server_status&= ~SERVER_STATUS_IN_TRANS;
764
 
      if (transaction_services.commitTransaction(*this, true))
 
762
      if (TransactionServices::commitTransaction(*this, true))
765
763
        result= false;
766
764
      options&= ~(OPTION_BEGIN);
767
765
      break;
778
776
    case ROLLBACK_AND_CHAIN:
779
777
    {
780
778
      server_status&= ~SERVER_STATUS_IN_TRANS;
781
 
      if (transaction_services.rollbackTransaction(*this, true))
 
779
      if (TransactionServices::rollbackTransaction(*this, true))
782
780
        result= false;
783
781
      options&= ~(OPTION_BEGIN);
784
782
      if (result == true && (completion == ROLLBACK_AND_CHAIN))
805
803
bool Session::endActiveTransaction()
806
804
{
807
805
  bool result= true;
808
 
  TransactionServices &transaction_services= TransactionServices::singleton();
809
806
 
810
807
  if (transaction.xid_state.xa_state != XA_NOTR)
811
808
  {
815
812
  if (options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
816
813
  {
817
814
    server_status&= ~SERVER_STATUS_IN_TRANS;
818
 
    if (transaction_services.commitTransaction(*this, true))
 
815
    if (TransactionServices::commitTransaction(*this, true))
819
816
      result= false;
820
817
  }
821
818
  options&= ~(OPTION_BEGIN);
883
880
                                     bool allocate_lex_string)
884
881
{
885
882
  if (allocate_lex_string)
886
 
    lex_str= (LEX_STRING *)mem.alloc(sizeof(LEX_STRING));
 
883
    lex_str= new (mem) LEX_STRING;
887
884
  lex_str->str= mem_root->strmake(str, length);
888
885
  lex_str->length= length;
889
886
  return lex_str;
1352
1349
  if (unit->offset_limit_cnt)
1353
1350
  {                                             // using limit offset,count
1354
1351
    unit->offset_limit_cnt--;
1355
 
    return(0);
 
1352
    return 0;
1356
1353
  }
1357
1354
  if (row_count++ > 1)
1358
1355
  {
1373
1370
      return 1;
1374
1371
    }
1375
1372
  }
1376
 
  return(0);
 
1373
  return 0;
1377
1374
}
1378
1375
 
1379
1376
 
1394
1391
  if (unit->offset_limit_cnt)
1395
1392
  {                                       // Using limit offset,count
1396
1393
    unit->offset_limit_cnt--;
1397
 
    return(0);
 
1394
    return 0;
1398
1395
  }
1399
1396
  List<Item>::iterator li(items.begin());
1400
1397
  Item *val_item;
1401
1398
  for (uint32_t i= 0; (val_item= li++); i++)
1402
1399
    it->store(i, val_item);
1403
1400
  it->assigned(1);
1404
 
  return(0);
 
1401
  return 0;
1405
1402
}
1406
1403
 
1407
1404
 
1452
1449
    it->store(0, cache);
1453
1450
  }
1454
1451
  it->assigned(1);
1455
 
  return(0);
 
1452
  return 0;
1456
1453
}
1457
1454
 
1458
1455
bool select_max_min_finder_subselect::cmp_real()
1520
1517
  if (unit->offset_limit_cnt)
1521
1518
  { // Using limit offset,count
1522
1519
    unit->offset_limit_cnt--;
1523
 
    return(0);
 
1520
    return 0;
1524
1521
  }
1525
1522
  it->value= 1;
1526
1523
  it->assigned(1);
1527
 
  return(0);
 
1524
  return 0;
1528
1525
}
1529
1526
 
1530
1527
/*
1814
1811
    TODO: This should be fixed in later releases.
1815
1812
   */
1816
1813
  {
1817
 
    TransactionServices &transaction_services= TransactionServices::singleton();
1818
1814
    main_da().can_overwrite_status= true;
1819
 
    transaction_services.autocommitOrRollback(*this, is_error());
 
1815
    TransactionServices::autocommitOrRollback(*this, is_error());
1820
1816
    main_da().can_overwrite_status= false;
1821
1817
    transaction.stmt.reset();
1822
1818
  }