diff --git a/databases/sqlports/Makefile b/databases/sqlports/Makefile index 92b98e2bdff..41f4bc87e88 100644 --- a/databases/sqlports/Makefile +++ b/databases/sqlports/Makefile @@ -1,7 +1,7 @@ -# $OpenBSD: Makefile,v 1.17 2009/08/15 12:43:58 espie Exp $ +# $OpenBSD: Makefile,v 1.18 2009/08/25 09:15:43 espie Exp $ CATEGORIES = databases -V = 1.5 +V = 1.6 DISTNAME = sqlports-$V DISTFILES = COMMENT = sqlite database of ports diff --git a/databases/sqlports/files/mksqlitedb b/databases/sqlports/files/mksqlitedb index 1b98cbd6ab1..4944b60cd52 100644 --- a/databases/sqlports/files/mksqlitedb +++ b/databases/sqlports/files/mksqlitedb @@ -1,5 +1,5 @@ #! /usr/bin/perl -# $OpenBSD: mksqlitedb,v 1.16 2009/08/16 03:24:28 espie Exp $ +# $OpenBSD: mksqlitedb,v 1.17 2009/08/25 09:15:43 espie Exp $ # # Copyright (c) 2006 Marc Espie # @@ -142,7 +142,7 @@ sub render sub render_join { my ($self, $table) = @_; - return " JOIN Paths ".$self->{table}." ON ".$self->table.".ID=$table.".$self->name; + return "JOIN Paths ".$self->{table}." ON ".$self->table.".ID=$table.".$self->name; } package ValueColumn; @@ -179,7 +179,7 @@ sub render_join { my ($self, $table) = @_; if (defined $self->k) { - return " JOIN ".$self->k." ".$self->table." ON ".$self->table.".KEYREF=$table.".$self->name; + return "JOIN ".$self->k." ".$self->table." ON ".$self->table.".KEYREF=$table.".$self->name; } } @@ -192,6 +192,12 @@ sub render return $inserter->optvalue($self->k, $self->name); } +sub render_join +{ + my ($self, $table) = @_; + return "LEFT ".$self->SUPER::render_join($table); +} + package AbstractInserter; # this is the object to use to put stuff into the db... sub new @@ -376,7 +382,7 @@ sub create_view my $name = "_$table"; my @l = map {$_->render_view($table) } @columns; my @j = map {$_->render_join($table)} @columns; - my $v = "CREATE VIEW $name AS SELECT ".join(", ", @l). " FROM ".$table.join('', @j); + my $v = "CREATE VIEW $name AS SELECT ".join(", ", @l). " FROM ".$table.join(' ', @j); $self->db->do("DROP VIEW IF EXISTS $name"); print "$v\n" if $main::opt_v; $self->db->do($v);