[mythtv-commits] Ticket #1286: sql query malformed for "person named in the credits" custom record

MythTV mythtv at cvs.mythtv.org
Wed Feb 15 06:29:56 UTC 2006


#1286: sql query malformed for "person named in the credits" custom record
--------------------------------------+-------------------------------------
 Reporter:  potterr at southwestern.edu  |       Owner:  ijr 
     Type:  defect                    |      Status:  new 
 Priority:  minor                     |   Milestone:      
Component:  mythtv                    |     Version:  head
 Severity:  medium                    |  
--------------------------------------+-------------------------------------
 Using the example "person named in the credits" custom record rules causes
 mythtv to produce a malformed sql query.  The query it forms is:

   SELECT record_tmp.recordid, program.chanid, program.starttime,
 IF(search = 5, recordid, 0) FROM record_tmp, program ,people, credits
 INNER JOIN channel ON program.chanid = channel.chanid WHERE
 record_tmp.recordid = '13' AND program.manualid = 0 AND ( people.name =
 'Alyson Hannigan' AND credits.person = people.person AND program.chanid =
 credits.chanid AND program.starttime = credits.starttime  ) AND
 channel.visible = 1 AND ((record_tmp.type = 4 OR record_tmp.type = 6 OR
 record_tmp.type = 9 OR record_tmp.type = 10)  OR  ((record_tmp.station =
 channel.callsign)   AND   ((record_tmp.type = 3)    OR
 ((TIME_TO_SEC(record_tmp.starttime) = TIME_TO_SEC(program.starttime))
 AND     ((record_tmp.type = 2)      OR
 ((DAYOFWEEK(record_tmp.startdate) = DAYOFWEEK(program.starttime)       AND
 ((record_tmp.type = 5)        OR       ((TO_DAYS(record_tmp.startdate) =
 TO_DAYS(program.starttime))         )       )      )     )    )   )  ) ));

 This leads to the error: " Unknown column 'program.chanid' in 'on
 clause'".

 Putting parentheses around "record_tmp, program ,people, credits" after
 "FROM" near the beginning solves the problem.

 The last post here: [http://bugs.mysql.com/bug.php?id=13832]. Explains why
 the syntax is wrong and why the parentheses are needed.

 I'm using the latest SVN at least from a couple days ago.

 Thanks.

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/1286>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list