twindb / undrop-for-innodb

TwinDB data recovery toolkit for MySQL/InnoDB
https://twindb.com
GNU General Public License v2.0
386 stars 151 forks source link

c_parser outputting strange numbers in the SQL file #30

Closed JonathanGetHitched closed 1 year ago

JonathanGetHitched commented 1 year ago

Hi Aleksandr,

After trying to extract the SQL I am getting some strange numbers in the tabs. Any idea why this is happening and what I can do to try and resolve it please?

JonathanGetHitched commented 1 year ago

Some more information for another, simpler table.

This is the command I am using. ./c_parser -6f gh/pages-ibdata1/FIL_PAGE_INDEX/0000000000003075.page -t /home/jon/tbl_categories.sql > dumps/default/tbl_categories 2> dumps/default/tbl_categories.sql

The data in quotes, is sort of matching but seems to be corrupt. For instance "ate Gifts & Promotional Items~O~@\0\0^A~A" should be "Corporate Gifts & Promotional Items"

The database structure is

CREATE TABLE tbl_categories ( id int(11) NOT NULL, title varchar(255) NOT NULL, default_credit tinyint(4) NOT NULL, parent int(11) NOT NULL, active tinyint(4) NOT NULL, show_in_segmentation tinyint(1) NOT NULL DEFAULT 1, description varchar(255) NOT NULL, parent_group int(11) NOT NULL, category_blog_feeds text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Page id: 901169, Format: COMPACT, Records list: Valid, Expected records: (42 42) 800000010000 08EA6D5BD900 0C802E01104576 tbl_categories -445746068 "y - Main~Y~@\0\0\0~A" 1 0 -128 -128 "" -1778384872 "" 800000020000 08EA6D5BD900 0C802E011D4576 tbl_categories -445746068 "y - First Screen~Y~@\0\0^A~A" 1 0 -128 -128 "" -1996488672 "" 800000030000 0C3DA26D4700 144036035B4D61 tbl_categories -227842700 "ing~X~@\0\0^A~@" 1 0 -96 -127 "" -2146630399 "h" 800000040000 0C3D9A444800 0A800C29F65665 tbl_categories -294296205 "~X~@\0\0^A~A" 1 0 -96 -31 "" -2130704128 "\0" 800000050000 162AC9591600 1EC0140CB4436F tbl_categories -227512462 "ate Gifts & Promotional Items~O~@\0\0^A~A" 1 0 -96 -127 "" -2146762751 "0" 800000060000 162B09121200 0C403B2F375068 tbl_categories -277581977 "raphy~X~@\0\0^A~A" 1 0 -96 -127 "" -2146760959 "8" 800000070000 1648D6875100 1F802F26995669 tbl_categories -463114393 "raphy~X~@\0\0^A~A" 1 0 -96 -127 "" -2145976319 "@" 800000080000 1648F1A26C00 1F801F27BA5961 tbl_categories -479693792 "Charter & Boating~X~@\0\0^A~A" 1 0 -96 -127 "" -2146566143 "H" 800000090000 16494E906200 1F803B10C65472 tbl_categories -512855184 "ortation~X~@\0\0^A~A" 1 0 -96 -127 "" -2146566143 "P" 8000000A0000 164977D83F00 11C0201CBF4576 tbl_categories -445746144 "Planners~X~@\0\0^A~A" 1 0 -96 -127 "" -21464

Any help would be greatly appreciated!

akuzminsky commented 1 year ago
  1. An inaccurate schema of tbl_categories. Try a dbsake tool as in https://stackoverflow.com/questions/75090681/restore-table-from-frm-and-ibd-file/75112805#75112805 . It's extremely important to get the schema right, otherwise c_parser won't produce a meaningful result.

  2. Try to play with -4, -5, -6 options. (however c_parser says it's a COMPACT format, so not -4.)

  3. 3075 might not be an index_id of the PRIMARY index. Try c_parser against other indexes if you're not sure 3075 is the right one.