~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/trx/trx0sys.c

  • Committer: Grant Limberg
  • Date: 2008-08-12 21:13:01 UTC
  • mto: (322.1.1 codestyle)
  • mto: This revision was merged to the branch mainline in revision 324.
  • Revision ID: grant@glsoftware.net-20080812211301-ym3wsowelkgp16s2
renamed all instances of MYSQL_ to DRIZZLE_

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
up to this position. If .._pos is -1, it means no crash recovery was needed,
43
43
or there was no master log position info inside InnoDB. */
44
44
 
45
 
char            trx_sys_mysql_master_log_name[TRX_SYS_MYSQL_LOG_NAME_LEN];
 
45
char            trx_sys_mysql_master_log_name[TRX_SYS_DRIZZLE_LOG_NAME_LEN];
46
46
ib_longlong     trx_sys_mysql_master_log_pos    = -1;
47
47
 
48
48
/* If this MySQL server uses binary logging, after InnoDB has been inited
50
50
here. If .._pos is -1, it means there was no binlog position info inside
51
51
InnoDB. */
52
52
 
53
 
char            trx_sys_mysql_bin_log_name[TRX_SYS_MYSQL_LOG_NAME_LEN];
 
53
char            trx_sys_mysql_bin_log_name[TRX_SYS_DRIZZLE_LOG_NAME_LEN];
54
54
ib_longlong     trx_sys_mysql_bin_log_pos       = -1;
55
55
 
56
56
 
602
602
{
603
603
        trx_sysf_t*     sys_header;
604
604
 
605
 
        if (ut_strlen(file_name) >= TRX_SYS_MYSQL_LOG_NAME_LEN) {
 
605
        if (ut_strlen(file_name) >= TRX_SYS_DRIZZLE_LOG_NAME_LEN) {
606
606
 
607
607
                /* We cannot fit the name to the 512 bytes we have reserved */
608
608
 
612
612
        sys_header = trx_sysf_get(mtr);
613
613
 
614
614
        if (mach_read_from_4(sys_header + field
615
 
                             + TRX_SYS_MYSQL_LOG_MAGIC_N_FLD)
616
 
            != TRX_SYS_MYSQL_LOG_MAGIC_N) {
 
615
                             + TRX_SYS_DRIZZLE_LOG_MAGIC_N_FLD)
 
616
            != TRX_SYS_DRIZZLE_LOG_MAGIC_N) {
617
617
 
618
618
                mlog_write_ulint(sys_header + field
619
 
                                 + TRX_SYS_MYSQL_LOG_MAGIC_N_FLD,
620
 
                                 TRX_SYS_MYSQL_LOG_MAGIC_N,
 
619
                                 + TRX_SYS_DRIZZLE_LOG_MAGIC_N_FLD,
 
620
                                 TRX_SYS_DRIZZLE_LOG_MAGIC_N,
621
621
                                 MLOG_4BYTES, mtr);
622
622
        }
623
623
 
624
 
        if (0 != strcmp((char*) (sys_header + field + TRX_SYS_MYSQL_LOG_NAME),
 
624
        if (0 != strcmp((char*) (sys_header + field + TRX_SYS_DRIZZLE_LOG_NAME),
625
625
                        file_name)) {
626
626
 
627
627
                mlog_write_string(sys_header + field
628
 
                                  + TRX_SYS_MYSQL_LOG_NAME,
 
628
                                  + TRX_SYS_DRIZZLE_LOG_NAME,
629
629
                                  (byte*) file_name, 1 + ut_strlen(file_name),
630
630
                                  mtr);
631
631
        }
632
632
 
633
633
        if (mach_read_from_4(sys_header + field
634
 
                             + TRX_SYS_MYSQL_LOG_OFFSET_HIGH) > 0
 
634
                             + TRX_SYS_DRIZZLE_LOG_OFFSET_HIGH) > 0
635
635
            || (offset >> 32) > 0) {
636
636
 
637
637
                mlog_write_ulint(sys_header + field
638
 
                                 + TRX_SYS_MYSQL_LOG_OFFSET_HIGH,
 
638
                                 + TRX_SYS_DRIZZLE_LOG_OFFSET_HIGH,
639
639
                                 (ulint)(offset >> 32),
640
640
                                 MLOG_4BYTES, mtr);
641
641
        }
642
642
 
643
643
        mlog_write_ulint(sys_header + field
644
 
                         + TRX_SYS_MYSQL_LOG_OFFSET_LOW,
 
644
                         + TRX_SYS_DRIZZLE_LOG_OFFSET_LOW,
645
645
                         (ulint)(offset & 0xFFFFFFFFUL),
646
646
                         MLOG_4BYTES, mtr);
647
647
}
661
661
 
662
662
        sys_header = page + TRX_SYS;
663
663
 
664
 
        if (mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO
665
 
                             + TRX_SYS_MYSQL_LOG_MAGIC_N_FLD)
666
 
            == TRX_SYS_MYSQL_LOG_MAGIC_N) {
 
664
        if (mach_read_from_4(sys_header + TRX_SYS_DRIZZLE_LOG_INFO
 
665
                             + TRX_SYS_DRIZZLE_LOG_MAGIC_N_FLD)
 
666
            == TRX_SYS_DRIZZLE_LOG_MAGIC_N) {
667
667
 
668
668
                fprintf(stderr,
669
669
                        "ibbackup: Last MySQL binlog file position %lu %lu,"
670
670
                        " file name %s\n",
671
671
                        (ulong) mach_read_from_4(
672
 
                                sys_header + TRX_SYS_MYSQL_LOG_INFO
673
 
                                + TRX_SYS_MYSQL_LOG_OFFSET_HIGH),
 
672
                                sys_header + TRX_SYS_DRIZZLE_LOG_INFO
 
673
                                + TRX_SYS_DRIZZLE_LOG_OFFSET_HIGH),
674
674
                        (ulong) mach_read_from_4(
675
 
                                sys_header + TRX_SYS_MYSQL_LOG_INFO
676
 
                                + TRX_SYS_MYSQL_LOG_OFFSET_LOW),
677
 
                        sys_header + TRX_SYS_MYSQL_LOG_INFO
678
 
                        + TRX_SYS_MYSQL_LOG_NAME);
 
675
                                sys_header + TRX_SYS_DRIZZLE_LOG_INFO
 
676
                                + TRX_SYS_DRIZZLE_LOG_OFFSET_LOW),
 
677
                        sys_header + TRX_SYS_DRIZZLE_LOG_INFO
 
678
                        + TRX_SYS_DRIZZLE_LOG_NAME);
