Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-4637

TOOLS - FRM file parser / file information

Details

    • Task
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None

    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

      Attachments

        Issue Links

          Activity

            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.

            serg Sergei Golubchik added a comment - 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.

            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

            rspadim roberto spadim added a comment - 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

            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

            serg Sergei Golubchik added a comment - 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

            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

            rspadim roberto spadim added a comment - 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

            People

              Unassigned Unassigned
              rspadim roberto spadim
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.