[MDEV-4637] TOOLS - FRM file parser / file information Created: 2013-06-10  Updated: 2019-03-06

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Minor
Reporter: roberto spadim Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None

Issue Links:
Relates
relates to MDEV-4628 PARTITION - Problem with CONNECT/ARIA... Closed
relates to MDEV-18827 Create utility to parse frm files and... Open

 Description   

In MDEV-4628 and others MDEV related to wrong table engine, should be nice a tool that could read a file and show information about it
1) check if file is a FRM file
2) read information about it without mysql source code
3) read information using mysql source code

why (2) and (3) ? the 2 will read the file as a fileinfo program, the (3) will use the current mysqld source code and show how it read the file

it's a debug tool, and maybe we could put it online in mariadb.org a place where a user submit the .frm file and check the informations about that file

problems:
1) know the file format of all versions of FRM file -> for the (2) feature
2) know how mysqld read the FRM file -> for the (3) feature
3) what language? maybe c++ and c
4) if in a language different from mariadb.org we should create a webpage to upload the file, run the tool and send result back to user



 Comments   
Comment by Sergei Golubchik [ 2013-06-11 ]

This is, actually, pretty easy.

Look in TABLE_SHARE::init_from_binary_frm_image() in 10.0.

All you need to do is to remove data structures that it creates, and
replace them with printf's. And you'll have a standalone frm parser.

Comment by roberto spadim [ 2013-06-12 ]

nice! with time i will do this
does version of mysql:
3.23, 4, 4.1, 5... 5.7 .. have this?
what about mariadb
5.1,5.2,5.3,5.5?

i want to do a currently server output, and a per version output to check what different versions report

Comment by Sergei Golubchik [ 2013-06-12 ]

Hi, Roberto!

You need to take the code from 10.0, but it will be able to parse old
frms (from 3.23, 4.0, etc) too.

Regards,
Sergei

Comment by roberto spadim [ 2013-06-12 ]

nice, my idea is after any mysql/mariadb source code change for this function
add a new function outside mysqld code, but inside mariadb source code
that will return the values of FRM file
and report the 'old' values for each version (based in MARIADB / MYSQL / DRIZZLE / ANY OTHER PORT, and VERSION (maybe commit id, or version id) )
and the current server values

with that we have FRM fields in all 'old' versions of mysql/mariadb starting from the first version
it will be very big if we (mariadb/mysql/drizlle/etc...) made changes every time to this function, and we will need to change structs names to don't have same name and different structs

well for the first version, only current server values will do a nice job =)

thanks, with time i implement this

Generated at Thu Feb 08 06:57:56 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.