X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F19quotes_newstyle.t;h=f0c34a918627de73b6c93b329819ab7c96d5f5e5;hb=7ff18dbd7fdaff372c7ec8476a62ccc9e5d5bb68;hp=4e4911782000f9dde34bda3e0870ccbf2ee0fe85;hpb=d07ee31ae6149b214e70a33888d0c3e771de2009;p=dbsrgits%2FDBIx-Class.git diff --git a/t/19quotes_newstyle.t b/t/19quotes_newstyle.t index 4e49117..f0c34a9 100644 --- a/t/19quotes_newstyle.t +++ b/t/19quotes_newstyle.t @@ -30,7 +30,7 @@ $schema->connection( { quote_char => '`', name_sep => '.' }, ); -my ($sql, @bind) = (''); +my ($sql, @bind); $schema->storage->debugobj(DBIC::DebugObj->new(\$sql, \@bind)), $schema->storage->debug(1); @@ -41,10 +41,8 @@ $rs = $schema->resultset('CD')->search( { join => 'artist' }); eval { $rs->count }; is_same_sql_bind( - $sql, - \@bind, - "SELECT COUNT( * ) FROM (SELECT `me`.`cdid` FROM `cd` `me` JOIN `artist` `artist` ON `artist`.`artistid` = `me`.`artist` WHERE ( ( `artist`.`name` = ? AND `me`.`year` = ? ) ) GROUP BY `me`.`cdid`) `count_subq`", - ["'Caterwauler McCrae'", "'2001'"], + $sql, \@bind, + "SELECT COUNT( * ) FROM `cd` `me` JOIN `artist` `artist` ON ( `artist`.`artistid` = `me`.`artist` ) WHERE ( `artist`.`name` = ? AND `me`.`year` = ? )", ["'Caterwauler McCrae'", "'2001'"], 'got correct SQL for count query with quoting' ); @@ -74,10 +72,8 @@ $rs = $schema->resultset('CD')->search( { join => 'artist' }); eval { $rs->count }; is_same_sql_bind( - $sql, - \@bind, - "SELECT COUNT( * ) FROM (SELECT [me].[cdid] FROM [cd] [me] JOIN [artist] [artist] ON [artist].[artistid] = [me].[artist] WHERE ( ( [artist].[name] = ? AND [me].[year] = ? ) ) GROUP BY [me].[cdid]) [count_subq]", - ["'Caterwauler McCrae'", "'2001'"], + $sql, \@bind, + "SELECT COUNT( * ) FROM [cd] [me] JOIN [artist] [artist] ON ( [artist].[artistid] = [me].[artist] ) WHERE ( [artist].[name] = ? AND [me].[year] = ? )", ["'Caterwauler McCrae'", "'2001'"], 'got correct SQL for count query with bracket quoting' );