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

« back to all changes in this revision

Viewing changes to src/backend/access/gin/ginscan.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:
8
8
 * Portions Copyright (c) 1994, Regents of the University of California
9
9
 *
10
10
 * IDENTIFICATION
11
 
 *                      $PostgreSQL: pgsql/src/backend/access/gin/ginscan.c,v 1.23 2009/04/05 11:32:01 teodor Exp $
 
11
 *                      $PostgreSQL: pgsql/src/backend/access/gin/ginscan.c,v 1.24 2009/06/11 14:48:53 momjian Exp $
12
12
 *-------------------------------------------------------------------------
13
13
 */
14
14
 
37
37
 
38
38
static void
39
39
fillScanKey(GinState *ginstate, GinScanKey key, OffsetNumber attnum, Datum query,
40
 
                        Datum *entryValues, bool *partial_matches, uint32 nEntryValues, 
 
40
                        Datum *entryValues, bool *partial_matches, uint32 nEntryValues,
41
41
                        StrategyNumber strategy, Pointer *extra_data)
42
42
{
43
43
        uint32          i,
68
68
                key->scanEntry[i].strategy = strategy;
69
69
                key->scanEntry[i].list = NULL;
70
70
                key->scanEntry[i].nlist = 0;
71
 
                key->scanEntry[i].isPartialMatch = ( ginstate->canPartialMatch[attnum - 1] && partial_matches ) 
72
 
                                                                                                ? partial_matches[i] : false;
 
71
                key->scanEntry[i].isPartialMatch = (ginstate->canPartialMatch[attnum - 1] && partial_matches)
 
72
                        ? partial_matches[i] : false;
73
73
 
74
74
                /* link to the equals entry in current scan key */
75
75
                key->scanEntry[i].master = NULL;
172
172
                ScanKey         skey = &scankey[i];
173
173
                Datum      *entryValues;
174
174
                int32           nEntryValues = 0;
175
 
                bool            *partial_matches = NULL;
176
 
                Pointer         *extra_data = NULL;
 
175
                bool       *partial_matches = NULL;
 
176
                Pointer    *extra_data = NULL;
177
177
 
178
178
                /*
179
 
                 * Assume, that GIN-indexable operators are strict, so 
180
 
                 * nothing could be found
 
179
                 * Assume, that GIN-indexable operators are strict, so nothing could
 
180
                 * be found
181
181
                 */
182
182
                if (skey->sk_flags & SK_ISNULL)
183
183
                {
196
196
                if (nEntryValues < 0)
197
197
                {
198
198
                        /*
199
 
                         * extractQueryFn signals that nothing can match, so we can
200
 
                         * just set isVoidRes flag.  No need to examine any more keys.
 
199
                         * extractQueryFn signals that nothing can match, so we can just
 
200
                         * set isVoidRes flag.  No need to examine any more keys.
201
201
                         */
202
202
                        so->isVoidRes = true;
203
203
                        break;
206
206
                if (entryValues == NULL || nEntryValues == 0)
207
207
                {
208
208
                        /*
209
 
                         * extractQueryFn signals that everything matches.  This would
210
 
                         * require a full scan, which we can't do, but perhaps there
211
 
                         * is another scankey that provides a restriction to use.  So
212
 
                         * we keep going and check only at the end.
 
209
                         * extractQueryFn signals that everything matches.      This would
 
210
                         * require a full scan, which we can't do, but perhaps there is
 
211
                         * another scankey that provides a restriction to use.  So we keep
 
212
                         * going and check only at the end.
213
213
                         */
214
214
                        continue;
215
215
                }