~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2010-12-19 06:20:54 UTC
  • mfrom: (2005.1.1 bug673105)
  • Revision ID: brian@tangent.org-20101219062054-1kt0l3dxs4z2z8md
Merge Dave.

Show diffs side-by-side

added added

removed removed

Lines of Context:
415
415
ulint
416
416
trx_undo_seg_create(
417
417
/*================*/
418
 
        trx_rseg_t*     /*rseg*/,/*!< in: rollback segment */
 
418
        trx_rseg_t*     rseg __attribute__((unused)),/*!< 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*/, /*!< in: buffer end */
 
820
        byte*   end_ptr __attribute__((unused)), /*!< 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*/, /*!< in: transaction */
 
1012
        trx_t*          trx __attribute__((unused)), /*!< 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 = static_cast<trx_undo_t *>(mem_alloc(sizeof(trx_undo_t)));
 
1460
        undo = 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 */
1801
1803
        trx_undo_t*     undo,   /*!< in: undo log memory copy */
1802
1804
        mtr_t*          mtr)    /*!< in: mtr */
1803
1805
{
1806
1808
        page_t*         undo_page;
1807
1809
        ulint           state;
1808
1810
 
 
1811
        ut_ad(trx);
1809
1812
        ut_ad(undo);
1810
1813
        ut_ad(mtr);
 
1814
        ut_ad(mutex_own(&rseg->mutex));
1811
1815
 
1812
1816
        if (undo->id >= TRX_RSEG_N_SLOTS) {
1813
1817
                fprintf(stderr, "InnoDB: Error: undo->id is %lu\n",
1826
1830
            && mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE)
1827
1831
               < TRX_UNDO_PAGE_REUSE_LIMIT) {
1828
1832
 
1829
 
                state = TRX_UNDO_CACHED;
 
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
                }
1830
1846
 
1831
1847
        } else if (undo->type == TRX_UNDO_INSERT) {
1832
1848