MySQL Forums
Forum List  »  Utilities

mysqlfrm and partitioned tables - does it work?
Posted by: Jan Andersen
Date: October 10, 2019 04:38AM

I need to restore a partitioned table (MySQL 5.5) from an old, partial backup, which was made with a tool called innobackupex. The table definition has changed over time, so I have to extract the table definition from the .frm file, but it fails:

$ mysqlfrm --diagnostic game_action.frm
# WARNING: Cannot generate character set or collation names without the --server option.
# CAUTION: The diagnostic mode is a best-effort parse of the .frm file. As such, it may not identify all of the components of the table correctly. This is especially true for damaged files. It will also not read the default values for the columns and the resulting statement may not be syntactically correct.
# Reading .frm file for game_action.frm:
# The .frm file is a TABLE.
ERROR: Cannot read column data.

Running the same with debug options:

$ mysqlfrm --diagnostic -vvv game_action.frm
# WARNING: Cannot generate character set or collation names without the --server option.
# CAUTION: The diagnostic mode is a best-effort parse of the .frm file. As such, it may not identify all of the components of the table correctly. This is especially true for damaged files. It will also not read the default values for the columns and the resulting statement may not be syntactically correct.
# Reading .frm file for game_action.frm:
# The .frm file is a TABLE.
# Skipping to header at : 2
# General Data from .frm file:
{'IO_SIZE': 4096,
'MYSQL_VERSION_ID': 50557,
'avg_row_length': 0,
'charset_low': 0,
'create_options': 9,
'db_create_pack': 2,
...
# Partition string: PARTITION BY RANGE ( UNIX_TIMESTAMP(created_timestamp)) ...
# Skipping to column data at : 2102
{'com_length': 17740,
'int_length': 17749,
'interval_count': 22048,
'interval_parts': 19521,
'n_length': 13616,
'null_fields': 8270,
'num_cols': 12912,
'pos': 12592,
'unknown': 24375}
# Fields per screen = 53
EXCEPTION: unpack requires a string argument of length 1
ERROR: Cannot read column data.
$ type innobackupex
innobackupex is a tracked alias for /usr/bin/innobackupex
$ mysqlfrm --diagnostic game_action.frm
# WARNING: Cannot generate character set or collation names without the --server option.
# CAUTION: The diagnostic mode is a best-effort parse of the .frm file. As such, it may not identify all of the components of the table correctly. This is especially true for damaged files. It will also not read the default values for the columns and the resulting statement may not be syntactically correct.
# Reading .frm file for game_action.frm:
# The .frm file is a TABLE.
ERROR: Cannot read column data.

It seems to be looking for the column definitions at 2102 - however, looking at the file with a hex editor shows what looks like the column information near the end of the file, at 0x3153:

...
00003124 02 14 29 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..)
00003138 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0000314C 20 20 20 00 04 00 0F 67 61 6D 65 5F 61 63 74 69 6F 6E 5F 69 ....game_action_i
00003160 64 00 05 00 08 67 61 6D 65 5F 69 64 00 06 00 08 75 73 65 72 d....game_id....user
00003174 5F 69 64 00 07 00 11 67 61 6D 65 5F 69 6E 73 74 61 6E 63 65 _id....game_instance
00003188 5F 69 64 00 08 00 05 74 79 70 65 00 09 00 07 61 6D 6F 75 6E _id....type....amoun
0000319C 74 00 0A 00 09 63 75 72 72 65 6E 63 79 00 0B 00 12 63 72 65 t....currency....cre
...

Is this an error in mysqlfrm or am I using it wrong?

Options: ReplyQuote


Subject
Views
Written By
Posted
mysqlfrm and partitioned tables - does it work?
1560
October 10, 2019 04:38AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.