~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/trx/trx0undo.cc

  • Committer: Brian Aker
  • Date: 2011-02-22 06:12:02 UTC
  • mfrom: (2190.1.6 drizzle-build)
  • Revision ID: brian@tangent.org-20110222061202-k03czxykqy4x9hjs
List update, header fixes, multiple symbols, and David deletes some code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (C) 1996, 2009, Innobase Oy. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
415
415
ulint
416
416
trx_undo_seg_create(
417
417
/*================*/
418
 
        trx_rseg_t*     rseg __attribute__((unused)),/*!< in: rollback segment */
 
418
        trx_rseg_t*     /*rseg*/,/*!< in: rollback segment */
419
419
        trx_rsegf_t*    rseg_hdr,/*!< in: rollback segment header, page
420
420
                                x-latched */
421
421
        ulint           type,   /*!< in: type of the segment: TRX_UNDO_INSERT or
817
817
trx_undo_parse_discard_latest(
818
818
/*==========================*/
819
819
        byte*   ptr,    /*!< in: buffer */
820
 
        byte*   end_ptr __attribute__((unused)), /*!< in: buffer end */
 
820
        byte*   /*end_ptr*/, /*!< in: buffer end */
821
821
        page_t* page,   /*!< in: page or NULL */
822
822
        mtr_t*  mtr)    /*!< in: mtr or NULL */
823
823
{
1009
1009
void
1010
1010
trx_undo_free_page_in_rollback(
1011
1011
/*===========================*/
1012
 
        trx_t*          trx __attribute__((unused)), /*!< in: transaction */
 
1012
        trx_t*          /*trx*/, /*!< in: transaction */
1013
1013
        trx_undo_t*     undo,   /*!< in: undo log memory copy */
1014
1014
        ulint           page_no,/*!< in: page number to free: must not be the
1015
1015
                                header page */
1457
1457
                ut_error;
1458
1458
        }
1459
1459
 
1460
 
        undo = mem_alloc(sizeof(trx_undo_t));
 
1460
        undo = static_cast<trx_undo_t *>(mem_alloc(sizeof(trx_undo_t)));
1461
1461
 
1462
1462
        if (undo == NULL) {
1463
1463
 
1798
1798
page_t*
1799
1799
trx_undo_set_state_at_finish(
1800
1800
/*=========================*/
1801
 
        trx_rseg_t*     rseg,   /*!< in: rollback segment memory object */
1802
 
        trx_t*          trx __attribute__((unused)), /*!< in: transaction */
1803
1801
        trx_undo_t*     undo,   /*!< in: undo log memory copy */
1804
1802
        mtr_t*          mtr)    /*!< in: mtr */
1805
1803
{
1808
1806
        page_t*         undo_page;
1809
1807
        ulint           state;
1810
1808
 
1811
 
        ut_ad(trx);
1812
1809
        ut_ad(undo);
1813
1810
        ut_ad(mtr);
1814
 
        ut_ad(mutex_own(&rseg->mutex));
1815
1811
 
1816
1812
        if (undo->id >= TRX_RSEG_N_SLOTS) {
1817
1813
                fprintf(stderr, "InnoDB: Error: undo->id is %lu\n",
1830
1826
            && mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE)
1831
1827
               < TRX_UNDO_PAGE_REUSE_LIMIT) {
1832
1828
 
1833
 
                /* This is a heuristic to avoid the problem of all UNDO
1834
 
                slots ending up in one of the UNDO lists. Previously if
1835
 
                the server crashed with all the slots in one of the lists,
1836
 
                transactions that required the slots of a different type
1837
 
                would fail for lack of slots. */
1838
 
 
1839
 
                if (UT_LIST_GET_LEN(rseg->update_undo_list) < 500
1840
 
                    && UT_LIST_GET_LEN(rseg->insert_undo_list) < 500) {
1841
 
 
1842
 
                        state = TRX_UNDO_CACHED;
1843
 
                } else {
1844
 
                        state = TRX_UNDO_TO_FREE;
1845
 
                }
 
1829
                state = TRX_UNDO_CACHED;
1846
1830
 
1847
1831
        } else if (undo->type == TRX_UNDO_INSERT) {
1848
1832