Constraints parser can't recover deleted tables

Bug #673574 reported by Tamas Kozak
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Percona Data Recovery Tool for InnoDB
Fix Committed
High
Aleksandr Kuzminsky

Bug Description

Constraint parser misses some record and I have to zero out 2 bytes before infimum and re-run parser in order to get everything.

# ./constraints_parser -4 -f pages-1289403685/FIL_PAGE_INDEX/0-3
SYS_INDEXES 11 11 "ID_IND" 1 3 0 46
SYS_INDEXES 11 12 "FOR_IND" 1 0 0 47
SYS_INDEXES 11 13 "REF_IND" 1 0 0 48
SYS_INDEXES 12 14 "ID_IND" 2 3 0 49
SYS_INDEXES 11 11 "ID_IND" 1 3 0 46
SYS_INDEXES 11 12 "FOR_IND" 1 0 0 47
SYS_INDEXES 11 13 "REF_IND" 1 0 0 48
SYS_INDEXES 12 14 "ID_IND" 2 3 0 49
LOAD DATA INFILE '/home/ec2-user/percona-innodb-recovery-tool/dumps/default/SYS_INDEXES' REPLACE INTO TABLE `SYS_INDEXES` FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '"' LINES STARTING BY 'SYS_INDEXES\t' (TABLE_ID, ID, NAME, N_FIELDS, TYPE, SPACE, PAGE_NO)

# ./constraints_parser -4 -f pages-1289403685/FIL_PAGE_INDEX/0-3 -V
Opening file: pages-1289403685/FIL_PAGE_INDEX/0-3/15-00000011.page
Initializing table definitions...
Processing table: SYS_INDEXES
 - total fields: 9
 - nullable fields: 5
 - minimum header size: 5
 - minimum rec size: 29
 - maximum rec size: 165

Read data from fn=5...
Page id: 11
Checking a page
Infimum offset: 0x65
Supremum offset: 0x74
Next record at offset: 0x8C (140)
Next record at offset: 0xCE (206)
Next record at offset: 0x111 (273)
Next record at offset: 0x154 (340)
Next record at offset: 0x74 (116)
Page is good
Starting offset: 140 (8C). Checking 1 table definitions.

Checking offset: 0x8C: (SYS_INDEXES) ORIGIN=OK DELETED=0x0 OFFSETS=OK DATA_SIZE=OK
Checking field lengths for a row (SYS_INDEXES): OFFSETS: 15 8 16 22 29 35 39 43 47
 - field TABLE_ID(8):
 - field ID(8):
 - field DB_TRX_ID(6):
 - field DB_ROLL_PTR(7):
 - field NAME(6):OK!
 - field N_FIELDS(4):
 - field TYPE(4):
 - field SPACE(4):
 - field PAGE_NO(4):
