Offsets incorrecty determined for COMPAT format

Bug #517063 reported by Aleksandr Kuzminsky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Data Recovery Tool for InnoDB
Confirmed
High
Aleksandr Kuzminsky

Bug Description

Table
CREATE TABLE `log_system_system` (
  `logid` int(11) NOT NULL AUTO_INCREMENT,
  `logtype` varchar(20) DEFAULT NULL,
  `logmodule` varchar(100) NOT NULL DEFAULT '',
  `logseverity` char(1) NOT NULL DEFAULT '4',
  `logsummary` varchar(250) NOT NULL,
  `logmsg` text NOT NULL,
  `logdate` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`logid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

TEXT field logmsg is longer than 255 bytes, thus needs 2 bytes offsets.
The rest of offsets are one byte:
Offset in HEX: 70 86 1F 01 00 03
The tool reports incorrect values: OFFSETS: 0 4 10 17 20 20 21 22 53

Changed in percona-innodb-recovery-tool:
importance: Undecided → High
milestone: none → release-0.5
assignee: nobody → Aleksandr Kuzminsky (akuzminsky)
Revision history for this message
Aleksandr Kuzminsky (akuzminsky) wrote :

ibrec_init_offsets_new() ignores fact that offsets can be 2 bytes:
 len = *lens--;

If max length of a fied is bigger > 255 bytes, offset is 2 bytes

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

The reason - CHAR(1) is treated as variable type.
It has a record in offsets

Fix -
min_length: 0,
max_length: 1,

to table definitions

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

A correction.
CHAR() becomes VARCHAR() when field encoding is UTF-8

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

Other bug subscribers

Remote bug watches

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