~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/alter_table.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-23 10:47:03 UTC
  • mto: This revision was merged to the branch mainline in revision 2348.
  • Revision ID: olafvdspek@gmail.com-20110623104703-hw93svu0vfgcqt9p
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
732
732
    Note that DISCARD/IMPORT TABLESPACE always is the only operation in an
733
733
    ALTER Table
734
734
  */
735
 
  TransactionServices &transaction_services= TransactionServices::singleton();
736
735
  session->set_proc_info("discard_or_import_tablespace");
737
736
 
738
737
 /*
757
756
      break;
758
757
 
759
758
    /* The ALTER Table is always in its own transaction */
760
 
    error= transaction_services.autocommitOrRollback(*session, false);
 
759
    error= TransactionServices::autocommitOrRollback(*session, false);
761
760
    if (not session->endActiveTransaction())
762
761
      error= 1;
763
762
 
764
763
    if (error)
765
764
      break;
766
765
 
767
 
    transaction_services.rawStatement(*session,
 
766
    TransactionServices::rawStatement(*session,
768
767
                                      *session->getQueryString(),
769
768
                                      *session->schema());
770
769
 
771
770
  } while(0);
772
771
 
773
 
  (void) transaction_services.autocommitOrRollback(*session, error);
 
772
  (void) TransactionServices::autocommitOrRollback(*session, error);
774
773
  session->setDoingTablespaceOperation(false);
775
774
 
776
775
  if (error == 0)
1040
1039
 
1041
1040
      if (not error)
1042
1041
      {
1043
 
        TransactionServices &transaction_services= TransactionServices::singleton();
1044
 
        transaction_services.allocateNewTransactionId();
1045
 
        transaction_services.rawStatement(*session,
 
1042
        TransactionServices::allocateNewTransactionId();
 
1043
        TransactionServices::rawStatement(*session,
1046
1044
                                          *session->getQueryString(),
1047
1045
                                          *session->schema());
1048
1046
        session->my_ok();
1315
1313
 
1316
1314
    session->set_proc_info("end");
1317
1315
 
1318
 
    TransactionServices &transaction_services= TransactionServices::singleton();
1319
 
    transaction_services.rawStatement(*session,
 
1316
    TransactionServices::rawStatement(*session,
1320
1317
                                      *session->getQueryString(),
1321
1318
                                      *session->schema());
1322
1319
    table_list->table= NULL;
1539
1536
 
1540
1537
    This needs to be done before external_lock
1541
1538
  */
1542
 
  TransactionServices &transaction_services= TransactionServices::singleton();
1543
1539
 
1544
1540
  /*
1545
1541
   * LP Bug #552420
1550
1546
   */
1551
1547
  to->getMutableShare()->getEngine()->startStatement(session);
1552
1548
 
1553
 
  if (!(copy= new CopyField[to->getShare()->sizeFields()]))
1554
 
    return -1;
 
1549
  copy= new CopyField[to->getShare()->sizeFields()];
1555
1550
 
1556
1551
  if (to->cursor->ha_external_lock(session, F_WRLCK))
1557
1552
    return -1;
1712
1707
      Ensure that the new table is saved properly to disk so that we
1713
1708
      can do a rename
1714
1709
    */
1715
 
    if (transaction_services.autocommitOrRollback(*session, false))
 
1710
    if (TransactionServices::autocommitOrRollback(*session, false))
1716
1711
      error= 1;
1717
1712
 
1718
1713
    if (not session->endActiveTransaction())