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. */
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;
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
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;
612
612
sys_header = trx_sysf_get(mtr);
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) {
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);
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),
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),
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) {
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);
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);
662
662
sys_header = page + TRX_SYS;
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) {
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);
681
681
#endif /* UNIV_HOTBACKUP */
698
698
sys_header = trx_sysf_get(&mtr);
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) {
704
704
mtr_commit(&mtr);
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);
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;
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);
725
725
"InnoDB: Last MySQL binlog file position %lu %lu,"
746
746
sys_header = trx_sysf_get(&mtr);
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) {
752
752
mtr_commit(&mtr);
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 */
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);
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);