X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F19quotes.t;h=c4768c8d6d91e4cfcbb7b640dc95477266e7559f;hb=054a2b140bfa31646c695e42b02987119b547eee;hp=75b4668262f25947376015084ff0ae066a3349b2;hpb=d07ee31ae6149b214e70a33888d0c3e771de2009;p=dbsrgits%2FDBIx-Class.git diff --git a/t/19quotes.t b/t/19quotes.t index 75b4668..c4768c8 100644 --- a/t/19quotes.t +++ b/t/19quotes.t @@ -24,7 +24,7 @@ my $schema = DBICTest->init_schema(); $schema->storage->sql_maker->quote_char('`'); $schema->storage->sql_maker->name_sep('.'); -my ($sql, @bind) = (''); +my ($sql, @bind); $schema->storage->debugobj(DBIC::DebugObj->new(\$sql, \@bind)); $schema->storage->debug(1); @@ -35,12 +35,9 @@ $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'"], - - 'got correct SQL for joined count query with quoting' + $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' ); my $order = 'year DESC'; @@ -62,10 +59,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' );