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
a13cefaf
Commit
a13cefaf
authored
17 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Fix synonym-dict breakage introduced in last patch :-(.
Minor other cleanups.
parent
93eab931
Branches
Branches containing commit
Tags
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_synonym.c
+10
-8
10 additions, 8 deletions
src/backend/tsearch/dict_synonym.c
with
10 additions
and
8 deletions
src/backend/tsearch/dict_synonym.c
+
10
−
8
View file @
a13cefaf
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/tsearch/dict_synonym.c,v 1.
3
2007/08/25 0
0:03:59
tgl Exp $
* $PostgreSQL: pgsql/src/backend/tsearch/dict_synonym.c,v 1.
4
2007/08/25 0
2:29:45
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -120,30 +120,31 @@ dsynonym_init(PG_FUNCTION_ARGS)
...
@@ -120,30 +120,31 @@ dsynonym_init(PG_FUNCTION_ARGS)
/* Empty line */
/* Empty line */
goto
skipline
;
goto
skipline
;
}
}
*
end
=
'\0'
;
if
(
*
end
==
'\0'
)
if
(
end
>=
line
+
strlen
(
line
))
{
{
/* A line with only one word. Ignore silently. */
/* A line with only one word. Ignore silently. */
goto
skipline
;
goto
skipline
;
}
}
*
end
=
'\0'
;
starto
=
findwrd
(
end
+
1
,
&
end
);
starto
=
findwrd
(
end
+
1
,
&
end
);
if
(
!
starto
)
if
(
!
starto
)
{
{
/* A line with only one word. Ignore silently. */
/* A line with only one word
(+whitespace)
. Ignore silently. */
goto
skipline
;
goto
skipline
;
}
}
*
end
=
'\0'
;
*
end
=
'\0'
;
/* starti now points to the first word, and starto to the second
/*
* starti now points to the first word, and starto to the second
* word on the line, with a \0 terminator at the end of both words.
* word on the line, with a \0 terminator at the end of both words.
*/
*/
if
(
cur
=
=
d
->
len
)
if
(
cur
>
=
d
->
len
)
{
{
if
(
d
->
len
==
0
)
if
(
d
->
len
==
0
)
{
{
d
->
len
=
1
6
;
d
->
len
=
6
4
;
d
->
syn
=
(
Syn
*
)
palloc
(
sizeof
(
Syn
)
*
d
->
len
);
d
->
syn
=
(
Syn
*
)
palloc
(
sizeof
(
Syn
)
*
d
->
len
);
}
}
else
else
...
@@ -180,7 +181,8 @@ dsynonym_lexize(PG_FUNCTION_ARGS)
...
@@ -180,7 +181,8 @@ dsynonym_lexize(PG_FUNCTION_ARGS)
*
found
;
*
found
;
TSLexeme
*
res
;
TSLexeme
*
res
;
if
(
len
<=
0
)
/* note: d->len test protects against Solaris bsearch-of-no-items bug */
if
(
len
<=
0
||
d
->
len
<=
0
)
PG_RETURN_POINTER
(
NULL
);
PG_RETURN_POINTER
(
NULL
);
key
.
in
=
lowerstr_with_len
(
in
,
len
);
key
.
in
=
lowerstr_with_len
(
in
,
len
);
...
...
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