https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31143 --- Comment #90 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Aditya from comment #89)
I see nobody's talking about the error when the below line gets executed
my $invalid_dates = $rs->search( { $column => '0000-00-00' } )->count;
This is throwing the error as below: DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Incorrect TIMESTAMP value: '0000-00-00' at ./fix_invalid_dates.pl line 65
I have made a quick fix for this. Please include to the next minor update (after the line:- my $schema = Koha::Database->new->schema;) if the similar is not implemented.
# Disable strict mode for this session $schema->storage->dbh_do( sub { my ($storage, $dbh) = @_; $dbh->do("SET SESSION sql_mode = ''"); } );
Hi Aditya, since this is already in a release, we need a new bug number for the fix. Can you please file one and add a test plan? It might depend on DBMS version, so that might be why we didn't see that in testing. I remember we had a similar error. Please also add your DBMS and the version to the report! -- You are receiving this mail because: You are watching all bug changes.