~ubuntu-branches/ubuntu/natty/postgresql-8.4/natty-security

« back to all changes in this revision

Viewing changes to contrib/btree_gist/btree_int4.c

Tags: upstream-8.4.0
ImportĀ upstreamĀ versionĀ 8.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * $PostgreSQL: pgsql/contrib/btree_gist/btree_int4.c,v 1.7 2008/05/17 01:28:19 adunstan Exp $ 
 
2
 * $PostgreSQL: pgsql/contrib/btree_gist/btree_int4.c,v 1.8 2009/06/11 14:48:50 momjian Exp $
3
3
 */
4
4
#include "btree_gist.h"
5
5
#include "btree_utils_num.h"
8
8
{
9
9
        int32           lower;
10
10
        int32           upper;
11
 
}       int32KEY;
 
11
} int32KEY;
12
12
 
13
13
/*
14
14
** int32 ops
101
101
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
102
102
        int32           query = PG_GETARG_INT32(1);
103
103
        StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
 
104
 
104
105
        /* Oid          subtype = PG_GETARG_OID(3); */
105
106
        bool       *recheck = (bool *) PG_GETARG_POINTER(4);
106
107
        int32KEY   *kkk = (int32KEY *) DatumGetPointer(entry->key);
109
110
        /* All cases served by this function are exact */
110
111
        *recheck = false;
111
112
 
112
 
        key.lower = (GBT_NUMKEY *) & kkk->lower;
113
 
        key.upper = (GBT_NUMKEY *) & kkk->upper;
 
113
        key.lower = (GBT_NUMKEY *) &kkk->lower;
 
114
        key.upper = (GBT_NUMKEY *) &kkk->upper;
114
115
 
115
116
        PG_RETURN_BOOL(
116
117
                                   gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)