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

File mythtv-6013-restore-handle_character_set_for_partial_restore.2.patch, 1.3 KB (added by sphery <mtdean@…>, 11 years ago)

Updated patch to allow partial restores with MySQL 4.x (and below) backups.

  • 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);
     
    14331433            }
    14341434            if (!defined($restore_xmltvids))
    14351435            {
    1436                 $filter = '^INSERT INTO \`(' .
    1437                           join('|', @partial_restore_tables) . ')\` ';
     1436                $filter = '^INSERT INTO \`?(' .
     1437                          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            }