$dbh->do("DROP TABLE IF EXISTS artist;");
-$dbh->do("CREATE TABLE artist (artistid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), charfield CHAR(10));");
+$dbh->do("CREATE TABLE artist (artistid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), rank INTEGER NOT NULL DEFAULT '13', charfield CHAR(10));");
#'dbi:mysql:host=localhost;database=dbic_test', 'dbic_test', '');
'name' => {
'data_type' => 'VARCHAR',
'is_nullable' => 1,
- 'size' => 255,
+ 'size' => 100,
'default_value' => undef,
},
+ 'rank' => {
+ 'data_type' => 'INT',
+ 'is_nullable' => 0,
+ 'size' => 11,
+ 'default_value' => 13,
+ },
'charfield' => {
'data_type' => 'CHAR',
'is_nullable' => 1,
}
## Can we properly deal with the null search problem?
-
-use Data::Dump qw/dump/;
+##
+## Only way is to do a SET SQL_AUTO_IS_NULL = 0; on connect
+## But I'm not sure if we should do this or not (Ash, 2008/06/03)
NULLINSEARCH: {
ok my $artist2_rs = $schema->resultset('Artist')->search({artistid=>undef})
=> 'Created an artist resultset of undef';
- is $artist2_rs->count, 0
- => 'got no rows';
-
+ TODO: {
+ local $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!';
-
- warn dump $artist->get_columns if $artist;
}