[mythtv-commits] Ticket #6013: restore script--fix partial restore to account for character set
MythTV
mythtv at cvs.mythtv.org
Thu Dec 18 01:33:49 UTC 2008
#6013: restore script--fix partial restore to account for character set
----------------------------------------------+-----------------------------
Reporter: sphery <mtdean at thirdcontact.com> | Owner: ijr
Type: patch | Status: new
Priority: minor | Milestone:
Component: mythtv | Version: head
Severity: medium | Mlocked: 0
----------------------------------------------+-----------------------------
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.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/6013>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list