plperl crashes backend

From: John Hansen <john(at)geeknet(dot)com(dot)au>
To: pgsql-bugs(at)postgresql(dot)org
Subject: plperl crashes backend
Date: 2004-11-17 03:49:15
Message-ID: 1100663355.14124.19.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following function:

create function text_to_words(text)
returns setof text as $_$
my %stopwords = ( 'i' => 'i','me' => 'me','my' => 'my','myself' => 'myself','we' => 'we','our' => 'our','ours' => 'ours','ourselves' => 'ourselves','you' => 'you','your' => 'your','yours' => 'yours','yourself' => 'yourself','yourselves' => 'yourselves','he' => 'he','him' => 'him','his' => 'his','himself' => 'himself','she' => 'she','her' => 'her','hers' => 'hers','herself' => 'herself','it' => 'it','its' => 'its','itself' => 'itself','they' => 'they','them' => 'them','their' => 'their','theirs' => 'theirs','themselves' => 'themselves','what' => 'what','which' => 'which','who' => 'who','whom' => 'whom','this' => 'this','that' => 'that','these' => 'these','those' => 'those','am' => 'am','is' => 'is','are' => 'are','was' => 'was','were' => 'were','be' => 'be','been' => 'been','being' => 'being','have' => 'have','has' => 'has','had' => 'had','having' => 'having','do' => 'do','does' => 'does','did' => 'did','doing' => 'doing','a' => 'a','an' => 'an','the' => 'the','and' => 'and','but' => 'but','if' => 'if','or' => 'or','because' => 'because','as' => 'as','until' => 'until','while' => 'while','of' => 'of','at' => 'at','by' => 'by','for' => 'for','with' => 'with','about' => 'about','against' => 'against','between' => 'between','into' => 'into','through' => 'through','during' => 'during','before' => 'before','after' => 'after','above' => 'above','below' => 'below','to' => 'to','from' => 'from','up' => 'up','down' => 'down','in' => 'in','out' => 'out','on' => 'on','off' => 'off','over' => 'over','under' => 'under','again' => 'again','further' => 'further','then' => 'then','once' => 'once','here' => 'here','there' => 'there','when' => 'when','where' => 'where','why' => 'why','how' => 'how','all' => 'all','any' => 'any','both' => 'both','each' => 'each','few' => 'few','more' => 'more','most' => 'most','other' => 'other','some' => 'some','such' => 'such','no' => 'no','nor' => 'nor','not' => 'not','only' => 'only','own' => 'own','same' => 'same','so' => 'so','than' => 'than','too' => 'too','very' => 'very','s' => 's','t' => 't','can' => 'can','will' => 'will','just' => 'just','don' => 'don','should' => 'should','now' => 'now' );
my $textstring = $_[0];
$textstring =~ s/[\`\`\~\!\(at)\#\$\%\^\&\*\(\)\_\+\-\=\{\}\[\]\\\|\:\;\"\"\'\'\<\>\,\.\?\/]+/ /gi; my @words = split /\ /,$textstring;
my $res = [];

foreach my $word (@words) {
$word =~ s/([A-Z])/lc($1)/ge;
if($word ne $stopwords{$word} && $word ne '') {
push @$res,$word;
}
}
return $res;
$_$ language plperl immutable strict;

creashes the backend, UNLESS it's executed in the same session where it was created.

Kind regards,

John

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Neil Conway 2004-11-17 04:05:20 Re: BUG #1321: SSL error: sslv3 alert handshake failure
Previous Message Andrew - Supernews 2004-11-16 23:39:40 Re: libplperl.so and libperl.so