Hello, Am Montag, den 07.02.2005, 17:16 +0000 schrieb sirisha gnvg: ... > Thank you for your reply.You suggested me that both > key_reflength and max_key_file_length can be read from "key > file".We just need to find the offset at which they are stored > in "key file".But I have searched all files containing "key" > as part of their name in "MySQL 4.1.9" folder for > "max_key_file_length" and all those files all c or c++ program > files. > > Then what do you mean by finding offset?Please once again > explain in detail what "key file" is and what it contains.
A MySQL MyISAM table consists of the files $DATADIR/databas_name/table_name.frm, $DATADIR/databas_name/table_name.MYD and $DATADIR/databas_name/table_name.MYI. The .MYI file is the file, which contains the indexes. The indexes are often also called 'keys'. thus, the indexes file is the key file. Look into myisam/mi_open.c. You will find "kfile=my_open(...)". This is the place, where the key file is opened. Some lines later "my_read(kfile,(char*) share->state.header...)" the header structure is read. See myisam/myisamdef.h, typedef struct st_mi_state_info. This includes "struct { ... } header". Back to mi_open.c. Some lines later, "my_seek(kfile,0L,MY_SEEK_SET" the key file is rewound. The next read starts from the beginning. Now, "my_read(kfile,disk_cache,info_length". The full fixed part of the key file, including the header, is read. Important values are picked out of the buffer with "mi_state_info_read(disk_cache, &share->state)". Some lines later, "disk_pos=my_n_base_info_read(disk_cache+base_pos, &share->base)", other important values are extracted. Both functions are also defined in mi_open.c. If you can re-use these functions, you are done. Otherwise, you can add the sizes, which are picked off the buffer in the above functions. So you get the offset of each value in the file. If you have a source tree, you will find a file Docs/internals.texi. It describes, how you can access the 'real' internals.texi. In this file you find an explanation, how the key file is structured. This may help you to understand, what you see in the functions mentioned above. Regards, Ingo -- Ingo Strüwing, Senior Software Developer MySQL AB, www.mysql.com Office: +49 30 43672407 Are you MySQL certified? www.mysql.com/certification -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]