Subject: | docs: avoid using reserved keyword 'inner' |
Date: | Tue, 10 Jul 2012 00:35:42 +0100 |
To: | bug-DBIx-Class [...] rt.cpan.org |
From: | Frank Schwach <fs5 [...] sanger.ac.uk> |
in DBIx::Class::Manual::Cookbook under the heading "Correlated
subqueries" the example query is shown as:
my $cdrs = $schema->resultset('CD');
my $rs = $cdrs->search({
year=> {
'=' => $cdrs->search(
{ artist_id=> { '=' => { -ident=> 'me.artist_id' } } },
{ alias=> 'inner' }
)->get_column('year')->max_rs->as_query,
},
});
The use of the alias "inner" is unfortunate here because, at least in MySQL, this leads to a very unintuitive syntax error
in the resulting SQL statement caused by using a reserved keyword ("inner").
Solution: just use a different alias, maybe "subq"?
<http://search.cpan.org/%7Earodland/DBIx-Class-0.08196/lib/DBIx/Class/Manual/Cookbook.pod#___top>
--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.