[mythtv-users] find_orphans and error?

Stephen Worthington stephen_agent at jsw.gen.nz
Wed Jan 21 03:46:53 UTC 2015


On Tue, 20 Jan 2015 21:36:15 -0600, you wrote:

>On 01/20/2015 08:56 PM, Stephen Worthington wrote:
>...
> > So I seem to somehow have acquired 20 rows with duplicate primary
>> keys.  Fortunately, all the data values are also duplicated, so it
>> should not be causing me any problems as long as I never have to
>> change one of those settings.  Now I need to work out just how to fix
>> this - my current thought is to dump the settings table, edit out all
>> the duplicates from the SQL in the dump, then drop the table and
>> restore it from the edited dump.  Are there any better ideas?
>>
>> And does anyone have any idea how this problem might have occurred?
>
>I had the duplicates too. They're harmless. To see if the data has
>non-printing characters something like this works:
>
>      SELECT hostname,data,HEX(data) FROM settings WHERE value='BackendServerPort';
>
>For the above, the hex is: 36353433.

They are indeed identical, using that test.

I think you are wrong that the duplicates are completely harmless.  As
it stands, all my duplicate (value, hostname) keys also have duplicate
data values.  But if I changed one of the settings involved, then it
is likely that only one of the rows would have its data value changed.
Then anything that retrieved that setting might well get the data
value from whichever of the duplicate keys mysql happened to read at
the time, which could cause all sorts of strange problems.  So I think
it would be best to get rid of the duplicates before that happens.


More information about the mythtv-users mailing list