[Koha-bugs] [Bug 25040] New: Problematic current_timestamp syntax generated by DBIx::Class::Schema::Loader
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Thu Apr 2 11:17:53 CEST 2020
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25040
Bug ID: 25040
Summary: Problematic current_timestamp syntax generated by
DBIx::Class::Schema::Loader
Change sponsored?: ---
Product: Koha
Version: unspecified
Hardware: All
OS: All
Status: ASSIGNED
Severity: major
Priority: P5 - low
Component: Architecture, internals, and plumbing
Assignee: jonathan.druart at bugs.koha-community.org
Reporter: jonathan.druart at bugs.koha-community.org
QA Contact: testopia at bugs.koha-community.org
Caught by the changes made to Koha::Object->store by bug 23463 (especially
9c383aa286fee5a29c6f084873f2eb6644bad64f)
154 elsif ( not defined $self->$col
155 && $columns_info->{$col}->{datetime_undef_if_invalid} )
156 {
157 # timestamp
158 $self->_result()->set_column($col =>
$columns_info->{$col}->{default_value});
159 }
If a timestamp not null column does not have a value when store is called, the
default value is set.
The expected default value is \"current_timestamp"(`git grep current_timestamp
Koha/Schema/Result`) but for some reasons DBIx::Class::Schema::Loader sometimes
generates "current_timestamp()" (certainly depending on versions of
DBIx::Class::Schema::Loader and DBMS MySQL vs MariaDB)
It ends up with an error on insert/update:
DBD::mysql::st execute failed: Incorrect datetime value: 'current_timestamp()'
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list