Lines 362-367
sub TO_JSON {
Link Here
|
362 |
# is ported to whatever distro we support by that time |
362 |
# is ported to whatever distro we support by that time |
363 |
$unblessed->{$col} += 0; |
363 |
$unblessed->{$col} += 0; |
364 |
} |
364 |
} |
|
|
365 |
elsif ( _decimal_column_type( $columns_info->{$col}->{data_type} ) |
366 |
and looks_like_number( $unblessed->{$col} ) |
367 |
) { |
368 |
|
369 |
# TODO: Remove once the solution for |
370 |
# https://rt.cpan.org/Ticket/Display.html?id=119904 |
371 |
# is ported to whatever distro we support by that time |
372 |
$unblessed->{$col} += 0.00; |
373 |
} |
365 |
elsif ( _datetime_column_type( $columns_info->{$col}->{data_type} ) ) { |
374 |
elsif ( _datetime_column_type( $columns_info->{$col}->{data_type} ) ) { |
366 |
eval { |
375 |
eval { |
367 |
return unless $unblessed->{$col}; |
376 |
return unless $unblessed->{$col}; |
Lines 410-421
sub _numeric_column_type {
Link Here
|
410 |
'mediumint', |
419 |
'mediumint', |
411 |
'smallint', |
420 |
'smallint', |
412 |
'tinyint', |
421 |
'tinyint', |
|
|
422 |
); |
423 |
|
424 |
return ( grep { $column_type eq $_ } @numeric_types) ? 1 : 0; |
425 |
} |
426 |
|
427 |
sub _decimal_column_type { |
428 |
# TODO: Remove once the solution for |
429 |
# https://rt.cpan.org/Ticket/Display.html?id=119904 |
430 |
# is ported to whatever distro we support by that time |
431 |
my ($column_type) = @_; |
432 |
|
433 |
my @decimal_types = ( |
413 |
'decimal', |
434 |
'decimal', |
414 |
'double precision', |
435 |
'double precision', |
415 |
'float' |
436 |
'float' |
416 |
); |
437 |
); |
417 |
|
438 |
|
418 |
return ( grep { $column_type eq $_ } @numeric_types) ? 1 : 0; |
439 |
return ( grep { $column_type eq $_ } @decimal_types) ? 1 : 0; |
419 |
} |
440 |
} |
420 |
|
441 |
|
421 |
=head3 prefetch_whitelist |
442 |
=head3 prefetch_whitelist |
422 |
- |
|
|