679
679
        }
680
680
}
681
681
#endif /* UNIV_HOTBACKUP */
697
697
 
698
698
        sys_header = trx_sysf_get(&mtr);
699
699
 
700
 
        if (mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO
701
 
                             + TRX_SYS_MYSQL_LOG_MAGIC_N_FLD)
702
 
            != TRX_SYS_MYSQL_LOG_MAGIC_N) {
 
700
        if (mach_read_from_4(sys_header + TRX_SYS_DRIZZLE_LOG_INFO
 
701
                             + TRX_SYS_DRIZZLE_LOG_MAGIC_N_FLD)
 
702
            != TRX_SYS_DRIZZLE_LOG_MAGIC_N) {
703
703
 
704
704
                mtr_commit(&mtr);
705
705
 
707
707
        }
708
708
 
709
709
        trx_sys_mysql_bin_log_pos_high = mach_read_from_4(
710
 
                sys_header + TRX_SYS_MYSQL_LOG_INFO
711
 
                + TRX_SYS_MYSQL_LOG_OFFSET_HIGH);
 
710
                sys_header + TRX_SYS_DRIZZLE_LOG_INFO
 
711
                + TRX_SYS_DRIZZLE_LOG_OFFSET_HIGH);
712
712
        trx_sys_mysql_bin_log_pos_low = mach_read_from_4(
713
 
                sys_header + TRX_SYS_MYSQL_LOG_INFO
714
 
                + TRX_SYS_MYSQL_LOG_OFFSET_LOW);
 
713
                sys_header + TRX_SYS_DRIZZLE_LOG_INFO
 
714
                + TRX_SYS_DRIZZLE_LOG_OFFSET_LOW);
715
715
 
716
716
        trx_sys_mysql_bin_log_pos
717
717
                = (((ib_longlong)trx_sys_mysql_bin_log_pos_high) << 32)
718
718
                + (ib_longlong)trx_sys_mysql_bin_log_pos_low;
