[mythtv] Strange QUERY_RECORDINGS results
Chris Pinkham
cpinkham at bc2va.org
Fri Oct 24 03:55:34 UTC 2008
* On Thu Oct 23, 2008 at 02:37:39PM +1100, Nigel Pearson wrote:
> The backend does a query roughly like this
> for ' 26 QUERY_RECORDINGS Recording':
>
>
> mysql> SELECT
> recorded.chanid,recorded.starttime,recorded.endtime,recorded.title
> FROM recorded WHERE recorded.endtime >= NOW() AND recorded.starttime
> <= NOW();
> Empty set (0.01 sec)
What was NOW() when you ran these queries? It almost looks like you
ran most of them before 12:59 and then the very last one after 13:00
but before 13:32.
> mysql> select
> recorded.chanid,recorded.starttime,recorded.endtime,recorded.title
> from recorded where recorded.endtime >= NOW();
So this gave you a bunch of rows with various starttimes between
13:00-13:50 but all ending in 14:00. This query must have been run
before 14:00.
> mysql> select
> recorded.chanid,recorded.starttime,recorded.endtime,recorded.title
> from recorded where recorded.starttime <= NOW();
And this gave you a bunch of rows with various starrtimes, but the
latest starttime is:
1066 | 2008-10-22 17:00:00 | 2008-10-22 17:05:00 | Ten News at Five
So, this didn't list any of your earlier Oprah records, implying that
you ran this query before 13:00 since that's the earlier Oprah
starttime listed in your first query.
> So, I tried parenthesising the two conditionals:
How much time elapsed?
> mysql> select
> recorded.chanid,recorded.starttime,recorded.endtime,recorded.title
> from recorded where (recorded.endtime >= NOW() AND recorded.starttime
> <= NOW());
1066 | 2008-10-23 13:00:00 | 2008-10-23 14:00:00 | The Oprah Winfrey Show
Since this record was listed in the first result set, but not in the
second, it seems like you ran this query sometime after 13:00, but
before 13:32 since that's the starttime of the second Oprah listing in the
first result set.
> which gives me the one recording I expect. So, there needs to be extra
> parentheses about line 1200 of programs/mythbackend/mainserver.cpp,
> right?
I agree with others, you shouldn't need it.
--
Chris (Yes I'm Alive) Pinkham
More information about the mythtv-dev
mailing list