~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/log/log0recv.cc

  • Committer: Olaf van der Spek
  • Date: 2011-08-11 09:18:19 UTC
  • mfrom: (2395 drizzle)
  • mto: This revision was merged to the branch mainline in revision 2396.
  • Revision ID: olafvdspek@gmail.com-20110811091819-em9vnmtco1zt6uvm
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
UNIV_INTERN ibool       recv_replay_file_ops    = TRUE;
59
59
#endif /* !UNIV_HOTBACKUP */
60
60
 
 
61
#include <boost/scoped_array.hpp>
 
62
 
61
63
#include <drizzled/errmsg_print.h>
62
64
 
63
65
/** Log records are stored in the hash table in chunks at most of this size;
702
704
 
703
705
                        group->lsn = mach_read_from_8(
704
706
                                buf + LOG_CHECKPOINT_LSN);
705
 
                        group->lsn_offset = mach_read_from_4(
706
 
                                buf + LOG_CHECKPOINT_OFFSET);
 
707
 
 
708
#ifdef UNIV_LOG_ARCHIVE
 
709
#error "UNIV_LOG_ARCHIVE could not be enabled"
 
710
#endif
 
711
                        {
 
712
                                ib_uint64_t tmp_lsn_offset = mach_read_from_8(
 
713
                                        buf + LOG_CHECKPOINT_ARCHIVED_LSN);
 
714
                                if (sizeof(ulint) != 4
 
715
                                    && tmp_lsn_offset != IB_ULONGLONG_MAX) {
 
716
                                        group->lsn_offset = (ulint) tmp_lsn_offset;
 
717
                        } else {
 
718
                                        group->lsn_offset = mach_read_from_4(
 
719
                                                buf + LOG_CHECKPOINT_OFFSET);
 
720
                                }
 
721
                        }
 
722
 
707
723
                        checkpoint_no = mach_read_from_8(
708
724
                                buf + LOG_CHECKPOINT_NO);
709
725
 
2885
2901
        log_group_t*    max_cp_group;
2886
2902
        log_group_t*    up_to_date_group;
2887
2903
        ulint           max_cp_field;
 
2904
        ulint           log_hdr_log_block_size;
2888
2905
        ib_uint64_t     checkpoint_lsn;
2889
2906
        ib_uint64_t     checkpoint_no;
2890
2907
        ib_uint64_t     old_scanned_lsn;
2894
2911
        ib_uint64_t     archived_lsn;
2895
2912
#endif /* UNIV_LOG_ARCHIVE */
2896
2913
        byte*           buf;
2897
 
        byte            log_hdr_buf[LOG_FILE_HDR_SIZE];
 
2914
        boost::scoped_array<byte>       log_hdr_buf_base(
 
2915
                new byte[LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE]);
 
2916
        byte*           log_hdr_buf
 
2917
                = (byte *)ut_align(log_hdr_buf_base.get(), OS_FILE_LOG_BLOCK_SIZE);
2898
2918
        ulint           err;
2899
2919
 
2900
2920
#ifdef UNIV_LOG_ARCHIVE
2919
2939
          drizzled::errmsg_printf(drizzled::error::INFO,
2920
2940
                                  "InnoDB: The user has set SRV_FORCE_NO_LOG_REDO on Skipping log redo.");
2921
2941
 
2922
 
                return(DB_SUCCESS);
 
2942
          return(DB_SUCCESS);
2923
2943
        }
2924
2944
 
2925
2945
        recv_recovery_on = TRUE;
2978
2998
                 log_hdr_buf, max_cp_group);
2979
2999
        }
2980
3000
 
 
3001
        log_hdr_log_block_size
 
3002
                = mach_read_from_4(log_hdr_buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE);
 
3003
        if (log_hdr_log_block_size == 0) {
 
3004
                /* 0 means default value */
 
3005
                log_hdr_log_block_size = 512;
 
3006
        }
 
3007
        if (log_hdr_log_block_size != srv_log_block_size) {
 
3008
                drizzled::errmsg_printf(drizzled::error::ERROR,
 
3009
                           "InnoDB: Error: The block size of ib_logfile (%lu) "
 
3010
                           "is not equal to innodb_log_block_size.\n"
 
3011
                           "InnoDB: Error: Suggestion - Recreate log files.\n",
 
3012
                           log_hdr_log_block_size);
 
3013
                return(DB_ERROR);
 
3014
        }
 
3015
 
2981
3016
#ifdef UNIV_LOG_ARCHIVE
2982
3017
        group = UT_LIST_GET_FIRST(log_sys->log_groups);
2983
3018