my $col_info = $self->_resolve_column_info($ident, [keys %$fields]);
for my $col (keys %$fields) {
- if ($col_info->{$col}{data_type} eq 'money') {
+ if ($col_info->{$col}{data_type} =~ /^money\z/i) {
my $val = $fields->{$col};
-
$fields->{$col} = \['CAST(? AS MONEY)', [ $col => $val ]];
}
}
plan skip_all => 'Set $ENV{DBICTEST_MSSQL_ODBC_DSN}, _USER and _PASS to run this test'
unless ($dsn && $user);
-plan tests => 31;
+plan tests => 33;
my $schema = DBICTest::Schema->connect($dsn, $user, $pass);
is $rs->find($row->id)->amount, '200.00', 'updated money value round-trip';
+lives_ok {
+ $row->update({ amount => undef });
+} 'updated a money value to NULL';
+
+is $rs->find($row->id)->amount, undef,'updated money value to NULL round-trip';
+
$schema->storage->dbh_do (sub {
my ($storage, $dbh) = @_;
eval { $dbh->do("DROP TABLE Owners") };