[Dbix-class] Prefetch problem

Jesse Sheidlower jester at panix.com
Thu Oct 2 15:10:31 BST 2008


On Thu, Oct 02, 2008 at 08:38:41AM +0200, Matthias Zeichmann wrote:
> On Thu, Oct 2, 2008 at 04:14, Jesse Sheidlower <jester at panix.com> wrote:
> > SELECT me.id, me.title, me.performer_id, me.number, me.capo, me.tuning, me.tab_id, me.audio_id, me.group_id, performer.id, performer.name, group.id, group.name
> > FROM lesson me
> > JOIN performer performer ON ( performer.id = me.performer_id )
> > JOIN lesson_group group ON ( group.id = me.group_id )
> > WHERE ( ( me.id = 35 ) )
> > ORDER BY me.title;
> >
> > This gives me the error:
> >
> > ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON ( group.id = me.group_id )
> > WHERE ( ( me.id = 35 ) )
> > ORDER BY me.title' at line 4
> 
> try aliasing the table to grp instead of group, my guess is that group
> is a reserved word

Uh, yeah, that would be it.

OK, I feel stupid, but at least in a different way from how I
thought I was being stupid ;-)

Thanks.

Jesse Sheidlower



More information about the DBIx-Class mailing list