X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fresultset%2Fbind_attr.t;h=af970204d8d127772b74c6c643bce9aeaa8b5df3;hb=8d1fb3e2db62af871fa19e9d632c317021a356a5;hp=e3fccc98745d8c62aa937733d3ed5adff61a889a;hpb=0e773352a9c6c034dfb2526b8d68bf6ac1e2323b;p=dbsrgits%2FDBIx-Class.git diff --git a/t/resultset/bind_attr.t b/t/resultset/bind_attr.t index e3fccc9..af97020 100644 --- a/t/resultset/bind_attr.t +++ b/t/resultset/bind_attr.t @@ -49,7 +49,7 @@ TODO: { $new_source->source_name('Complex'); $new_source->name(\<<''); - ( SELECT a.*, cd.cdid AS cdid, cd.title AS title, cd.year AS year + ( SELECT a.*, cd.cdid AS cdid, cd.title AS title, cd.year AS year FROM artist a JOIN cd ON cd.artist = a.artistid WHERE cd.year = ?) @@ -66,12 +66,12 @@ TODO: { ->search({ 'artistid' => 1 }); is ( $rs->count, 1, '...cookbook (bind first) + chained search' ); - $rs = $schema->resultset('Complex')->search({}, { bind => [ 1999 ] })->search({}, { where => \"title LIKE ?", bind => [ 'Spoon%' ] }); + $rs = $schema->resultset('Complex')->search({}, { bind => [ [{ sqlt_datatype => 'datetime'} => 1999 ] ] })->search({}, { where => \"title LIKE ?", bind => [ 'Spoon%' ] }); is_same_sql_bind( $rs->as_query, "(SELECT me.artistid, me.name, me.rank, me.charfield FROM (SELECT a.*, cd.cdid AS cdid, cd.title AS title, cd.year AS year FROM artist a JOIN cd ON cd.artist = a.artistid WHERE cd.year = ?) me WHERE title LIKE ?)", [ - [ {} => '1999' ], + [ { sqlt_datatype => 'datetime' } => '1999' ], [ {} => 'Spoon%' ] ], 'got correct SQL' @@ -100,7 +100,7 @@ TODO: { $rs->as_query, "(SELECT me.artistid, me.name, me.rank, me.charfield FROM (SELECT a.*, cd.cdid AS cdid, cd.title AS title, cd.year AS year FROM artist a JOIN cd ON cd.artist = a.artistid WHERE cd.year = ?) me WHERE title LIKE ?)", [ - [ {} => '1999' ], + [ {} => '1999' ], [ {} => 'Spoon%' ] ], 'got correct SQL (cookbook arbitrary SQL, in separate file)'