--- db/prgsrc/updatedb.pl 2004/01/10 21:07:38 1.38 +++ db/prgsrc/updatedb.pl 2006/09/25 00:09:43 1.42 @@ -28,7 +28,7 @@ The database, user and password are hard Dmitry Rubinstein -=head1 $Id: updatedb.pl,v 1.38 2004/01/10 21:07:38 boris Exp $ +=head1 $Id: updatedb.pl,v 1.42 2006/09/25 00:09:43 roma7 Exp $ =cut @@ -175,6 +175,10 @@ sub UpdateTournament { sub UpdateQuestion { my ($dbh, $QuestionId, $field, $value) = @_; + + if (($field eq 'Type') && ($value eq "'ä'")) { + $value = "'þä'"; + } $dbh->do("UPDATE Questions SET $field=$value WHERE QuestionId=$QuestionId") or die $dbh->errstr; @@ -277,6 +281,7 @@ MAIN: my($dbh) = DBI->connect("DBI:mysql:chgk", "piataev", "") or die "Can't connect to DB chgk\n"; +if ($dbh->get_info( 18 )=~/^(5|(4.1))/) {$dbh->do("SET NAMES 'koi8r'");} my @sources; open UNSORTED, ">$unsortedname"; while ($source = shift) { @@ -385,14 +390,6 @@ MAIN: next; } - if ($key =~ /÷ÉÄ/) { - if ($value =~ /^\s*ä\s*$/) {#Questions ä are really þä... - $value = "äþ"; - } - &UpdateQuestion($dbh, $QuestionId, "Type", $value); - next; - } - my @Fields = grep { $key =~ /$_/ } keys %QuestionFields;