From 8d7d1d2595c2c3475ec27d07d8544e345dab5851 Mon Sep 17 00:00:00 2001 From: Arne Georg Gleditsch Date: Fri, 6 Mar 2009 21:13:18 +0100 Subject: Added more language modules, threw things about a bit. --- lib/LXRng/Index/DBI.pm | 16 ++++++++++++++++ lib/LXRng/Index/Pg.pm | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'lib/LXRng/Index') diff --git a/lib/LXRng/Index/DBI.pm b/lib/LXRng/Index/DBI.pm index 763f534..55e215d 100644 --- a/lib/LXRng/Index/DBI.pm +++ b/lib/LXRng/Index/DBI.pm @@ -520,6 +520,22 @@ sub get_identifier_info { \%reflines); } +sub set_rfile_charset { + my ($self, $rfile_id, $charset) = @_; + + my $dbh = $self->dbh; + my $pre = $self->prefix; + my $sth = $$self{'sth'}{'set_rfile_charset'} ||= + $dbh->prepare(qq{ + update ${pre}revisions + set body_charset = (select id from ${pre}charsets + where name = ?) + where id = ?}); + + return $sth->execute($charset, $rfile_id); +} + + sub get_rfile_timestamp { my ($self, $rfile_id) = @_; diff --git a/lib/LXRng/Index/Pg.pm b/lib/LXRng/Index/Pg.pm index 3654a72..7387abc 100644 --- a/lib/LXRng/Index/Pg.pm +++ b/lib/LXRng/Index/Pg.pm @@ -67,7 +67,7 @@ sub init_db { or die($dbh->errstr); $dbh->do(qq{insert into ${pre}charsets(name) values ('utf-8')}) or die($dbh->errstr); - $dbh->do(qq{insert into ${pre}charsets(name) values ('iso8859-1')}) + $dbh->do(qq{insert into ${pre}charsets(name) values ('iso-8859-1')}) or die($dbh->errstr); $dbh->do(qq{ -- cgit v1.2.3