~ubuntu-branches/ubuntu/hardy/postgresql-8.4/hardy-backports

« back to all changes in this revision

Viewing changes to contrib/btree_gist/btree_cash.c

  • Committer: Bazaar Package Importer
  • Author(s): Ubuntu Archive Backport
  • Date: 2009-11-09 13:46:16 UTC
  • mfrom: (5.2.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091109134616-ae14l9tr3g7p2t9y
Tags: 8.4.1-1~hardy1
Automated backport upload; no source changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * $PostgreSQL: pgsql/contrib/btree_gist/btree_cash.c,v 1.8 2008/05/17 01:28:19 adunstan Exp $ 
 
2
 * $PostgreSQL: pgsql/contrib/btree_gist/btree_cash.c,v 1.9 2009/06/11 14:48:50 momjian Exp $
3
3
 */
4
4
#include "btree_gist.h"
5
5
#include "btree_utils_num.h"
9
9
{
10
10
        Cash            lower;
11
11
        Cash            upper;
12
 
}       cashKEY;
 
12
} cashKEY;
13
13
 
14
14
/*
15
15
** Cash ops
101
101
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
102
102
        Cash            query = PG_GETARG_CASH(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
        cashKEY    *kkk = (cashKEY *) 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)