[mythtv] Mythfilldatabase question

Tony Lill ajlill at ajlc.waterloo.on.ca
Sun Sep 19 14:37:48 EDT 2004


What is the following query (from filldata.cpp around line 2600)
supposed to do? I had assumed that it was supposed to return a count
of the number of channels that had program data with a start time in a
particular window. Instead it consistently returns either 11 or 12,
which would be the number of half hour programs in the 6 hour window
it's checking.

                querystr.sprintf("SELECT COUNT(*) as 'hits' "
                                 "FROM channel LEFT JOIN program USING (chanid) "
                                 "WHERE sourceid = %d AND starttime >= "
                                 "DATE_ADD(CURRENT_DATE(), INTERVAL '%d 18' "
                                 "DAY_HOUR) AND "
                                 "starttime < DATE_ADD(CURRENT_DATE(), "
                                 "INTERVAL 1+%d DAY) "
                                 "GROUP BY channel.chanid "
                                 "ORDER BY hits DESC LIMIT 1",
                                 (*it).id, i, i); 


More information about the mythtv-dev mailing list