~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/page/page0page.c

  • Committer: Andrew Hutchings
  • Date: 2010-11-09 13:38:01 UTC
  • mto: (1919.1.2 trunk)
  • mto: This revision was merged to the branch mainline in revision 1920.
  • Revision ID: andrew@linuxjedi.co.uk-20101109133801-byjzsao76346395x
Add FLUSH GLOBAL STATUS; command
Clears the global status variables for the server

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1994, 2010, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1994, 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
233
233
                                      8, mtr);
234
234
#ifndef UNIV_HOTBACKUP
235
235
        } else if (mtr) {
236
 
                mlog_write_ull(page + (PAGE_HEADER + PAGE_MAX_TRX_ID),
237
 
                               trx_id, mtr);
 
236
                mlog_write_dulint(page + (PAGE_HEADER + PAGE_MAX_TRX_ID),
 
237
                                  trx_id, mtr);
238
238
#endif /* !UNIV_HOTBACKUP */
239
239
        } else {
240
240
                mach_write_to_8(page + (PAGE_HEADER + PAGE_MAX_TRX_ID), trx_id);
455
455
        page_header_set_field(page, NULL, PAGE_DIRECTION, PAGE_NO_DIRECTION);
456
456
        page_header_set_field(page, NULL, PAGE_N_DIRECTION, 0);
457
457
        page_header_set_field(page, NULL, PAGE_N_RECS, 0);
458
 
        page_set_max_trx_id(block, NULL, 0, NULL);
 
458
        page_set_max_trx_id(block, NULL, ut_dulint_zero, NULL);
459
459
        memset(heap_top, 0, UNIV_PAGE_SIZE - PAGE_EMPTY_DIR_START
460
460
               - page_offset(heap_top));
461
461
 
656
656
                                                index, mtr);
657
657
        }
658
658
 
659
 
        /* Update PAGE_MAX_TRX_ID on the uncompressed page.
660
 
        Modifications will be redo logged and copied to the compressed
661
 
        page in page_zip_compress() or page_zip_reorganize() below. */
662
 
        if (dict_index_is_sec_or_ibuf(index) && page_is_leaf(page)) {
663
 
                page_update_max_trx_id(new_block, NULL,
664
 
                                       page_get_max_trx_id(page), mtr);
665
 
        }
666
 
 
667
659
        if (UNIV_LIKELY_NULL(new_page_zip)) {
668
660
                mtr_set_log_mode(mtr, log_mode);
669
661
 
702
694
                }
703
695
        }
704
696
 
705
 
        /* Update the lock table and possible hash index */
 
697
        /* Update the lock table, MAX_TRX_ID, and possible hash index */
706
698
 
707
699
        lock_move_rec_list_end(new_block, block, rec);
708
700
 
 
701
        if (dict_index_is_sec_or_ibuf(index) && page_is_leaf(page)) {
 
702
                page_update_max_trx_id(new_block, new_page_zip,
 
703
                                       page_get_max_trx_id(page), mtr);
 
704
        }
 
705
 
709
706
        btr_search_move_or_delete_hash_entries(new_block, block, index);
710
707
 
711
708
        return(ret);
773
770
                mem_heap_free(heap);
774
771
        }
775
772
 
776
 
        /* Update PAGE_MAX_TRX_ID on the uncompressed page.
777
 
        Modifications will be redo logged and copied to the compressed
778
 
        page in page_zip_compress() or page_zip_reorganize() below. */
779
 
        if (dict_index_is_sec_or_ibuf(index)
780
 
            && page_is_leaf(page_align(rec))) {
781
 
                page_update_max_trx_id(new_block, NULL,
782
 
                                       page_get_max_trx_id(page_align(rec)),
783
 
                                       mtr);
784
 
        }
785
 
 
786
773
        if (UNIV_LIKELY_NULL(new_page_zip)) {
787
774
                mtr_set_log_mode(mtr, log_mode);
788
775
 
820
807
                }
821
808
        }
822
809
 
823
 
        /* Update the lock table and possible hash index */
 
810
        /* Update MAX_TRX_ID, the lock table, and possible hash index */
 
811
 
 
812
        if (dict_index_is_sec_or_ibuf(index)
 
813
            && page_is_leaf(page_align(rec))) {
 
814
                page_update_max_trx_id(new_block, new_page_zip,
 
815
                                       page_get_max_trx_id(page_align(rec)),
 
816
                                       mtr);
 
817
        }
824
818
 
825
819
        lock_move_rec_list_start(new_block, block, rec, ret);
826
820
 
2412
2406
                }
2413
2407
 
2414
2408
                offs = page_offset(rec_get_start(rec, offsets));
2415
 
                i = rec_offs_size(offsets);
2416
 
                if (UNIV_UNLIKELY(offs + i >= UNIV_PAGE_SIZE)) {
2417
 
                        fputs("InnoDB: record offset out of bounds\n", stderr);
2418
 
                        goto func_exit;
2419
 
                }
2420
2409
 
2421
 
                while (i--) {
 
2410
                for (i = rec_offs_size(offsets); i--; ) {
2422
2411
                        if (UNIV_UNLIKELY(buf[offs + i])) {
2423
2412
                                /* No other record may overlap this */
2424
2413
 
2526
2515
 
2527
2516
                count++;
2528
2517
                offs = page_offset(rec_get_start(rec, offsets));
2529
 
                i = rec_offs_size(offsets);
2530
 
                if (UNIV_UNLIKELY(offs + i >= UNIV_PAGE_SIZE)) {
2531
 
                        fputs("InnoDB: record offset out of bounds\n", stderr);
2532
 
                        goto func_exit;
2533
 
                }
2534
2518
 
2535
 
                while (i--) {
 
2519
                for (i = rec_offs_size(offsets); i--; ) {
2536
2520
 
2537
2521
                        if (UNIV_UNLIKELY(buf[offs + i])) {
2538
2522
                                fputs("InnoDB: Record overlaps another"