FIELD_SIZES=OK
Checking constraints for a row (SYS_INDEXES) at 0x106c0cc: len 100; hex 000000000000000b000000000000000b000000000300800000002d017749445f494e440000000100000003000000000000002e34302c28241d161008000018130111000000000000000b000000000000000c000000000300800000002d01a5464f525f49; asc - wID_IND .40,($ - FOR_I;
 - field TABLE_ID(addr = 0x106c0cc, len = 8):UINT(8)=11
 - field ID(addr = 0x106c0d4, len = 8):UINT(8)=11
 - field DB_TRX_ID(addr = 0x106c0dc, len = 6):
 - field DB_ROLL_PTR(addr = 0x106c0e2, len = 7):
 - field NAME(addr = 0x106c0e9, len = 6): len 6; hex 49445f494e44; asc ID_IND;
 - field N_FIELDS(addr = 0x106c0ef, len = 4):
 - field TYPE(addr = 0x106c0f3, len = 4):
 - field SPACE(addr = 0x106c0f7, len = 4):
 - field PAGE_NO(addr = 0x106c0fb, len = 4):
Row looks OK!

---------------------------------------------------
PAGE11: Found a table SYS_INDEXES record: 0x106c0cc (offset = 140)
Processing record 0x106c0cc from table 'SYS_INDEXES'
PHYSICAL RECORD: n_fields 9; compact format; info bits 0
 0: len 8; hex 000000000000000b; asc ;; 1: len 8; hex 000000000000000b; asc ;; 2: len 6; hex 000000000300; asc ;; 3: len 7; hex 800000002d0177; asc - w;; 4: len 6; hex 49445f494e44; asc ID_IND;; 5: len 4; hex 00000001; asc ;; 6: len 4; hex 00000003; asc ;; 7: len 4; hex 00000000; asc ;; 8: len 4; hex 0000002e; asc .;;
Field #0 @ 0x106c0cc: length 8, value: 11
Field #1 @ 0x106c0d4: length 8, value: 11
Field #4 @ 0x106c0e9: length 6, value: "ID_IND"
Field #5 @ 0x106c0ef: length 4, value: 1
Field #6 @ 0x106c0f3: length 4, value: 3
Field #7 @ 0x106c0f7: length 4, value: 0
Field #8 @ 0x106c0fb: length 4, value: 46

Next offset: 0xCE
Checking offset: 0xCE: (SYS_INDEXES) ORIGIN=OK DELETED=0x0 OFFSETS=OK DATA_SIZE=OK
Checking field lengths for a row (SYS_INDEXES): OFFSETS: 15 8 16 22 29 36 40 44 48
 - field TABLE_ID(8):
 - field ID(8):
 - field DB_TRX_ID(6):
 - field DB_ROLL_PTR(7):
 - field NAME(7):OK!
 - field N_FIELDS(4):
 - field TYPE(4):
 - field SPACE(4):
 - field PAGE_NO(4):
FIELD_SIZES=OK
Checking constraints for a row (SYS_INDEXES) at 0x106c10e: len 100; hex 000000000000000b000000000000000c000000000300800000002d01a5464f525f494e440000000100000000000000000000002f34302c28241d161008000020130154000000000000000b000000000000000d000000000300800000002d01d35245465f; asc - FOR_IND /40,($ T - REF_;
 - field TABLE_ID(addr = 0x106c10e, len = 8):UINT(8)=11
 - field ID(addr = 0x106c116, len = 8):UINT(8)=12
 - field DB_TRX_ID(addr = 0x106c11e, len = 6):
 - field DB_ROLL_PTR(addr = 0x106c124, len = 7):
 - field NAME(addr = 0x106c12b, len = 7): len 7; hex 464f525f494e44; asc FOR_IND;
 - field N_FIELDS(addr = 0x106c132, len = 4):
 - field TYPE(addr = 0x106c136, len = 4):
 - field SPACE(addr = 0x106c13a, len = 4):
 - field PAGE_NO(addr = 0x106c13e, len = 4):
Row looks OK!

---------------------------------------------------
PAGE11: Found a table SYS_INDEXES record: 0x106c10e (offset = 206)
Processing record 0x106c10e from table 'SYS_INDEXES'
PHYSICAL RECORD: n_fields 9; compact format; info bits 0
 0: len 8; hex 000000000000000b; asc ;; 1: len 8; hex 000000000000000c; asc ;; 2: len 6; hex 000000000300; asc ;; 3: len 7; hex 800000002d01a5; asc - ;; 4: len 7; hex 464f525f494e44; asc FOR_IND;; 5: len 4; hex 00000001; asc ;; 6: len 4; hex 00000000; asc ;; 7: len 4; hex 00000000; asc ;; 8: len 4; hex 0000002f; asc /;;
Field #0 @ 0x106c10e: length 8, value: 11
Field #1 @ 0x106c116: length 8, value: 12
Field #4 @ 0x106c12b: length 7, value: "FOR_IND"
Field #5 @ 0x106c132: length 4, value: 1
Field #6 @ 0x106c136: length 4, value: 0
Field #7 @ 0x106c13a: length 4, value: 0
Field #8 @ 0x106c13e: length 4, value: 47

Next offset: 0x111
Checking offset: 0x111: (SYS_INDEXES) ORIGIN=OK DELETED=0x0 OFFSETS=OK DATA_SIZE=OK
Checking field lengths for a row (SYS_INDEXES): OFFSETS: 15 8 16 22 29 36 40 44 48
 - field TABLE_ID(8):
 - field ID(8):
 - field DB_TRX_ID(6):
 - field DB_ROLL_PTR(7):
 - field NAME(7):OK!
 - field N_FIELDS(4):
 - field TYPE(4):
 - field SPACE(4):
 - field PAGE_NO(4):
FIELD_SIZES=OK
Checking constraints for a row (SYS_INDEXES) at 0x106c151: len 100; hex 000000000000000b000000000000000d000000000300800000002d01d35245465f494e4400000001000000000000000000000030332f2b27231d161008000028130074000000000000000c000000000000000e000000000300800000002d026d49445f49; asc - REF_IND 03/+'# ( t - mID_I;
 - field TABLE_ID(addr = 0x106c151, len = 8):UINT(8)=11
 - field ID(addr = 0x106c159, len = 8):UINT(8)=13
 - field DB_TRX_ID(addr = 0x106c161, len = 6):
 - field DB_ROLL_PTR(addr = 0x106c167, len = 7):
 - field NAME(addr = 0x106c16e, len = 7): len 7; hex 5245465f494e44; asc REF_IND;
 - field N_FIELDS(addr = 0x106c175, len = 4):
 - field TYPE(addr = 0x106c179, len = 4):
 - field SPACE(addr = 0x106c17d, len = 4):
 - field PAGE_NO(addr = 0x106c181, len = 4):
Row looks OK!

---------------------------------------------------
PAGE11: Found a table SYS_INDEXES record: 0x106c151 (offset = 273)
Processing record 0x106c151 from table 'SYS_INDEXES'
PHYSICAL RECORD: n_fields 9; compact format; info bits 0
 0: len 8; hex 000000000000000b; asc ;; 1: len 8; hex 000000000000000d; asc ;; 2: len 6; hex 000000000300; asc ;; 3: len 7; hex 800000002d01d3; asc - ;; 4: len 7; hex 5245465f494e44; asc REF_IND;; 5: len 4; hex 00000001; asc ;; 6: len 4; hex 00000000; asc ;; 7: len 4; hex 00000000; asc ;; 8: len 4; hex 00000030; asc 0;;
Field #0 @ 0x106c151: length 8, value: 11
Field #1 @ 0x106c159: length 8, value: 13
Field #4 @ 0x106c16e: length 7, value: "REF_IND"
Field #5 @ 0x106c175: length 4, value: 1
Field #6 @ 0x106c179: length 4, value: 0
Field #7 @ 0x106c17d: length 4, value: 0
Field #8 @ 0x106c181: length 4, value: 48

Next offset: 0x154
Checking offset: 0x154: (SYS_INDEXES) ORIGIN=OK DELETED=0x0 OFFSETS=OK DATA_SIZE=OK
Checking field lengths for a row (SYS_INDEXES): OFFSETS: 15 8 16 22 29 35 39 43 47
 - field TABLE_ID(8):
 - field ID(8):
 - field DB_TRX_ID(6):
 - field DB_ROLL_PTR(7):
 - field NAME(6):OK!
 - field N_FIELDS(4):
 - field TYPE(4):
 - field SPACE(4):
 - field PAGE_NO(4):
FIELD_SIZES=OK
Checking constraints for a row (SYS_INDEXES) at 0x106c194: len 100; hex 000000000000000c000000000000000e000000000300800000002d026d49445f494e440000000200000003000000000000003134302c28241d161008200030130000000000000000000d000000000000000f00000000030f000000003301455052494d41; asc - mID_IND 140,($ 0 3 EPRIMA;
 - field TABLE_ID(addr = 0x106c194, len = 8):UINT(8)=12
 - field ID(addr = 0x106c19c, len = 8):UINT(8)=14
 - field DB_TRX_ID(addr = 0x106c1a4, len = 6):
 - field DB_ROLL_PTR(addr = 0x106c1aa, len = 7):
 - field NAME(addr = 0x106c1b1, len = 6): len 6; hex 49445f494e44; asc ID_IND;
 - field N_FIELDS(addr = 0x106c1b7, len = 4):
 - field TYPE(addr = 0x106c1bb, len = 4):
 - field SPACE(addr = 0x106c1bf, len = 4):
 - field PAGE_NO(addr = 0x106c1c3, len = 4):
Row looks OK!

---------------------------------------------------
PAGE11: Found a table SYS_INDEXES record: 0x106c194 (offset = 340)
Processing record 0x106c194 from table 'SYS_INDEXES'
PHYSICAL RECORD: n_fields 9; compact format; info bits 0
 0: len 8; hex 000000000000000c; asc ;; 1: len 8; hex 000000000000000e; asc ;; 2: len 6; hex 000000000300; asc ;; 3: len 7; hex 800000002d026d; asc - m;; 4: len 6; hex 49445f494e44; asc ID_IND;; 5: len 4; hex 00000002; asc ;; 6: len 4; hex 00000003; asc ;; 7: len 4; hex 00000000; asc ;; 8: len 4; hex 00000031; asc 1;;
Field #0 @ 0x106c194: length 8, value: 12
Field #1 @ 0x106c19c: length 8, value: 14
Field #4 @ 0x106c1b1: length 6, value: "ID_IND"
Field #5 @ 0x106c1b7: length 4, value: 2
Field #6 @ 0x106c1bb: length 4, value: 3
Field #7 @ 0x106c1bf: length 4, value: 0
Field #8 @ 0x106c1c3: length 4, value: 49

Next offset: 0x74Opening file: pages-1289403685/FIL_PAGE_INDEX/0-3/4-00000011.page
Initializing table definitions...
Processing table: SYS_INDEXES
 - total fields: 9
 - nullable fields: 5
 - minimum header size: 5
 - minimum rec size: 29
 - maximum rec size: 165

Read data from fn=5...
Page id: 11
Checking a page
Infimum offset: 0x65
Supremum offset: 0x74
Next record at offset: 0x8C (140)
Next record at offset: 0xCE (206)
Next record at offset: 0x111 (273)
Next record at offset: 0x154 (340)
Next record at offset: 0x74 (116)
Page is good
Starting offset: 140 (8C). Checking 1 table definitions.

Checking offset: 0x8C: (SYS_INDEXES) ORIGIN=OK DELETED=0x0 OFFSETS=OK DATA_SIZE=OK
Checking field lengths for a row (SYS_INDEXES): OFFSETS: 15 8 16 22 29 35 39 43 47
 - field TABLE_ID(8):
 - field ID(8):
 - field DB_TRX_ID(6):
 - field DB_ROLL_PTR(7):
 - field NAME(6):OK!
 - field N_FIELDS(4):
 - field TYPE(4):
 - field SPACE(4):
 - field PAGE_NO(4):
FIELD_SIZES=OK
Checking constraints for a row (SYS_INDEXES) at 0x10700dc: len 100; hex 000000000000000b000000000000000b000000000300800000002d017749445f494e440000000100000003000000000000002e34302c28241d161008000018130111000000000000000b000000000000000c000000000300800000002d01a5464f525f49; asc - wID_IND .40,($ - FOR_I;
 - field TABLE_ID(addr = 0x10700dc, len = 8):UINT(8)=11
 - field ID(addr = 0x10700e4, len = 8):UINT(8)=11
 - field DB_TRX_ID(addr = 0x10700ec, len = 6):
 - field DB_ROLL_PTR(addr = 0x10700f2, len = 7):
 - field NAME(addr = 0x10700f9, len = 6): len 6; hex 49445f494e44; asc ID_IND;
 - field N_FIELDS(addr = 0x10700ff, len = 4):
 - field TYPE(addr = 0x1070103, len = 4):
 - field SPACE(addr = 0x1070107, len = 4):
 - field PAGE_NO(addr = 0x107010b, len = 4):
Row looks OK!

---------------------------------------------------
PAGE11: Found a table SYS_INDEXES record: 0x10700dc (offset = 140)
Processing record 0x10700dc from table 'SYS_INDEXES'
PHYSICAL RECORD: n_fields 9; compact format; info bits 0
 0: len 8; hex 000000000000000b; asc ;; 1: len 8; hex 000000000000000b; asc ;; 2: len 6; hex 000000000300; asc ;; 3: len 7; hex 800000002d0177; asc - w;; 4: len 6; hex 49445f494e44; asc ID_IND;; 5: len 4; hex 00000001; asc ;; 6: len 4; hex 00000003; asc ;; 7: len 4; hex 00000000; asc ;; 8: len 4; hex 0000002e; asc .;;
Field #0 @ 0x10700dc: length 8, value: 11
Field #1 @ 0x10700e4: length 8, value: 11
Field #4 @ 0x10700f9: length 6, value: "ID_IND"
Field #5 @ 0x10700ff: length 4, value: 1
Field #6 @ 0x1070103: length 4, value: 3
Field #7 @ 0x1070107: length 4, value: 0
Field #8 @ 0x107010b: length 4, value: 46

Next offset: 0xCE
Checking offset: 0xCE: (SYS_INDEXES) ORIGIN=OK DELETED=0x0 OFFSETS=OK DATA_SIZE=OK
Checking field lengths for a row (SYS_INDEXES): OFFSETS: 15 8 16 22 29 36 40 44 48
 - field TABLE_ID(8):
 - field ID(8):
 - field DB_TRX_ID(6):
 - field DB_ROLL_PTR(7):
 - field NAME(7):OK!
 - field N_FIELDS(4):
 - field TYPE(4):
 - field SPACE(4):
 - field PAGE_NO(4):
FIELD_SIZES=OK
Checking constraints for a row (SYS_INDEXES) at 0x107011e: len 100; hex 000000000000000b000000000000000c000000000300800000002d01a5464f525f494e440000000100000000000000000000002f34302c28241d161008000020130154000000000000000b000000000000000d000000000300800000002d01d35245465f; asc - FOR_IND /40,($ T - REF_;
 - field TABLE_ID(addr = 0x107011e, len = 8):UINT(8)=11
 - field ID(addr = 0x1070126, len = 8):UINT(8)=12
 - field DB_TRX_ID(addr = 0x107012e, len = 6):
 - field DB_ROLL_PTR(addr = 0x1070134, len = 7):
 - field NAME(addr = 0x107013b, len = 7): len 7; hex 464f525f494e44; asc FOR_IND;
 - field N_FIELDS(addr = 0x1070142, len = 4):
 - field TYPE(addr = 0x1070146, len = 4):
 - field SPACE(addr = 0x107014a, len = 4):
 - field PAGE_NO(addr = 0x107014e, len = 4):
Row looks OK!

---------------------------------------------------
PAGE11: Found a table SYS_INDEXES record: 0x107011e (offset = 206)
Processing record 0x107011e from table 'SYS_INDEXES'
PHYSICAL RECORD: n_fields 9; compact format; info bits 0
 0: len 8; hex 000000000000000b; asc ;; 1: len 8; hex 000000000000000c; asc ;; 2: len 6; hex 000000000300; asc ;; 3: len 7; hex 800000002d01a5; asc - ;; 4: len 7; hex 464f525f494e44; asc FOR_IND;; 5: len 4; hex 00000001; asc ;; 6: len 4; hex 00000000; asc ;; 7: len 4; hex 00000000; asc ;; 8: len 4; hex 0000002f; asc /;;
Field #0 @ 0x107011e: length 8, value: 11
Field #1 @ 0x1070126: length 8, value: 12
Field #4 @ 0x107013b: length 7, value: "FOR_IND"
Field #5 @ 0x1070142: length 4, value: 1
Field #6 @ 0x1070146: length 4, value: 0
Field #7 @ 0x107014a: length 4, value: 0
Field #8 @ 0x107014e: length 4, value: 47

Next offset: 0x111
Checking offset: 0x111: (SYS_INDEXES) ORIGIN=OK DELETED=0x0 OFFSETS=OK DATA_SIZE=OK
Checking field lengths for a row (SYS_INDEXES): OFFSETS: 15 8 16 22 29 36 40 44 48
 - field TABLE_ID(8):
 - field ID(8):
 - field DB_TRX_ID(6):
 - field DB_ROLL_PTR(7):
 - field NAME(7):OK!
 - field N_FIELDS(4):
 - field TYPE(4):
 - field SPACE(4):
 - field PAGE_NO(4):
FIELD_SIZES=OK
Checking constraints for a row (SYS_INDEXES) at 0x1070161: len 100; hex 000000000000000b000000000000000d000000000300800000002d01d35245465f494e4400000001000000000000000000000030332f2b27231d161008000028130074000000000000000c000000000000000e000000000300800000002d026d49445f49; asc - REF_IND 03/+'# ( t - mID_I;
 - field TABLE_ID(addr = 0x1070161, len = 8):UINT(8)=11
 - field ID(addr = 0x1070169, len = 8):UINT(8)=13
 - field DB_TRX_ID(addr = 0x1070171, len = 6):
 - field DB_ROLL_PTR(addr = 0x1070177, len = 7):
 - field NAME(addr = 0x107017e, len = 7): len 7; hex 5245465f494e44; asc REF_IND;
 - field N_FIELDS(addr = 0x1070185, len = 4):
 - field TYPE(addr = 0x1070189, len = 4):
 - field SPACE(addr = 0x107018d, len = 4):
 - field PAGE_NO(addr = 0x1070191, len = 4):
Row looks OK!

---------------------------------------------------
PAGE11: Found a table SYS_INDEXES record: 0x1070161 (offset = 273)
Processing record 0x1070161 from table 'SYS_INDEXES'
PHYSICAL RECORD: n_fields 9; compact format; info bits 0
 0: len 8; hex 000000000000000b; asc ;; 1: len 8; hex 000000000000000d; asc ;; 2: len 6; hex 000000000300; asc ;; 3: len 7; hex 800000002d01d3; asc - ;; 4: len 7; hex 5245465f494e44; asc REF_IND;; 5: len 4; hex 00000001; asc ;; 6: len 4; hex 00000000; asc ;; 7: len 4; hex 00000000; asc ;; 8: len 4; hex 00000030; asc 0;;
Field #0 @ 0x1070161: length 8, value: 11
Field #1 @ 0x1070169: length 8, value: 13
Field #4 @ 0x107017e: length 7, value: "REF_IND"
Field #5 @ 0x1070185: length 4, value: 1
Field #6 @ 0x1070189: length 4, value: 0
Field #7 @ 0x107018d: length 4, value: 0
Field #8 @ 0x1070191: length 4, value: 48

Next offset: 0x154
Checking offset: 0x154: (SYS_INDEXES) ORIGIN=OK DELETED=0x0 OFFSETS=OK DATA_SIZE=OK
Checking field lengths for a row (SYS_INDEXES): OFFSETS: 15 8 16 22 29 35 39 43 47
 - field TABLE_ID(8):
 - field ID(8):
 - field DB_TRX_ID(6):
 - field DB_ROLL_PTR(7):
 - field NAME(6):OK!
 - field N_FIELDS(4):
 - field TYPE(4):
 - field SPACE(4):
 - field PAGE_NO(4):
FIELD_SIZES=OK
Checking constraints for a row (SYS_INDEXES) at 0x10701a4: len 100; hex 000000000000000c000000000000000e000000000300800000002d026d49445f494e440000000200000003000000000000003134302c28241d161008200030130000000000000000000d000000000000000f00000000030f000000003301455052494d41; asc - mID_IND 140,($ 0 3 EPRIMA;
 - field TABLE_ID(addr = 0x10701a4, len = 8):UINT(8)=12
 - field ID(addr = 0x10701ac, len = 8):UINT(8)=14
 - field DB_TRX_ID(addr = 0x10701b4, len = 6):
 - field DB_ROLL_PTR(addr = 0x10701ba, len = 7):
 - field NAME(addr = 0x10701c1, len = 6): len 6; hex 49445f494e44; asc ID_IND;
 - field N_FIELDS(addr = 0x10701c7, len = 4):
 - field TYPE(addr = 0x10701cb, len = 4):
 - field SPACE(addr = 0x10701cf, len = 4):
 - field PAGE_NO(addr = 0x10701d3, len = 4):
Row looks OK!

---------------------------------------------------
PAGE11: Found a table SYS_INDEXES record: 0x10701a4 (offset = 340)
Processing record 0x10701a4 from table 'SYS_INDEXES'
PHYSICAL RECORD: n_fields 9; compact format; info bits 0
 0: len 8; hex 000000000000000c; asc ;; 1: len 8; hex 000000000000000e; asc ;; 2: len 6; hex 000000000300; asc ;; 3: len 7; hex 800000002d026d; asc - m;; 4: len 6; hex 49445f494e44; asc ID_IND;; 5: len 4; hex 00000002; asc ;; 6: len 4; hex 00000003; asc ;; 7: len 4; hex 00000000; asc ;; 8: len 4; hex 00000031; asc 1;;
Field #0 @ 0x10701a4: length 8, value: 12
Field #1 @ 0x10701ac: length 8, value: 14
Field #4 @ 0x10701c1: length 6, value: "ID_IND"
Field #5 @ 0x10701c7: length 4, value: 2
Field #6 @ 0x10701cb: length 4, value: 3
Field #7 @ 0x10701cf: length 4, value: 0
Field #8 @ 0x10701d3: length 4, value: 49

Next offset: 0x74

Same for SYS_TABLES:

Opening file: pages-1289399794/FIL_PAGE_INDEX/0-1/12-00000008.page
Initializing table definitions...
Processing table: SYS_TABLES
 - total fields: 10
 - nullable fields: 6
 - minimum header size: 5
 - minimum rec size: 21
 - maximum rec size: 555

Read data from fn=4...
Page id: 8
Checking a page
Infimum offset: 0x65
Supremum offset: 0x74
Next record at offset: 0x8D (141)
Next record at offset: 0xD5 (213)
Next record at offset: 0x74 (116)
Page is good
Starting offset: 141 (8D). Checking 1 table definitions.

Checking offset: 0x8D: (SYS_TABLES) ORIGIN=OK DELETED=0x0 OFFSETS=OK DATA_SIZE=OK
Checking field lengths for a row (SYS_TABLES): OFFSETS: 16 11 17 24 32 36 40 48 52 52
 - field NAME(11):OK!
 - field DB_TRX_ID(6):
 - field DB_ROLL_PTR(7):
 - field ID(8):
 - field N_COLS(4):
 - field TYPE(4):
 - field MIX_ID(8):
 - field MIX_LEN(4):
 - field CLUSTER_NAME(0):OK!
 - field SPACE(4):
FIELD_SIZES=OK
Checking constraints for a row (SYS_TABLES) at 0x1ee009d: len 100; hex 5359535f464f524549474e000000000300800000002d0110000000000000000b0000000400000001000000000000000000000000000000003db939352d29251d16100000181500745359535f464f524549474e5f434f4c53000000000300800000002d02; asc SYS_FOREIGN - = 95-)% tSYS_FOREIGN_COLS - ;
 - field NAME(addr = 0x1ee009d, len = 11): len 11; hex 5359535f464f524549474e; asc SYS_FOREIGN;
 - field DB_TRX_ID(addr = 0x1ee00a8, len = 6):
 - field DB_ROLL_PTR(addr = 0x1ee00ae, len = 7):
 - field ID(addr = 0x1ee00b5, len = 8):UINT(8)=11
 - field N_COLS(addr = 0x1ee00bd, len = 4):
 - field TYPE(addr = 0x1ee00c1, len = 4):
 - field MIX_ID(addr = 0x1ee00c5, len = 8):UINT(8)=0
 - field MIX_LEN(addr = 0x1ee00cd, len = 4):
 - field CLUSTER_NAME(addr = 0x1ee00d1, len = 0): len 0; hex ; asc ;
 - field SPACE(addr = 0x1ee00d1, len = 4):
Row looks OK!

---------------------------------------------------
PAGE8: Found a table SYS_TABLES record: 0x1ee009d (offset = 141)
Processing record 0x1ee009d from table 'SYS_TABLES'
PHYSICAL RECORD: n_fields 10; compact format; info bits 0
 0: len 11; hex 5359535f464f524549474e; asc SYS_FOREIGN;; 1: len 6; hex 000000000300; asc ;; 2: len 7; hex 800000002d0110; asc - ;; 3: len 8; hex 000000000000000b; asc ;; 4: len 4; hex 00000004; asc ;; 5: len 4; hex 00000001; asc ;; 6: len 8; hex 0000000000000000; asc ;; 7: len 4; hex 00000000; asc ;; 8: len 0; hex ; asc ;; 9: len 4; hex 00000000; asc ;;
Field #0 @ 0x1ee009d: length 11, value: "SYS_FOREIGN"
Field #3 @ 0x1ee00b5: length 8, value: 11
Field #4 @ 0x1ee00bd: length 4, value: 4
Field #5 @ 0x1ee00c1: length 4, value: 1
Field #6 @ 0x1ee00c5: length 8, value: 0
Field #7 @ 0x1ee00cd: length 4, value: 0
Field #8 @ 0x1ee00d1: length 0, value: ""
Field #9 @ 0x1ee00d1: length 4, value: 0

Next offset: 0xD5
Checking offset: 0xD5: (SYS_TABLES) ORIGIN=OK DELETED=0x0 OFFSETS=OK DATA_SIZE=OK
Checking field lengths for a row (SYS_TABLES): OFFSETS: 16 16 22 29 37 41 45 53 57 57
 - field NAME(16):OK!
 - field DB_TRX_ID(6):
 - field DB_ROLL_PTR(7):
 - field ID(8):
 - field N_COLS(4):
 - field TYPE(4):
 - field MIX_ID(8):
 - field MIX_LEN(4):
 - field CLUSTER_NAME(0):OK!
 - field SPACE(4):
FIELD_SIZES=OK
Checking constraints for a row (SYS_TABLES) at 0x1ee00e5: len 100; hex 5359535f464f524549474e5f434f4c53000000000300800000002d0201000000000000000c00000004000000010000000000000000000000000000000037b3332f27231f17100a200020150000706572636f6e612f743100000000030f000000003301ec; asc SYS_FOREIGN_COLS - 7 3/'# percona/t1 3 ;
 - field NAME(addr = 0x1ee00e5, len = 16): len 16; hex 5359535f464f524549474e5f434f4c53; asc SYS_FOREIGN_COLS;
 - field DB_TRX_ID(addr = 0x1ee00f5, len = 6):
 - field DB_ROLL_PTR(addr = 0x1ee00fb, len = 7):
 - field ID(addr = 0x1ee0102, len = 8):UINT(8)=12
 - field N_COLS(addr = 0x1ee010a, len = 4):
 - field TYPE(addr = 0x1ee010e, len = 4):
 - field MIX_ID(addr = 0x1ee0112, len = 8):UINT(8)=0
 - field MIX_LEN(addr = 0x1ee011a, len = 4):
 - field CLUSTER_NAME(addr = 0x1ee011e, len = 0): len 0; hex ; asc ;
 - field SPACE(addr = 0x1ee011e, len = 4):
Row looks OK!

---------------------------------------------------
PAGE8: Found a table SYS_TABLES record: 0x1ee00e5 (offset = 213)
Processing record 0x1ee00e5 from table 'SYS_TABLES'
PHYSICAL RECORD: n_fields 10; compact format; info bits 0
 0: len 16; hex 5359535f464f524549474e5f434f4c53; asc SYS_FOREIGN_COLS;; 1: len 6; hex 000000000300; asc ;; 2: len 7; hex 800000002d0201; asc - ;; 3: len 8; hex 000000000000000c; asc ;; 4: len 4; hex 00000004; asc ;; 5: len 4; hex 00000001; asc ;; 6: len 8; hex 0000000000000000; asc ;; 7: len 4; hex 00000000; asc ;; 8: len 0; hex ; asc ;; 9: len 4; hex 00000000; asc ;;
Field #0 @ 0x1ee00e5: length 16, value: "SYS_FOREIGN_COLS"
Field #3 @ 0x1ee0102: length 8, value: 12
Field #4 @ 0x1ee010a: length 4, value: 4
Field #5 @ 0x1ee010e: length 4, value: 1
Field #6 @ 0x1ee0112: length 8, value: 0
Field #7 @ 0x1ee011a: length 4, value: 0
Field #8 @ 0x1ee011e: length 0, value: ""
Field #9 @ 0x1ee011e: length 4, value: 0

Next offset: 0x74

Changed in percona-innodb-recovery-tool:
assignee: nobody → Aleksandr Kuzminsky (akuzminsky)
summary: - Constraints parser can't see dropped table
+ Constraints parser can't recover deleted tables
Revision history for this message
Tamas Kozak (tamas-kozak) wrote :
Revision history for this message
Aleksandr Kuzminsky (akuzminsky) wrote :

When innodb deletes a record it is unlinked from the list of records.
The page look valid for constraints_parser, so it doesn't see deleted records.

Changed in percona-data-recovery-tool-for-innodb:
milestone: none → release-0.6
status: New → Confirmed
Changed in percona-data-recovery-tool-for-innodb:
importance: Undecided → High
Revision history for this message
Olivier Doucet (odoucet) wrote :

How can I help you solve this bug ? Is there a quick workaround ?

Revision history for this message
Aleksandr Kuzminsky (akuzminsky) wrote :

Olivier,

Workaround is always return 0 in check_page().
0 means a page is "bad". In that case constraints_parser will scan the page byte by byte.
Probably you will need to narrow filters in include/table_defs.h as well.

The solution will be implemented in 0.6. I think a new command line option will be added to control constraints_parser's behaviour.

Revision history for this message
Aleksandr Kuzminsky (akuzminsky) wrote :

If -D is specified check_page() will always return 0.

Changed in percona-data-recovery-tool-for-innodb:
status: Confirmed → Fix Committed
Changed in percona-data-recovery-tool-for-innodb:
status: Fix Committed → Confirmed
Changed in percona-data-recovery-tool-for-innodb:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.