X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F71mysql.t;h=4aa48bdfdc87f5742c926d2d54671c10f29f220a;hb=748ab0dca771812bd2c733366fe91c561cd4afbf;hp=a326dda7c7d841a3cfe2381d906bae64ec8f287d;hpb=3ff5b74063e6bb299d8a7443df0e864254ea44b9;p=dbsrgits%2FDBIx-Class.git diff --git a/t/71mysql.t b/t/71mysql.t index a326dda..4aa48bd 100644 --- a/t/71mysql.t +++ b/t/71mysql.t @@ -13,7 +13,7 @@ my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MYSQL_${_}" } qw/DSN USER PASS/}; plan skip_all => 'Set $ENV{DBICTEST_MYSQL_DSN}, _USER and _PASS to run this test' unless ($dsn && $user); -plan tests => 5; +plan tests => 10; my $schema = DBICTest::Schema->connect($dsn, $user, $pass); @@ -85,6 +85,34 @@ SKIP: { is_deeply($type_info, $test_type_info, 'columns_info_for - column data types'); } +## Can we properly deal with the null search problem? + +use Data::Dump qw/dump/; + +NULLINSEARCH: { + + ok my $artist1_rs = $schema->resultset('Artist')->search({artistid=>6666}) + => 'Created an artist resultset of 6666'; + + is $artist1_rs->count, 0 + => 'Got no returned rows'; + + ok my $artist2_rs = $schema->resultset('Artist')->search({artistid=>undef}) + => 'Created an artist resultset of undef'; + + TODO: { + $TODO = "need to fix the row count =1 when select * from table where pk IS NULL problem"; + is $artist2_rs->count, 0 + => 'got no rows'; + } + + my $artist = $artist2_rs->single; + + is $artist => undef + => 'Nothing Found!'; +} + + # clean up our mess END { $dbh->do("DROP TABLE artist") if $dbh;