[Lxr-commits] CVS: lxr/lib/LXR/Index Oracle.pm,1.15,1.16
Brought to you by:
ajlittoz
From: AdrianIssott <adr...@us...> - 2009-05-09 14:07:19
|
Update of /cvsroot/lxr/lxr/lib/LXR/Index In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32029/lib/LXR/Index Modified Files: Oracle.pm Log Message: Oracle Fix for bugs 2787781 and 2787771 for Changes the interface to Oracle to match the documentation so that fileindexed returns whether the file has been indexed, not whether it needs indexing. Aligned the Oracle, Postgres and Mysql implementations of fileindexed, filereferenced, setfileindexed and setfilereferenced. Index: Oracle.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Oracle.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Oracle.pm 26 Apr 2009 09:14:37 -0000 1.15 +++ Oracle.pm 9 May 2009 14:07:13 -0000 1.16 @@ -201,15 +201,24 @@ $self->{status_get}->finish(); if (!defined($status)) { - $self->{status_insert}->execute($fileid + 0, 0); + $status = 0; } - - return $status == 0; + return $status; } sub setfileindexed { my ($self, $fileid) = @_; - $self->{status_update}->execute(1, $fileid, 0); + my ($status); + + $self->{status_get}->execute($fileid); + $status = $self->{status_get}->fetchrow_array(); + $self->{status_get}->finish(); + + if (!defined($status)) { + $self->{status_insert}->execute($fileid + 0, 1); + } else { + $self->{status_update}->execute(1, $fileid, 0); + } } sub filereferenced { @@ -220,12 +229,22 @@ $status = $self->{status_get}->fetchrow_array(); $self->{status_get}->finish(); - return $status < 2; + return defined($status) && $status == 2; } sub setfilereferenced { my ($self, $fileid) = @_; - $self->{status_update}->execute(2, $fileid, 1); + my ($status); + + $self->{status_get}->execute($fileid); + $status = $self->{status_get}->fetchrow_array(); + $self->{status_get}->finish(); + + if (!defined($status)) { + $self->{status_insert}->execute($fileid + 0, 2); + } else { + $self->{status_update}->execute(2, $fileid, 1); + } } sub symdeclarations { |