719
719
 
720
720
        ut_memcpy(trx_sys_mysql_bin_log_name,
721
 
                  sys_header + TRX_SYS_MYSQL_LOG_INFO
722
 
                  + TRX_SYS_MYSQL_LOG_NAME, TRX_SYS_MYSQL_LOG_NAME_LEN);
 
721
                  sys_header + TRX_SYS_DRIZZLE_LOG_INFO
 
722
                  + TRX_SYS_DRIZZLE_LOG_NAME, TRX_SYS_DRIZZLE_LOG_NAME_LEN);
723
723
 
724
724
        fprintf(stderr,
725
725
                "InnoDB: Last MySQL binlog file position %lu %lu,"
745
745
 
746
746
        sys_header = trx_sysf_get(&mtr);
747
747
 
748
 
        if (mach_read_from_4(sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO
749
 
                             + TRX_SYS_MYSQL_LOG_MAGIC_N_FLD)
750
 
            != TRX_SYS_MYSQL_LOG_MAGIC_N) {
 
748
        if (mach_read_from_4(sys_header + TRX_SYS_DRIZZLE_MASTER_LOG_INFO
 
749
                             + TRX_SYS_DRIZZLE_LOG_MAGIC_N_FLD)
 
750
            != TRX_SYS_DRIZZLE_LOG_MAGIC_N) {
751
751
 
752
752
                mtr_commit(&mtr);
753
753
 
759
759
                " master binlog file\n"
760
760
                "InnoDB: position %lu %lu, file name %s\n",
761
761
                (ulong) mach_read_from_4(sys_header
762
 
                                         + TRX_SYS_MYSQL_MASTER_LOG_INFO
763
 
                                         + TRX_SYS_MYSQL_LOG_OFFSET_HIGH),
 
762
                                         + TRX_SYS_DRIZZLE_MASTER_LOG_INFO
 
763
                                         + TRX_SYS_DRIZZLE_LOG_OFFSET_HIGH),
764
764
                (ulong) mach_read_from_4(sys_header
765
 
                                         + TRX_SYS_MYSQL_MASTER_LOG_INFO
766
 
                                         + TRX_SYS_MYSQL_LOG_OFFSET_LOW),
767
 
                sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO
768
 
                + TRX_SYS_MYSQL_LOG_NAME);
 
765
                                         + TRX_SYS_DRIZZLE_MASTER_LOG_INFO
 
766
                                         + TRX_SYS_DRIZZLE_LOG_OFFSET_LOW),
 
767
                sys_header + TRX_SYS_DRIZZLE_MASTER_LOG_INFO
 
768
                + TRX_SYS_DRIZZLE_LOG_NAME);
769
769
        /* Copy the master log position info to global variables we can
770
770
        use in ha_innobase.cc to initialize glob_mi to right values */
771
771
 
772
772
        ut_memcpy(trx_sys_mysql_master_log_name,
773
 
                  sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO
774
 
                  + TRX_SYS_MYSQL_LOG_NAME,
775
 
                  TRX_SYS_MYSQL_LOG_NAME_LEN);
 
773
                  sys_header + TRX_SYS_DRIZZLE_MASTER_LOG_INFO
 
774
                  + TRX_SYS_DRIZZLE_LOG_NAME,
 
775
                  TRX_SYS_DRIZZLE_LOG_NAME_LEN);
776
776
 
777
777
        trx_sys_mysql_master_log_pos
778
778
                = (((ib_longlong) mach_read_from_4(
779
 
                            sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO
780
 
                            + TRX_SYS_MYSQL_LOG_OFFSET_HIGH)) << 32)
 
779
                            sys_header + TRX_SYS_DRIZZLE_MASTER_LOG_INFO
 
780
                            + TRX_SYS_DRIZZLE_LOG_OFFSET_HIGH)) << 32)
781
781
                + ((ib_longlong) mach_read_from_4(
782
 
                           sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO
783
 
                           + TRX_SYS_MYSQL_LOG_OFFSET_LOW));
 
782
                           sys_header + TRX_SYS_DRIZZLE_MASTER_LOG_INFO
 
783
                           + TRX_SYS_DRIZZLE_LOG_OFFSET_LOW));
784
784
        mtr_commit(&mtr);
785
785
}
786
786