# Handle not null and default values for integers and dates
foreach my $col ( keys %{$columns_info} ) {
# Integers
- if ( _numeric_column_type( $columns_info->{$col}->{data_type} ) ) {
+ if ( _numeric_column_type( $columns_info->{$col}->{data_type} )
+ or _decimal_column_type( $columns_info->{$col}->{data_type} )
+ ) {
# Has been passed but not a number, usually an empty string
my $value = $self->_result()->get_column($col);
if ( defined $value and not looks_like_number( $value ) ) {
) {
# TODO: Remove once the solution for
- # https://rt.cpan.org/Ticket/Display.html?id=119904
+ # https://github.com/perl5-dbi/DBD-mysql/issues/212
# is ported to whatever distro we support by that time
+ # or we move to DBD::MariaDB
$unblessed->{$col} += 0;
}
elsif ( _decimal_column_type( $columns_info->{$col}->{data_type} )
) {
# TODO: Remove once the solution for
- # https://rt.cpan.org/Ticket/Display.html?id=119904
+ # https://github.com/perl5-dbi/DBD-mysql/issues/212
# is ported to whatever distro we support by that time
+ # or we move to DBD::MariaDB
$unblessed->{$col} += 0.00;
}
elsif ( _datetime_column_type( $columns_info->{$col}->{data_type} ) ) {
sub _numeric_column_type {
# TODO: Remove once the solution for
- # https://rt.cpan.org/Ticket/Display.html?id=119904
+ # https://github.com/perl5-dbi/DBD-mysql/issues/212
# is ported to whatever distro we support by that time
+ # or we move to DBD::MariaDB
my ($column_type) = @_;
my @numeric_types = (
sub _decimal_column_type {
# TODO: Remove once the solution for
- # https://rt.cpan.org/Ticket/Display.html?id=119904
+ # https://github.com/perl5-dbi/DBD-mysql/issues/212
# is ported to whatever distro we support by that time
+ # or we move to DBD::MariaDB
my ($column_type) = @_;
my @decimal_types = (