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

« back to all changes in this revision

Viewing changes to contrib/btree_gist/btree_macaddr.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-11 16:59:35 UTC
  • mfrom: (5.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090711165935-jfwin6gfrxf0gfsi
Tags: 8.4.0-2
* debian/libpq-dev.install: Ship catalog/genbki.h. (Closes: #536139)
* debian/rules: Drop --enable-cassert for final release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * $PostgreSQL: pgsql/contrib/btree_gist/btree_macaddr.c,v 1.7 2008/05/17 01:28:19 adunstan Exp $ 
 
2
 * $PostgreSQL: pgsql/contrib/btree_gist/btree_macaddr.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"
10
10
{
11
11
        macaddr         lower;
12
12
        macaddr         upper;
13
 
}       macKEY;
 
13
} macKEY;
14
14
 
15
15
/*
16
16
** OID ops
122
122
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
123
123
        macaddr    *query = (macaddr *) PG_GETARG_POINTER(1);
124
124
        StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
 
125
 
125
126
        /* Oid          subtype = PG_GETARG_OID(3); */
126
127
        bool       *recheck = (bool *) PG_GETARG_POINTER(4);
127
128
        macKEY     *kkk = (macKEY *) DatumGetPointer(entry->key);
130
131
        /* All cases served by this function are exact */
131
132
        *recheck = false;
132
133
 
133
 
        key.lower = (GBT_NUMKEY *) & kkk->lower;
134
 
        key.upper = (GBT_NUMKEY *) & kkk->upper;
 
134
        key.lower = (GBT_NUMKEY *) &kkk->lower;
 
135
        key.upper = (GBT_NUMKEY *) &kkk->upper;
135
136
 
136
137
        PG_RETURN_BOOL(
137
138
                                   gbt_num_consistent(&key, (void *) query, &strategy, GIST_LEAF(entry), &tinfo)