[mythtv-users] scheduler confusion
Mike Perkins
mikep at randomtraveller.org.uk
Mon Sep 1 17:29:09 UTC 2014
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.
--
Mike Perkins
More information about the mythtv-users
mailing list