Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
52ee800e
Commit
52ee800e
authored
Aug 23, 2002
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch resolve ERROR problem for non-goog query_txt.
Teodor Sigaev
parent
2e0e4306
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
8 deletions
+20
-8
contrib/tsearch/README.tsearch
contrib/tsearch/README.tsearch
+2
-0
contrib/tsearch/gistidx.c
contrib/tsearch/gistidx.c
+3
-0
contrib/tsearch/query.c
contrib/tsearch/query.c
+14
-7
contrib/tsearch/rewrite.c
contrib/tsearch/rewrite.c
+1
-1
No files found.
contrib/tsearch/README.tsearch
View file @
52ee800e
...
...
@@ -6,6 +6,8 @@ All work was done by Teodor Sigaev (teodor@stack.net) and Oleg Bartunov
CHANGES:
August 22, 2002
Fix works with 'bad' queries
August 13, 2002
Use parser of OpenFTS v0.33.
...
...
contrib/tsearch/gistidx.c
View file @
52ee800e
...
...
@@ -231,6 +231,9 @@ gtxtidx_consistent(PG_FUNCTION_ARGS) {
((
GISTENTRY
*
)
PG_GETARG_POINTER
(
0
))
->
key
);
if
(
!
query
->
size
)
PG_RETURN_BOOL
(
false
);
if
(
ISSIGNKEY
(
key
)
)
{
if
(
ISALLTRUE
(
key
)
)
PG_RETURN_BOOL
(
true
);
...
...
contrib/tsearch/query.c
View file @
52ee800e
...
...
@@ -419,7 +419,7 @@ execqtxt(PG_FUNCTION_ARGS)
CHKVAL
chkval
;
bool
result
;
if
(
!
val
->
size
)
if
(
!
val
->
size
||
!
query
->
size
)
{
PG_FREE_IF_COPY
(
val
,
0
);
PG_FREE_IF_COPY
(
query
,
1
);
...
...
@@ -593,8 +593,9 @@ mqtxt_in(PG_FUNCTION_ARGS)
res
=
clean_fakeval
(
GETQUERY
(
query
),
&
len
);
if
(
!
res
)
{
pfree
(
query
);
PG_RETURN_NULL
();
query
->
len
=
HDRSIZEQT
;
query
->
size
=
0
;
PG_RETURN_POINTER
(
query
);
}
memcpy
((
void
*
)
GETQUERY
(
query
),
(
void
*
)
res
,
len
*
sizeof
(
ITEM
));
#ifdef BS_DEBUG
...
...
@@ -738,8 +739,11 @@ qtxt_out(PG_FUNCTION_ARGS)
QUERYTYPE
*
query
=
(
QUERYTYPE
*
)
DatumGetPointer
(
PG_DETOAST_DATUM
(
PG_GETARG_DATUM
(
0
)));
INFIX
nrm
;
if
(
query
->
size
==
0
)
elog
(
ERROR
,
"Empty"
);
if
(
query
->
size
==
0
)
{
char
*
b
=
palloc
(
1
);
*
b
=
'\0'
;
PG_RETURN_POINTER
(
b
);
}
nrm
.
curpol
=
GETQUERY
(
query
);
nrm
.
buflen
=
32
;
nrm
.
cur
=
nrm
.
buf
=
(
char
*
)
palloc
(
sizeof
(
char
)
*
nrm
.
buflen
);
...
...
@@ -765,8 +769,11 @@ querytree(PG_FUNCTION_ARGS)
int4
len
;
if
(
query
->
size
==
0
)
elog
(
ERROR
,
"Empty"
);
if
(
query
->
size
==
0
)
{
res
=
(
text
*
)
palloc
(
VARHDRSZ
);
VARATT_SIZEP
(
res
)
=
VARHDRSZ
;
PG_RETURN_POINTER
(
res
);
}
q
=
clean_NOT
(
GETQUERY
(
query
),
&
len
);
...
...
contrib/tsearch/rewrite.c
View file @
52ee800e
...
...
@@ -283,7 +283,7 @@ clean_fakeval(ITEM * ptr, int4 *len)
resroot
=
clean_fakeval_intree
(
root
,
&
result
);
if
(
result
!=
V_UNKNOWN
)
{
elog
(
ERROR
,
"Your query contained only stopword
(s), ignored"
);
elog
(
NOTICE
,
"Query contains only stopword(s) or doesn't contain lexem
(s), ignored"
);
*
len
=
0
;
return
NULL
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment