X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F747mssql_ado.t;h=fd847bd7c8a24f99cddf2d5abb551c4de3910996;hb=64ae166780d0cb2b9577e506da9b9b240c146d20;hp=d86e4e1e3b181fee8912c336652b84f9dd3a876b;hpb=e38348dda1c10605136ac17a3d17b6bf3d3e724c;p=dbsrgits%2FDBIx-Class.git diff --git a/t/747mssql_ado.t b/t/747mssql_ado.t index d86e4e1..fd847bd 100644 --- a/t/747mssql_ado.t +++ b/t/747mssql_ado.t @@ -11,8 +11,6 @@ my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MSSQL_ADO_${_}" } qw/DSN USER PAS plan skip_all => 'Set $ENV{DBICTEST_MSSQL_ADO_DSN}, _USER and _PASS to run this test' unless ($dsn && $user); -plan tests => 11; - my $schema = DBICTest::Schema->connect($dsn, $user, $pass); $schema->storage->ensure_connected; @@ -39,18 +37,16 @@ ok($new->artistid > 0, 'Auto-PK worked'); my $found = $schema->resultset('Artist')->search({ name => 'foo' })->first; is $found->artistid, $new->artistid, 'search works'; -# try a select with a big column list -TODO: { - local $TODO = 'select with a big column list does not work'; - - $found = $schema->resultset('Artist')->search({ name => 'foo' }, { - select => ['name', map "'foo' foo_$_", 0..50] - })->first; - is $found->artistid, $new->artistid, 'select with big column list'; -} +# test large column list in select +$found = $schema->resultset('Artist')->search({ name => 'foo' }, { + select => ['artistid', 'name', map "'foo' foo_$_", 0..50], + as => ['artistid', 'name', map "foo_$_", 0..50], +})->first; +is $found->artistid, $new->artistid, 'select with big column list'; +is $found->get_column('foo_50'), 'foo', 'last item in big column list'; # create a few more rows -for (1..6) { +for (1..12) { $schema->resultset('Artist')->create({ name => 'Artist ' . $_ }); } @@ -62,6 +58,17 @@ while ($rs1->next) { ok eval { $rs2->next }, 'multiple active cursors'; } +# test bug where ADO blows up if the first bindparam is shorter than the second +is $schema->resultset('Artist')->search({ artistid => 2 })->first->name, + 'Artist 1', + 'short bindparam'; + +is $schema->resultset('Artist')->search({ artistid => 13 })->first->name, + 'Artist 12', + 'longer bindparam'; + +done_testing; + # clean up our mess END { if (my $dbh = eval { $schema->storage->_dbh }) {