id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,mlocked 1286,"sql query malformed for ""person named in the credits"" custom record",potterr@…,bjm,"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.",defect,closed,minor,unknown,mythtv,head,medium,fixed,,,0