[Lxr-commits] CVS: lxr/lib/LXR/Index Mysql.pm, 1.35, 1.36 Oracle.pm, 1.25, 1.26 Postgres.pm, 1.37,
Brought to you by:
ajlittoz
From: Andre-Littoz <ajl...@us...> - 2013-09-21 12:54:56
|
Update of /cvsroot/lxr/lxr/lib/LXR/Index In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4903/lib/LXR/Index Modified Files: Mysql.pm Oracle.pm Postgres.pm SQLite.pm Log Message: Files.pm, Index.pm, Lang.pm, Markup.pm, SimpleParse.pm, Files/*, Index/*, Lang/*: better comments, source code improvement & optilmisation Index: Mysql.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Mysql.pm,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- Mysql.pm 10 Sep 2012 17:22:21 -0000 1.35 +++ Mysql.pm 21 Sep 2013 12:54:52 -0000 1.36 @@ -27,7 +27,7 @@ use DBI; use LXR::Common; -our @ISA = ("LXR::Index"); +our @ISA = ('LXR::Index'); sub new { my ($self, $dbname, $prefix) = @_; @@ -42,27 +42,27 @@ # a tiny improvement may show up with explicit commit (the # difference on the medium-sized test cases is difficult to # appreciate since it is within the measurement error). - or fatal "Can't open connection to database: $DBI::errstr\n"; + or die "Can't open connection to database: $DBI::errstr\n"; $self->{'files_insert'} = $self->{dbh}->prepare ( "insert into ${prefix}files" - . " (filename, revision, fileid)" - . " values (?, ?, NULL)" + . ' (filename, revision, fileid)' + . ' values (?, ?, NULL)' ); $self->{'symbols_insert'} = $self->{dbh}->prepare ( "insert into ${prefix}symbols" - . " (symname, symid, symcount)" - . " values ( ?, NULL, 0)" + . ' (symname, symid, symcount)' + . ' values ( ?, NULL, 0)' ); $self->{'langtypes_insert'} = $self->{dbh}->prepare ( "insert into ${prefix}langtypes" - . " (typeid, langid, declaration)" - . " values (NULL, ?, ?)" + . ' (typeid, langid, declaration)' + . ' values (NULL, ?, ?)' ); $self->{'purge_all'} = $self->{dbh}->prepare Index: Oracle.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Oracle.pm,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- Oracle.pm 10 Sep 2012 17:22:21 -0000 1.25 +++ Oracle.pm 21 Sep 2013 12:54:52 -0000 1.26 @@ -39,7 +39,7 @@ use DBI; use LXR::Common; -our @ISA = ("LXR::Index"); +our @ISA = ('LXR::Index'); sub new { my ($self, $dbname, $prefix) = @_; @@ -47,28 +47,28 @@ $self = bless({}, $self); $self->{dbh} = - DBI->connect($dbname, $config->{dbuser}, $config->{dbpass}, + DBI->connect($dbname, $config->{'dbuser'}, $config->{'dbpass'}, { RaiseError => 1, AutoCommit => 1 }) - or fatal "Can't open connection to database: $DBI::errstr\n"; + or die "Can't open connection to database: $DBI::errstr\n"; $self->{'files_insert'} = $self->{dbh}->prepare ( "insert into ${prefix}files" - . " (filename, revision, fileid)" + . ' (filename, revision, fileid)' . " values (?, ?, ${prefix}filenum.nextval)" ); $self->{'symbols_insert'} = $self->{dbh}->prepare ( "insert into ${prefix}symbols" - . " (symname, symid) values" + . ' (symname, symid) values' . " ( ?, ${prefix}symnum.nextval)" ); $self->{'langtypes_insert'} = $self->{dbh}->prepare ( "insert into ${prefix}langtypes" - . " (typeid, langid, declaration)" + . ' (typeid, langid, declaration)' . " values (${prefix}typenum.nextval, ?, ?)" ); @@ -78,8 +78,4 @@ return $self; } -# -# LXR::Index API Implementation -# - 1; Index: Postgres.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Postgres.pm,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- Postgres.pm 14 Nov 2012 11:27:31 -0000 1.37 +++ Postgres.pm 21 Sep 2013 12:54:52 -0000 1.38 @@ -27,7 +27,7 @@ use DBI; use LXR::Common; -our @ISA = ("LXR::Index"); +our @ISA = ('LXR::Index'); sub new { my ($self, $dbname, $prefix) = @_; @@ -46,7 +46,7 @@ # eventually comment out begin_work() call. , {'AutoCommit' => 0} ) - or fatal "Can't open connection to database: $DBI::errstr\n"; + or die "Can't open connection to database: $DBI::errstr\n"; # Without the following instruction (theoretically meaningless # in auto commit mode), indexing time is multiplied by 10 @@ -58,8 +58,8 @@ $self->{'files_insert'} = $self->{dbh}->prepare ( "insert into ${prefix}files" - . " (filename, revision, fileid)" - . " values (?, ?, ?)" + . ' (filename, revision, fileid)' + . ' values (?, ?, ?)' ); $self->{'symnum_nextval'} = @@ -67,8 +67,8 @@ $self->{'symbols_insert'} = $self->{dbh}->prepare ( "insert into ${prefix}symbols" - . " (symname, symid, symcount)" - . " values (?, ?, 0)" + . ' (symname, symid, symcount)' + . ' values (?, ?, 0)' ); $self->{'typeid_nextval'} = @@ -77,27 +77,27 @@ $self->{'langtypes_insert'} = $self->{dbh}->prepare ( "insert into ${prefix}langtypes" - . " (typeid, langid, declaration)" - . " values (?, ?, ?)" + . ' (typeid, langid, declaration)' + . ' values (?, ?, ?)' ); $self->{'delete_definitions'} = $self->{dbh}->prepare ( "delete from ${prefix}definitions as d" . " using ${prefix}status t, ${prefix}releases r" - . " where r.releaseid = ?" - . " and t.fileid = r.fileid" - . " and t.relcount = 1" - . " and d.fileid = r.fileid" + . ' where r.releaseid = ?' + . ' and t.fileid = r.fileid' + . ' and t.relcount = 1' + . ' and d.fileid = r.fileid' ); $self->{'delete_usages'} = $self->{dbh}->prepare ( "delete from ${prefix}usages as u" . " using ${prefix}status t, ${prefix}releases r" - . " where r.releaseid = ?" - . " and t.fileid = r.fileid" - . " and t.relcount = 1" - . " and u.fileid = r.fileid" + . ' where r.releaseid = ?' + . ' and t.fileid = r.fileid' + . ' and t.relcount = 1' + . ' and u.fileid = r.fileid' ); $self->{'reset_filenum'} = $self->{dbh}->prepare Index: SQLite.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/SQLite.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SQLite.pm 14 Nov 2012 11:27:31 -0000 1.3 +++ SQLite.pm 21 Sep 2013 12:54:52 -0000 1.4 @@ -27,7 +27,7 @@ use DBI; use LXR::Common; -our @ISA = ("LXR::Index"); +our @ISA = ('LXR::Index'); our ($filenum, $symnum, $typenum); our ($fileini, $symini, $typeini); @@ -52,7 +52,7 @@ $self = bless({}, $self); $self->{dbh} = DBI->connect($dbname) - or fatal "Can't open connection to database: $DBI::errstr\n"; + or die "Can't open connection to database: $DBI::errstr\n"; # SQLite is forced into explicit commit mode as the medium-sized # test cases have shown a 40-times (!) performance improvement # over auto commit. @@ -64,15 +64,15 @@ $self->{'symbols_insert'} = $self->{dbh}->prepare ( "insert into ${prefix}symbols" - . " (symname, symid, symcount) values" - . " (?, ?, 0)" + . ' (symname, symid, symcount) values' + . ' (?, ?, 0)' ); $self->{'langtypes_insert'} = $self->{dbh}->prepare ( "insert into ${prefix}langtypes" - . " (typeid, langid, declaration)" - . " values (?, ?, ?)" + . ' (typeid, langid, declaration)' + . ' values (?, ?, ?)' ); $self->{'purge_all'} = undef; # Prevent parsing the common one @@ -121,21 +121,21 @@ $self->{'filenum_newval'} = $self->{dbh}->prepare ( "update ${prefix}filenum" - . " set fid = ?" - . " where rcd = 0" + . ' set fid = ?' + . ' where rcd = 0' ); $self->{'symnum_newval'} = $self->{dbh}->prepare ( "update ${prefix}symnum" - . " set sid = ?" - . " where rcd = 0" + . ' set sid = ?' + . ' where rcd = 0' ); $self->{'typenum_newval'} = $self->{dbh}->prepare ( "update ${prefix}typenum" - . " set tid = ?" - . " where rcd = 0" + . ' set tid = ?' + . ' where rcd = 0' ); return $self; |