[Bast-commits] r5517 - in DBIx-Class/0.08/branches/subquery:
lib/DBIx/Class/Storage/DBI t/search
robkinyon at dev.catalyst.perl.org
robkinyon at dev.catalyst.perl.org
Wed Feb 18 16:52:43 GMT 2009
Author: robkinyon
Date: 2009-02-18 16:52:42 +0000 (Wed, 18 Feb 2009)
New Revision: 5517
Modified:
DBIx-Class/0.08/branches/subquery/lib/DBIx/Class/Storage/DBI/Cursor.pm
DBIx-Class/0.08/branches/subquery/t/search/subquery.t
Log:
as_query now provides its own parens
Modified: DBIx-Class/0.08/branches/subquery/lib/DBIx/Class/Storage/DBI/Cursor.pm
===================================================================
--- DBIx-Class/0.08/branches/subquery/lib/DBIx/Class/Storage/DBI/Cursor.pm 2009-02-18 03:06:02 UTC (rev 5516)
+++ DBIx-Class/0.08/branches/subquery/lib/DBIx/Class/Storage/DBI/Cursor.pm 2009-02-18 16:52:42 UTC (rev 5517)
@@ -72,7 +72,7 @@
my @args = $storage->_select_args(@{$self->{args}});
my ($sql, $bind) = $storage->_prep_for_execute(@args[0 .. 2], [@args[4 .. $#args]]);
- return \[ $sql, @$bind ];
+ return \[ "($sql)", @$bind ];
}
=head2 next
Modified: DBIx-Class/0.08/branches/subquery/t/search/subquery.t
===================================================================
--- DBIx-Class/0.08/branches/subquery/t/search/subquery.t 2009-02-18 03:06:02 UTC (rev 5516)
+++ DBIx-Class/0.08/branches/subquery/t/search/subquery.t 2009-02-18 16:52:42 UTC (rev 5517)
@@ -46,7 +46,6 @@
my $arr = $rs->as_query;
my ($query, @bind) = @{$$arr};
-warn "$query\n";
is_same_sql_bind(
$query, \@bind,
"SELECT me.artistid, me.name, me.rank, me.charfield, (SELECT id FROM cds LIMIT 1) AS cdid FROM artist me",
@@ -89,7 +88,7 @@
my ($query, @bind) = @{$$arr};
is_same_sql_bind(
$query, \@bind,
- "SELECT me.cdid, me.artistid, me.rank, me.charfield FROM cd me WHERE year = (SELECT MAX(inner.year) FROM cd inner WHERE artistid = me.artistid)",
+ "SELECT me.cdid, me.artist, me.title, me.year, me.genreid, me.single_track FROM cd me WHERE year = (SELECT MAX(inner.year) FROM cd inner WHERE artistid = me.artistid)",
[],
);
}
More information about the Bast-commits
mailing list