Opened 15 years ago
Closed 15 years ago
#6013 closed patch (fixed)
restore script--fix partial restore to account for character set
Reported by: | Owned by: | Rob Smith | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | mythtv | Version: | head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
The partial/"new host" restore needs to account for the character set used in the backup file to prevent data corruption. The attached patch simply adds a new condition to the filter for a "white-listed" partial restore to ensure the line:
/*!40101 SET NAMES utf8 */;
is included, to properly set the character set for the restore. It will work even if the backup uses a different character set--it doesn't have to be utf8--so it should work for any backup file (even one created by a user who explicily specifies a different character set). Note that --partial_restore --with_plugin_data (a blacklisted restore) works before the patch as the SET NAMES line is not excluded.
Since both this patch and the patch in #5975, update the script version in the restore script to 1.0.3, please either commit them together or give me time to update the other patch to get a new script version or update the script version when committing the other. Thanks.
Background information:
mysqldump (from MySQL 5.0 and above, at least) always uses UTF-8 for the dump unless otherwise instructed. Therefore, since a MySQL server may be configured with a server-default character set (which would cause client connections to use that character set) that differs from the character set used in the backup data could be corrupted (twice-converted). Likewise, on a system without a specified server-default character set, the connection will use the database-default character set. Therefore, on any 0.21-fixes and below system that's properly configured for Myth (using either a server default charset of latin1 or without a specified charset), a partial restore that does not include the SET NAMES line will cause data corruption. The same issue could happen on trunk/post-0.21-fixes systems, depending on configuration.
In addition, any partial restore using the instructions at http://mythtv.org/docs/mythtv-HOWTO-23.html#ss23.7 on a system properly-configured for 0.21-fixes and below (i.e. using a latin1 charset) will cause data corruption. I left a note in the already-open ticket at #3762.
Attachments (4)
Change History (7)
Changed 15 years ago by
Attachment: | mythtv-6013-restore-handle_character_set_for_partial_restore.patch added |
---|
Changed 15 years ago by
Attachment: | mythtv-6013-restore-handle_character_set_for_partial_restore.2.patch added |
---|
comment:1 Changed 15 years ago by
mythtv-6013-restore-handle_character_set_for_partial_restore.2.patch is an updated version of the patch that allows partial restore with MySQL 4.x (and below) backups (by making the backticks around the table name optional).
comment:2 Changed 15 years ago by
Owner: | changed from Isaac Richards to Rob Smith |
---|---|
Status: | new → accepted |
Changed 15 years ago by
Attachment: | mythtv-6013-restore-handle_character_set_for_partial_restore.3.patch added |
---|
Updated patch for recent changes to trunk.
Changed 15 years ago by
Attachment: | mythtv-5975_and_6013-combined.patch added |
---|
Updated patch to allow partial restores with MySQL 4.x (and below) backups.