#include "fmgr.h"
#include "access/genam.h"
#include "access/heapam.h"
+#include "access/htup_details.h"
#include "access/nbtree.h"
#include "catalog/indexing.h"
#include "catalog/pg_am.h"
#include "catalog/pg_opclass.h"
#include "catalog/pg_type.h"
#include "executor/spi.h"
+#include "utils/catcache.h"
#include "utils/fmgroids.h"
#include "utils/lsyscache.h"
#include "utils/memutils.h"
}
/*
- * Removes duplicates from an array of int4. 'l' is
+ * Removes duplicates from an array of int32. 'l' is
* size of the input array. Returns the new size of the array.
*/
static int
-uniqueint(uint32 *a, int4 l, int4 *max)
+uniqueint(uint32 *a, int32 l, int32 *max)
{
uint32 *ptr,
*res;
- int4 cnt = 0;
+ int32 cnt = 0;
*max = 1;
{
SimpleArray *s = Array2SimpleArray(info, a);
SmlSign *sign;
- int4 len, i;
+ int32 len, i;
uint32 *ptr;
len = CALCGTSIZE( ARRKEY, s->nelems );
}
static int
-uniqueHashedElem(HashedElem *a, int4 l)
+uniqueHashedElem(HashedElem *a, int32 l)
{
HashedElem *ptr,
*res;
static void
makesign(BITVECP sign, SmlSign *a)
{
- int4 i;
+ int32 i;
uint32 *ptr = GETARR(a);
MemSet((void *) sign, 0, sizeof(BITVEC));
HASH(sign, ptr[i]);
}
-static int4
+static int32
sizebitvec(BITVECP sign)
{
- int4 size = 0,
+ int32 size = 0,
i;
LOOPBYTE
if ( sign->size == SIGLENBIT )
{
- int4 len = CALCGTSIZE(SIGNKEY | ALLISTRUE, 0);
- int4 maxrepeat = sign->maxrepeat;
+ int32 len = CALCGTSIZE(SIGNKEY | ALLISTRUE, 0);
+ int32 maxrepeat = sign->maxrepeat;
sign = (SmlSign *) palloc(len);
SET_VARSIZE(sign, len);
static bool
unionkey(BITVECP sbase, SmlSign *add)
{
- int4 i;
+ int32 i;
if (ISSIGNKEY(add))
{
GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0);
int *size = (int *) PG_GETARG_POINTER(1);
BITVEC base;
- int4 i,
+ int32 i,
len,
maxrepeat = 1;
- int4 flag = 0;
+ int32 flag = 0;
SmlSign *result;
MemSet((void *) base, 0, sizeof(BITVEC));
}
else
{
- int4 i;
+ int32 i;
BITVECP sa = GETSIGN(a),
sb = GETSIGN(b);
{
uint32 *ptra = GETARR(a),
*ptrb = GETARR(b);
- int4 i;
+ int32 i;
*result = true;
for (i = 0; i < a->size; i++)
typedef struct
{
OffsetNumber pos;
- int4 cost;
+ int32 cost;
} SPLITCOST;
static int
*datum_r;
BITVECP union_l,
union_r;
- int4 size_alpha,
+ int32 size_alpha,
size_beta;
- int4 size_waste,
+ int32 size_waste,
waste = -1;
- int4 nbytes;
+ int32 nbytes;
OffsetNumber seed_1 = 0,
seed_2 = 0;
OffsetNumber *left,
int res = false;
SmlSign *query;
SimpleArray *s;
- int4 i;
+ int32 i;
fcinfo->flinfo->fn_extra = SearchArrayCache(
fcinfo->flinfo->fn_extra,
else
{ /* signature */
BITVECP sign = GETSIGN(key);
- int4 count = 0;
+ int32 count = 0;
fillHashVal(fcinfo->flinfo->fn_extra, s);