projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
AccTransCorrections: single-dbh
[kivitendo-erp.git]
/
sql
/
Pg-upgrade2
/
contacts_convert_cp_birthday_to_date.pl
diff --git
a/sql/Pg-upgrade2/contacts_convert_cp_birthday_to_date.pl
b/sql/Pg-upgrade2/contacts_convert_cp_birthday_to_date.pl
index
bb45209
..
ab4a017
100644
(file)
--- a/
sql/Pg-upgrade2/contacts_convert_cp_birthday_to_date.pl
+++ b/
sql/Pg-upgrade2/contacts_convert_cp_birthday_to_date.pl
@@
-11,10
+11,10
@@
use parent qw(SL::DBUpgrade2::Base);
sub convert_to_date {
my ($self, $str) = @_;
sub convert_to_date {
my ($self, $str) = @_;
- return '' if !$str
;
+ return '' if !$str
|| ($str =~ m/00.*00.*00.*00/); # 0000-00-00 may be present in old databases.
my $sth = $self->dbh->prepare('SELECT ?::date AS date') or return undef;
my $sth = $self->dbh->prepare('SELECT ?::date AS date') or return undef;
- $sth->execute($str) or return undef;
+ $sth->execute($str)
or return undef;
return $sth->fetchrow_hashref->{date};
}
return $sth->fetchrow_hashref->{date};
}