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:543: NOTICE: type "gtsvector" is not yet defined
+psql:tsearch2.sql:544: NOTICE: type "gtsvector" is not yet defined
DETAIL: Creating a shell type definition.
-psql:tsearch2.sql:548: NOTICE: argument type gtsvector is only a shell
-psql:tsearch2.sql:997: NOTICE: type "gtsq" is not yet defined
+psql:tsearch2.sql:549: NOTICE: argument type gtsvector is only a shell
+psql:tsearch2.sql:998: NOTICE: type "gtsq" is not yet defined
DETAIL: Creating a shell type definition.
-psql:tsearch2.sql:1002: NOTICE: argument type gtsq is only a shell
+psql:tsearch2.sql:1003: NOTICE: argument type gtsq is only a shell
--tsvector
SELECT '1'::tsvector;
tsvector
QUERYTYPE *q;
QTNode *qex, *subs = NULL, *acctree;
bool isfind = false;
+ Datum *elemsp;
+ int nelemsp;
AggregateContext = ((AggState *) fcinfo->context)->aggcontext;
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) );
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) );
}
}
+ pfree( elemsp );
QTNFree( qex );
QTNFree( subs );
QTNFree( acctree );