Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
90885420
Commit
90885420
authored
15 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Avoid core dump on empty thesaurus dictionary.
Per report from Robert Gravsjö.
parent
bb1e8bea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backend/tsearch/dict_thesaurus.c
+5
-5
5 additions, 5 deletions
src/backend/tsearch/dict_thesaurus.c
with
5 additions
and
5 deletions
src/backend/tsearch/dict_thesaurus.c
+
5
−
5
View file @
90885420
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/tsearch/dict_thesaurus.c,v 1.1
4
2009/
07/16 06:33:44 petere
Exp $
* $PostgreSQL: pgsql/src/backend/tsearch/dict_thesaurus.c,v 1.1
5
2009/
11/30 16:38:31 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -57,8 +57,8 @@ typedef struct
...
@@ -57,8 +57,8 @@ typedef struct
/* Array to search lexeme by exact match */
/* Array to search lexeme by exact match */
TheLexeme
*
wrds
;
TheLexeme
*
wrds
;
int
nwrds
;
int
nwrds
;
/* current number of words */
int
ntwrds
;
int
ntwrds
;
/* allocated array length */
/*
/*
* Storage of substituted result, n-th element is for n-th expression
* Storage of substituted result, n-th element is for n-th expression
...
@@ -298,7 +298,6 @@ thesaurusRead(char *filename, DictThesaurus *d)
...
@@ -298,7 +298,6 @@ thesaurusRead(char *filename, DictThesaurus *d)
static
TheLexeme
*
static
TheLexeme
*
addCompiledLexeme
(
TheLexeme
*
newwrds
,
int
*
nnw
,
int
*
tnm
,
TSLexeme
*
lexeme
,
LexemeInfo
*
src
,
uint16
tnvariant
)
addCompiledLexeme
(
TheLexeme
*
newwrds
,
int
*
nnw
,
int
*
tnm
,
TSLexeme
*
lexeme
,
LexemeInfo
*
src
,
uint16
tnvariant
)
{
{
if
(
*
nnw
>=
*
tnm
)
if
(
*
nnw
>=
*
tnm
)
{
{
*
tnm
*=
2
;
*
tnm
*=
2
;
...
@@ -453,7 +452,8 @@ compileTheLexeme(DictThesaurus *d)
...
@@ -453,7 +452,8 @@ compileTheLexeme(DictThesaurus *d)
pfree
(
d
->
wrds
[
i
].
entries
);
pfree
(
d
->
wrds
[
i
].
entries
);
}
}
pfree
(
d
->
wrds
);
if
(
d
->
wrds
)
pfree
(
d
->
wrds
);
d
->
wrds
=
newwrds
;
d
->
wrds
=
newwrds
;
d
->
nwrds
=
nnw
;
d
->
nwrds
=
nnw
;
d
->
ntwrds
=
tnm
;
d
->
ntwrds
=
tnm
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment