From: Peter Rabbitson Date: Thu, 26 Jan 2012 11:11:15 +0000 (+0100) Subject: Assert that complex bindtytyping passage works for the search() bind attribute X-Git-Tag: v0.08197~125 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ea20ead00a56006b5dd6353bdd22c1eed775f864;p=dbsrgits%2FDBIx-Class.git Assert that complex bindtytyping passage works for the search() bind attribute --- diff --git a/t/resultset/bind_attr.t b/t/resultset/bind_attr.t index 62f4791..af97020 100644 --- a/t/resultset/bind_attr.t +++ b/t/resultset/bind_attr.t @@ -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'