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
134bed80
Commit
134bed80
authored
Nov 09, 2005
by
Teodor Sigaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rwrite(ARRAY) on 64-bit boxes:
Instead of getting elements of array manually call deconstruct_array
parent
0645663e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
11 deletions
+22
-11
contrib/tsearch2/expected/tsearch2.out
contrib/tsearch2/expected/tsearch2.out
+4
-4
contrib/tsearch2/query_rewrite.c
contrib/tsearch2/query_rewrite.c
+17
-7
contrib/tsearch2/tsearch.sql.in
contrib/tsearch2/tsearch.sql.in
+1
-0
No files found.
contrib/tsearch2/expected/tsearch2.out
View file @
134bed80
...
...
@@ -13,12 +13,12 @@ psql:tsearch2.sql:342: NOTICE: argument type tsvector is only a shell
psql:tsearch2.sql:396: NOTICE: type "tsquery" is not yet defined
DETAIL: Creating a shell type definition.
psql:tsearch2.sql:401: NOTICE: argument type tsquery is only a shell
psql:tsearch2.sql:54
3
: NOTICE: type "gtsvector" is not yet defined
psql:tsearch2.sql:54
4
: NOTICE: type "gtsvector" is not yet defined
DETAIL: Creating a shell type definition.
psql:tsearch2.sql:54
8
: NOTICE: argument type gtsvector is only a shell
psql:tsearch2.sql:99
7
: NOTICE: type "gtsq" is not yet defined
psql:tsearch2.sql:54
9
: NOTICE: argument type gtsvector is only a shell
psql:tsearch2.sql:99
8
: NOTICE: type "gtsq" is not yet defined
DETAIL: Creating a shell type definition.
psql:tsearch2.sql:100
2
: NOTICE: argument type gtsq is only a shell
psql:tsearch2.sql:100
3
: NOTICE: argument type gtsq is only a shell
--tsvector
SELECT '1'::tsvector;
tsvector
...
...
contrib/tsearch2/query_rewrite.c
View file @
134bed80
...
...
@@ -201,6 +201,8 @@ rewrite_accum(PG_FUNCTION_ARGS) {
QUERYTYPE
*
q
;
QTNode
*
qex
,
*
subs
=
NULL
,
*
acctree
;
bool
isfind
=
false
;
Datum
*
elemsp
;
int
nelemsp
;
AggregateContext
=
((
AggState
*
)
fcinfo
->
context
)
->
aggcontext
;
...
...
@@ -230,14 +232,19 @@ rewrite_accum(PG_FUNCTION_ARGS) {
if
(
ARR_ELEMTYPE
(
qa
)
!=
tsqOid
)
elog
(
ERROR
,
"array should contain tsquery type"
);
q
=
(
QUERYTYPE
*
)
ARR_DATA_PTR
(
qa
);
if
(
q
->
size
==
0
)
deconstruct_array
(
qa
,
tsqOid
,
-
1
,
false
,
'i'
,
&
elemsp
,
&
nelemsp
);
q
=
(
QUERYTYPE
*
)
DatumGetPointer
(
elemsp
[
0
]
);
if
(
q
->
size
==
0
)
{
pfree
(
elemsp
);
PG_RETURN_POINTER
(
acc
);
}
if
(
!
acc
->
size
)
{
if
(
acc
->
len
>
HDRSIZEQT
)
if
(
acc
->
len
>
HDRSIZEQT
)
{
pfree
(
elemsp
);
PG_RETURN_POINTER
(
acc
);
else
}
else
acctree
=
QT2QTN
(
GETQUERY
(
q
),
GETOPERAND
(
q
)
);
}
else
acctree
=
QT2QTN
(
GETQUERY
(
acc
),
GETOPERAND
(
acc
)
);
...
...
@@ -245,14 +252,16 @@ rewrite_accum(PG_FUNCTION_ARGS) {
QTNTernary
(
acctree
);
QTNSort
(
acctree
);
q
=
(
QUERYTYPE
*
)(
((
char
*
)
ARR_DATA_PTR
(
qa
))
+
MAXALIGN
(
q
->
len
)
);
if
(
q
->
size
==
0
)
q
=
(
QUERYTYPE
*
)
DatumGetPointer
(
elemsp
[
1
]
);
if
(
q
->
size
==
0
)
{
pfree
(
elemsp
);
PG_RETURN_POINTER
(
acc
);
}
qex
=
QT2QTN
(
GETQUERY
(
q
),
GETOPERAND
(
q
)
);
QTNTernary
(
qex
);
QTNSort
(
qex
);
q
=
(
QUERYTYPE
*
)
(
((
char
*
)
q
)
+
MAXALIGN
(
q
->
len
)
);
q
=
(
QUERYTYPE
*
)
DatumGetPointer
(
elemsp
[
2
]
);
if
(
q
->
size
)
subs
=
QT2QTN
(
GETQUERY
(
q
),
GETOPERAND
(
q
)
);
...
...
@@ -270,6 +279,7 @@ rewrite_accum(PG_FUNCTION_ARGS) {
}
}
pfree
(
elemsp
);
QTNFree
(
qex
);
QTNFree
(
subs
);
QTNFree
(
acctree
);
...
...
contrib/tsearch2/tsearch.sql.in
View file @
134bed80
...
...
@@ -402,6 +402,7 @@ LANGUAGE 'C' with (isstrict);
CREATE TYPE tsquery (
INTERNALLENGTH = -1,
ALIGNMENT = int4,
INPUT = tsquery_in,
OUTPUT = tsquery_out
);
...
...
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