Bug 37902: Do not convert a date if it has like markers

If we pass a datetime parameter we are adding "like" operator and % at
the beginning and ending of the attribute value.
For instance:
  attributes=2024-09-16 10:11:12
  attributes:{ like => '%2024-09-16 10:11:12%' }

We do not want to reach the fixup code and raise an exception.

However I don't think we should add the like for datetime attributes
actually. But can we modify this behaviour now?

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2024-09-16 10:43:13 +02:00 committed by Katrin Fischer
parent b63b8e19b3
commit 95e9ae46bd
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 1 additions and 1 deletions

View File

@ -851,7 +851,7 @@ sub _recursive_fixup {
# Handle booleans gracefully
$value = ($value) ? 1 : 0;
} elsif ( _date_or_datetime_column_type( $column_info->{data_type} ) ) {
if ( defined $value ) {
if ( defined $value && $value !~ m{^%|%$} ) {
try {
my $dtf = $self->_result->result_source->storage->datetime_parser;
if ( $column_info->{data_type} eq 'date' ) {