Gentoo Archives: gentoo-commits

From: "Tom Knight
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-projects commit in forums/scripts/projectSCAS/scripts: rebuildSearchindex.pl
Date: Sun, 09 Sep 2007 10:36:01
Message-Id: E1IUK2L-0000J3-2O@stork.gentoo.org
1 tomk 07/09/09 10:29:05
2
3 Modified: rebuildSearchindex.pl
4 Log:
5 Set explicit charset for updates
6
7 Revision Changes Path
8 1.18 forums/scripts/projectSCAS/scripts/rebuildSearchindex.pl
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/forums/scripts/projectSCAS/scripts/rebuildSearchindex.pl?rev=1.18&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/forums/scripts/projectSCAS/scripts/rebuildSearchindex.pl?rev=1.18&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/forums/scripts/projectSCAS/scripts/rebuildSearchindex.pl?r1=1.17&r2=1.18
13
14 Index: rebuildSearchindex.pl
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-projects/forums/scripts/projectSCAS/scripts/rebuildSearchindex.pl,v
17 retrieving revision 1.17
18 retrieving revision 1.18
19 diff -u -r1.17 -r1.18
20 --- rebuildSearchindex.pl 7 Sep 2007 21:59:57 -0000 1.17
21 +++ rebuildSearchindex.pl 9 Sep 2007 10:29:04 -0000 1.18
22 @@ -304,6 +304,9 @@
23 if (defined $description && defined $fname)
24 {
25 $dbh=DBI->connect($connectString, '', '', { RaiseError => 1, AutoCommit => 1 }) || die("Could not connect to database!");
26 +
27 + executeSQL_charset(\$dbh, "utf8");
28 +
29 $sth = $dbh->prepare(qq{update phpbb_forums set forum_desc=?, forum_name=? where forum_id=?});
30 $ext = $sth->execute($description,$fname,$forumId);
31 $sth->finish();
32 @@ -800,6 +803,8 @@
33 # - is this word a stopword? >
34 if (!$stopword{$thisword})
35 {
36 + executeSQL_charset(\$dbh, "utf8");
37 +
38 $sth = $dbh->prepare(qq{select word_id from scas_search_wordlist where word_text=?});
39 $ext = $sth->execute($thisword);
40 ($word_id)=$sth->fetchrow_array;
41 @@ -816,6 +821,8 @@
42 }
43 else
44 {
45 + executeSQL_charset(\$dbh, "utf8");
46 +
47 # - No word found; insert >
48 $sth = $dbh->prepare(qq{insert into scas_search_wordlist (word_text,word_id) values (?,?)});
49 $ext = $sth->execute($thisword,'NULL');
50 @@ -858,12 +865,16 @@
51 {
52 if ($sql_buf{$this_table_suffix})
53 {
54 + executeSQL_charset(\$dbh, "utf8");
55 +
56 $sth = $dbh->prepare("insert into scas_search_wordmatch_".$this_table_suffix." (post_id,word_id,word_count,word_inSubject,forum_id) values ".substr($sql_buf{$this_table_suffix},0,length($sql_buf{$this_table_suffix})-1));
57 $ext = $sth->execute();
58 }
59 }
60 if ($sql_buf{'others'})
61 {
62 + executeSQL_charset(\$dbh, "utf8");
63 +
64 $sth = $dbh->prepare("insert into scas_search_wordmatch (post_id,word_id,word_count,word_inSubject,forum_id) values ".substr($sql_buf{'others'},0,length($sql_buf{'others'})-1));
65 $ext = $sth->execute();
66 }
67
68
69
70 --
71 gentoo-commits@g.o mailing list