[mythtv-users] error when fixing database forced by mythtv upgrade

Michael T. Dean mtdean at thirdcontact.com
Sun Sep 27 20:08:15 UTC 2009


On 09/27/2009 02:25 PM, Petr Stehlik wrote:
> Petr Stehlik píše v Ne 27. 09. 2009 v 19:59 +0200:
>   
>> See the following output of the same SELECT ran on the original
>> 0.21-fixes - no duplicates:
>>
>> +--------+-------------------------------------------------------------------+
>> | person | name                                                              |
>> +--------+-------------------------------------------------------------------+
>> |   2871 | Samuel Ivaška (Slovenská republika 1983)                        | 
>> |   4094 | Samuel Ivaška (Slovenská republika 1988)                        | 
>> |    644 | Samuel Ivaška Hrají: Vladimír Hajdu                            | 
>> |   3686 | Samuel Ivaška. Hrají: Ferdinand Libant                          | 
>> |  37451 | Samuel Ivaška. Hrají: Ján Havrila. (Slovenská republika 1988) | 
>> +--------+-------------------------------------------------------------------+
>> 5 rows in set (0.05 sec)
>>     
>
> Here is the same SELECT after the Fixing_Corrupt_Database_Encoding
> failed due to "Duplicate entry 'Samuel Ivaška (Slovenská republika'
> for key 2":
> +--------+------------------------------------------------+
> |   2871 | Samuel Ivaška (Slovenská republika 1983) | 
> |    644 | Samuel Ivaška Hrají: Vladimír Hajdu   | 
> |   3686 | Samuel Ivaška. Hrají: Ferdinand Libant   | 
> +--------+------------------------------------------------+
> 3 rows in set (0.00 sec)
>
> It seems like the record being inserted (most probably the one with
> person 4094) was considered duplicate because it somehow didn't compared
> the strings including the year - "1983" vs "1988" (person 2871 vs 4094).
> Almost like if it got truncated to just "Samuel Ivaška (Slovenská
> republika" - 34 to 36 characters, well below the 128 chars (size of the
> name column). Weird.
hmmm...  41, actually, which makes sense, kind of (I

> Failed again the same way as before. Going back to 0.21 and waiting for
> any suggestion.

So, can you do me a favor and drop your database:

mysql -umythtv -p mythconverg -e 'DROP DATABASE IF EXISTS mythconverg;'

then run mc.sql:

mysql -uroot -p mythconverg < mc.sql

(adjust path to file and username/DB name as necessary) and then take 
the people table contents out of the uncorrupted DB backup:

grep -v "INSERT INTO \`people\` " \
    /var/tmp/mythconverg-to_uncorrupt.sql > /var/tmp/restore.sql

and then do your restore:

/home/joy/myth/22/share/mythtv/mythconverg_restore.pl \
    --filename restore.sql --directory /var/tmp

and see if that works--basically, exactly what you tried before, just be 
very careful with the drop db and mc.sql stuff...

Then, if that restores without issue, try to run the trunk upgrade and 
let me know what happens.  If it works, I'll explain why (and try to 
figure out if this is something worth worrying about).

Thanks,
Mike


More information about the mythtv-users mailing list