Bug 36822: (follow-up) Catch MySQL 8 failure in update
We add a CAST to the fetch of 0000-00-00 dates in the database. This prevents an error in MySQL 8.0 throws htat aborts the update. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
1da78e8124
commit
36a387db22
|
|
@ -12,17 +12,15 @@ return {
|
|||
q{
|
||||
SELECT borrowernumber
|
||||
FROM borrowers
|
||||
WHERE updated_on = '0000-00-00 00:00:00'
|
||||
WHERE CAST(updated_on AS CHAR(19)) = '0000-00-00 00:00:00'
|
||||
}
|
||||
);
|
||||
$sth->execute;
|
||||
my $results = $sth->fetchall_arrayref( {} );
|
||||
|
||||
if (@$results) {
|
||||
sanitize_zero_date( 'borrowers', 'updated_on' );
|
||||
say_info( $out, "The following borrowers' updated_on has been sanitized: "
|
||||
. join( ', ', map { $_->{borrowernumber} } @$results ) );
|
||||
}
|
||||
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue