X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fsearch%2Fsubquery.t;h=8c3fcf777944254e54f367e5425a69630e79300b;hb=247c80fb31931d623a00d74e797aa37284f50768;hp=382a46d4be0ab492e86e3d8d0414675d39f1e6fb;hpb=aca094b4dff8c1b930a52a56853e06b65b508032;p=dbsrgits%2FDBIx-Class.git diff --git a/t/search/subquery.t b/t/search/subquery.t index 382a46d..8c3fcf7 100644 --- a/t/search/subquery.t +++ b/t/search/subquery.t @@ -4,9 +4,9 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; +use DBIx::Class::_Util 'sigwarn_silencer'; my $ROWS = DBIx::Class::SQLMaker::LimitDialects->__rows_bindtype; @@ -46,7 +46,7 @@ my @tests = ( ], }, sqlbind => \[ - "( SELECT (SELECT id FROM cd me LIMIT ?) FROM artist me )", + "( SELECT (SELECT me.id FROM cd me LIMIT ?) FROM artist me )", [ $ROWS => 1 ], ], }, @@ -59,7 +59,7 @@ my @tests = ( ], }, sqlbind => \[ - "( SELECT me.artistid, me.name, me.rank, me.charfield, (SELECT id FROM cd me LIMIT ?) FROM artist me )", + "( SELECT me.artistid, me.name, me.rank, me.charfield, (SELECT me.id FROM cd me LIMIT ?) FROM artist me )", [ $ROWS => 1 ], ], }, @@ -165,6 +165,8 @@ my @tests = ( for my $i (0 .. $#tests) { my $t = $tests[$i]; for my $p (1, 2) { # repeat everything twice, make sure we do not clobber search arguments + local $SIG{__WARN__} = sigwarn_silencer( qr/\Q{from} structures with conditions not conforming to the SQL::Abstract syntax are deprecated/ ); + is_same_sql_bind ( $t->{rs}->search ($t->{search}, $t->{attrs})->as_query, $t->{sqlbind},