Ticket #6013: mythtv-6013-restore-handle_character_set_for_partial_restore.patch

File mythtv-6013-restore-handle_character_set_for_partial_restore.patch, 1.1 KB (added by sphery <mtdean@…>, 15 years ago)
  • programs/scripts/database/mythconverg_restore.pl

    old new  
    1313
    1414# Script info
    1515    $NAME           = 'MythTV Database Restore Script';
    16     $VERSION        = '1.0.2';
     16    $VERSION        = '1.0.3';
    1717
    1818# Some variables we'll use here
    1919    our ($username, $homedir, $mythconfdir, $database_information_file);
     
    14351435            {
    14361436                $filter = '^INSERT INTO \`(' .
    14371437                          join('|', @partial_restore_tables) . ')\` ';
     1438                # If doing a whitelist restore, ensure we keep the character
     1439                # set info to prevent data corruption
     1440                if (!defined($with_plugin_data))
     1441                {
     1442                    $filter = '(40101 SET NAMES |'.$filter.')';
     1443                }
    14381444                verbose($verbose_level_debug,
    14391445                        "\nRestoring partial backup with filter:", $filter);
    14401446            }