X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F93autocast.t;h=0a146a7ee037c9e30a1c31a753ccd08be081042f;hb=a85b7ebe9762ca64a08468f6c8f27a0ae583d38c;hp=a8375be87fb791780dc8b7828f5d975d777be748;hpb=ce012195f14f1e186f8c91cd0cbc2a11bc9088d7;p=dbsrgits%2FDBIx-Class.git diff --git a/t/93autocast.t b/t/93autocast.t index a8375be..0a146a7 100644 --- a/t/93autocast.t +++ b/t/93autocast.t @@ -20,7 +20,7 @@ use DBIC::SqlMakerTest; int => undef, # no conversion }; - sub _map_data_type { + sub _native_data_type { return $type_map->{$_[1]}; } } @@ -33,9 +33,15 @@ my $rs = $schema->resultset ('CD')->search ({ 'tracks.last_updated_at' => { '!=', undef }, 'tracks.last_updated_on' => { '<', 2009 }, 'tracks.position' => 4, + 'tracks.single_track' => \[ '= ?', [ single_track => [1, 2, 3 ] ] ], }, { join => 'tracks' }); -my $bind = [ [ cdid => 5 ], [ 'tracks.last_updated_on' => 2009 ], [ 'tracks.position' => 4 ] ]; +my $bind = [ + [ cdid => 5 ], + [ 'tracks.last_updated_on' => 2009 ], + [ 'tracks.position' => 4 ], + [ 'single_track' => [ 1, 2, 3] ], +]; is_same_sql_bind ( $rs->as_query, @@ -48,6 +54,7 @@ is_same_sql_bind ( AND tracks.last_updated_at IS NOT NULL AND tracks.last_updated_on < ? AND tracks.position = ? + AND tracks.single_track = ? )', $bind, 'expected sql with casting off', @@ -64,8 +71,9 @@ is_same_sql_bind ( WHERE cdid > CAST(? AS INT) AND tracks.last_updated_at IS NOT NULL - AND tracks.last_updated_on < CAST (? AS yyy) + AND tracks.last_updated_on < CAST (? AS DateTime) AND tracks.position = ? + AND tracks.single_track = CAST(? AS INT) )', $bind, 'expected sql with casting on',