Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Definitions in the frm file

From: Sergei Golubchik <serg(at)mysql.com>
Date: Thu Jul 19 2007 - 03:56:28 EDT


Hi!

On Jul 18, Bjørn Normann wrote:
> I'm working on a master dissertation about forensics investigation in
> a MySQL database system. I have gone through the definition of the
> .frm file and find some unclear information in the internals manual.
>
> I need more information about the key area. It doesn't say anything
> about how the keys or indexes are stored in the .frm file.

Check the source. For example (in 5.1).
You need this function:
http://dev.mysql.com/sources/doxygen/mysql-5.1/table_8cc.html#90fcadffe69b32708bc42f9c71792524

keys are read from the frm file in lines 00527-00578, and 00690-00712. It's easy to understand, for example:

00532       keyinfo->flags=      (uint) uint2korr(strpos) ^ HA_NOSAME;
00533       keyinfo->key_length= (uint) uint2korr(strpos+2);
00534       keyinfo->key_parts=  (uint) strpos[4];
00535       keyinfo->algorithm=  (enum ha_key_alg) strpos[5];
00536       keyinfo->block_size= uint2korr(strpos+6);
00537       strpos+=8;

means

  • two bytes for flags (with inverted HA_NOSAME bit)
  • two bytes for key length
  • one byte - number of key parts
  • one byte for key algorithm
  • two bytes - key block size

Regards / Mit vielen Grüssen,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik 
 / /|_/ / // /\ \/ /_/ / /__  Principal Software Developer
/_/  /_/\_, /___/\___\_\___/  MySQL GmbH, Radlkoferstr. 2, D-81373 München
       <___/                  Geschäftsführer: Kaj Arnö - HRB München 162140

-- 
MySQL Internals Mailing List
For list archives: 
http://lists.mysql.com/internals
To unsubscribe:    
http://lists.mysql.com/internals?unsub=lists@pantek.com
Received on Thu Jul 19 03:58:29 2007

This archive was generated by hypermail 2.1.8 : Thu Aug 09 2007 - 19:06:18 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library