[mythtv-users] scheduler confusion

blind Pete 0123peter at gmail.com
Sun Sep 7 02:42:58 UTC 2014


On Mon, 01 Sep 2014 18:29:09 +0100
Mike Perkins <mikep at randomtraveller.org.uk> wrote:

> On 01/09/14 15:51, Mark Perkins wrote:
> >> On 1 Sep 2014, at 7:07 pm, "blind Pete" <0123peter at gmail.com>
> >> wrote:
> >>
> >> If nothing complained I assumed that there were no gross errors,
> >> like comparing an int to a string, but that was just an assumption.
> >>
> >>> selectclause: (channel.callsign LIKE 'SBS%' OR channel.callsign =
> >>> 'NITV') AND cardinput.cardid = 'sbs' selectclause:
> >>> cardinput.cardid = 'abc' AND channel.callsign LIKE 'abc%'
> >>> selectclause: (channel.callsign NOT LIKE ('SBS%') AND
> >>> channel.callsign <> 'NITV' ) AND cardinput.cardinputid <> 'sbs'
> >>> selectclause: channel.callsign NOT LIKE 'abc%' AND
> >>> cardinput.cardid = 'sbs'
> >>
> >> You might be right, this might be complete and utter gibberish,
> >> but it is not the cause of the trouble.
> >>
> >> Now that you are here; if cardinput.cardinputid is an int and
> >> lower case 'sbs' is a string rather than a label with an int
> >> value, where would the error messages be?  Can you recommend an
> >> SQL primer?  Or a cheat sheet that lists arithmetic, string, and
> >> logical operators.
> >
> > IIUC there will not be an error as such, I don't know what internal
> > transformation MySQL will apply to the text string to allow a
> > comparison to actually occur but you can be pretty confident that
> > whatever happens it won't be what you want to happen...
> >
> It would convert the integer to a string and try to do a string
> compare. Obviously '1' (or any other plain number) isn't going to
> match any of the values being testing for.

Using the setup utility, I've changed the two of the tuners to 
"sbs" and "abc", the third was left as "kworld00".  
Using the fontend, the custom priority rules are set to match 
channel.callsign to cardinput.displayname.  

It seems to be doing what I want.  

mysql> select * from powerpriority;
+--------------+-------------+-----------------------------------------------------------------------------------------------+                    
| priorityname | recpriority | selectclause                                                                                  |                    
+--------------+-------------+-----------------------------------------------------------------------------------------------+                    
| SBS          |           1 | (channel.callsign LIKE 'SBS%' OR channel.callsign = 'NITV') AND cardinput.displayname = 'sbs' |                    
| abc          |           3 | cardinput.displayname = 'abc' AND channel.callsign LIKE 'abc%'                                |                    
+--------------+-------------+-----------------------------------------------------------------------------------------------+                    
2 rows in set (0.00 sec)                                                                                                                          
                                                                                                                                                  
mysql>      

-- 
testing
bP


More information about the mythtv-users mailing list