<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Nov 16, 2016 at 10:11 PM, Stephen Worthington <span dir="ltr"><<a href="mailto:stephen_agent@jsw.gen.nz" target="_blank">stephen_agent@jsw.gen.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, 16 Nov 2016 20:55:35 -0800, you wrote:<br>
<br>
>On Wed, Nov 16, 2016 at 6:59 PM, Stephen Worthington <<br>
><a href="mailto:stephen_agent@jsw.gen.nz">stephen_agent@jsw.gen.nz</a>> wrote:<br>
><br>
>> On Tue, 15 Nov 2016 07:04:34 -0800, you wrote:<br>
>><br>
>> >On Tue, Nov 15, 2016 at 5:41 AM, Stephen Worthington <<br>
>> ><a href="mailto:stephen_agent@jsw.gen.nz">stephen_agent@jsw.gen.nz</a>> wrote:<br>
>> ><br>
>> >> On Tue, 15 Nov 2016 01:33:53 +1300, you wrote:<br>
>> >><br>
>> >> The conclusion I reached from this is that the problem is related to<br>
>> >> my database somehow, rather than the versions of any software I am<br>
>> >> running. Something about my current database triggers the problem.<br>
>> >><br>
>> >><br>
>> >It might be enlightening to do a dump and diff of the settings table from<br>
>> >your working vs. non-working backups.<br>
>> ><br>
>> >Karl<br>
>><br>
>> Thanks for the idea. Doing it with database tables is a just a *bit*<br>
>> more difficult than using the diff command, but I worked it out. So<br>
>> can anyone see any problems in the diff? I can not.<br>
>><br>
>> If you can not read it properly in your email program, I have also put<br>
>> it in a file on my web server:<br>
>><br>
>> <a href="http://www.jsw.gen.nz/mythtv/6543/settings_diff.txt" rel="noreferrer" target="_blank">http://www.jsw.gen.nz/mythtv/<wbr>6543/settings_diff.txt</a><br>
>><br>
>> MariaDB [mythconverg]> select hostname,value,data from (select<br>
>> s.hostname,s.value,s.data from settings s union all select<br>
>> o.hostname,o.value,o.data from settings_old o) t where hostname is<br>
>> null or hostname='mypvr' group by hostname,value having count(*)=1<br>
>> order by hostname,value;<br>
[snip]<br>
>I was thinking of something conceptually simpler, like doing a select on<br>
>each settings table, dumping the results to a text file and then diff'ing<br>
>the two files (an ORDER BY clause could help there). Since your statement<br>
>is doing a union, it doesn't show the differences (if any).<br>
><br>
>Karl<br>
<br>
Yes, it does show the differences. It is using a sneaky sql trick<br>
from this page:<br>
<br>
<br>
<a href="http://www.mysqltutorial.org/compare-two-tables-to-find-unmatched-records-mysql.aspx" rel="noreferrer" target="_blank">http://www.mysqltutorial.org/<wbr>compare-two-tables-to-find-<wbr>unmatched-records-mysql.aspx</a><br>
<br>
Trying to do a text diff of tables is quite difficult, due to the<br>
variable length of fields and the way the output table is formatted to<br>
accommodate only the longest actual length of a field. You have to do<br>
fixed length formatting on all fields to have a chance for a text diff<br>
to work.<br></blockquote></div><br></div><div class="gmail_extra">Ah, I forgot about variable column widths. The "union all" confused me. Is there any way to identify which row goes with which table? I wonder if you could add a constant to the select string such as:<br>select hostname,value,data from (select "s1",s.hostname,s.value,s.data from settings s union all select "s2, o.hostname,o.value,o.data from settings_old o) t where hostname is null or hostname='mypvr' group by hostname,value having count(*)=1 order by hostname,value;<br><br></div><div class="gmail_extra">Karl<br></div></div>