From: mkanat%bugzilla.org <> Date: Mon, 30 Jun 2008 02:36:48 +0000 (+0000) Subject: Bug 421064: [Oracle] whine.pl crashes and doesn't work (fix sql_interval and DB:... X-Git-Tag: bugzilla-3.2rc1~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43fd493e859de94695624047adb71b06e0bd9917;p=thirdparty%2Fbugzilla.git Bug 421064: [Oracle] whine.pl crashes and doesn't work (fix sql_interval and DB::Oracle::st inheritance) Patch By Xiaoou Wu r=mkanat, a=mkanat --- diff --git a/Bugzilla/DB/Oracle.pm b/Bugzilla/DB/Oracle.pm index 9f759785e2..255ece03b4 100644 --- a/Bugzilla/DB/Oracle.pm +++ b/Bugzilla/DB/Oracle.pm @@ -157,8 +157,11 @@ sub sql_date_format { sub sql_interval { my ($self, $interval, $units) = @_; - - return "INTERVAL " . $self->quote($interval) . " $units"; + if ($units =~ /YEAR|MONTH/i) { + return "NUMTOYMINTERVAL($interval,'$units')"; + } else{ + return "NUMTODSINTERVAL($interval,'$units')"; + } } sub sql_position { @@ -476,7 +479,7 @@ sub bz_setup_database { } package Bugzilla::DB::Oracle::st; -use base qw(DBD::Oracle::st); +use base qw(DBI::st); sub fetchrow_arrayref { my $self = shift; @@ -531,5 +534,13 @@ sub fetchall_hashref { } return $ref; } - + +sub fetch { + my $self = shift; + my $row = $self->SUPER::fetch(@_); + if ($row) { + Bugzilla::DB::Oracle::_fix_arrayref($row); + } + return $row; +} 1;