mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
Massive commit to run PGINDENT on all *.c and *.h files.
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* indexvalid.c--
|
||||
* index tuple qualification validity checking code
|
||||
* index tuple qualification validity checking code
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.14 1997/03/18 18:38:19 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.15 1997/09/07 04:37:38 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -21,64 +21,70 @@
|
||||
#include <executor/execdebug.h>
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* index scan key qualification code
|
||||
* index scan key qualification code
|
||||
* ----------------------------------------------------------------
|
||||
*/
|
||||
int NIndexTupleProcessed;
|
||||
int NIndexTupleProcessed;
|
||||
|
||||
/* ----------------
|
||||
* index_keytest
|
||||
* index_keytest
|
||||
*
|
||||
* old comments
|
||||
* May eventually combine with other tests (like timeranges)?
|
||||
* Should have Buffer buffer; as an argument and pass it to amgetattr.
|
||||
* May eventually combine with other tests (like timeranges)?
|
||||
* Should have Buffer buffer; as an argument and pass it to amgetattr.
|
||||
* ----------------
|
||||
*/
|
||||
bool
|
||||
index_keytest(IndexTuple tuple,
|
||||
TupleDesc tupdesc,
|
||||
int scanKeySize,
|
||||
ScanKey key)
|
||||
TupleDesc tupdesc,
|
||||
int scanKeySize,
|
||||
ScanKey key)
|
||||
{
|
||||
bool isNull;
|
||||
Datum datum;
|
||||
int test;
|
||||
|
||||
IncrIndexProcessed();
|
||||
|
||||
while (scanKeySize > 0) {
|
||||
datum = index_getattr(tuple,
|
||||
key[0].sk_attno,
|
||||
tupdesc,
|
||||
&isNull);
|
||||
|
||||
if (isNull) {
|
||||
/* XXX eventually should check if SK_ISNULL */
|
||||
return (false);
|
||||
}
|
||||
|
||||
if (key[0].sk_flags & SK_ISNULL) {
|
||||
return (false);
|
||||
bool isNull;
|
||||
Datum datum;
|
||||
int test;
|
||||
|
||||
IncrIndexProcessed();
|
||||
|
||||
while (scanKeySize > 0)
|
||||
{
|
||||
datum = index_getattr(tuple,
|
||||
key[0].sk_attno,
|
||||
tupdesc,
|
||||
&isNull);
|
||||
|
||||
if (isNull)
|
||||
{
|
||||
/* XXX eventually should check if SK_ISNULL */
|
||||
return (false);
|
||||
}
|
||||
|
||||
if (key[0].sk_flags & SK_ISNULL)
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
|
||||
if (key[0].sk_flags & SK_COMMUTE)
|
||||
{
|
||||
test = (*(key[0].sk_func))
|
||||
(DatumGetPointer(key[0].sk_argument),
|
||||
datum) ? 1 : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
test = (*(key[0].sk_func))
|
||||
(datum,
|
||||
DatumGetPointer(key[0].sk_argument)) ? 1 : 0;
|
||||
}
|
||||
|
||||
if (!test == !(key[0].sk_flags & SK_NEGATE))
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
|
||||
scanKeySize -= 1;
|
||||
key++;
|
||||
}
|
||||
|
||||
if (key[0].sk_flags & SK_COMMUTE) {
|
||||
test = (*(key[0].sk_func))
|
||||
(DatumGetPointer(key[0].sk_argument),
|
||||
datum) ? 1 : 0;
|
||||
} else {
|
||||
test = (*(key[0].sk_func))
|
||||
(datum,
|
||||
DatumGetPointer(key[0].sk_argument)) ? 1 : 0;
|
||||
}
|
||||
|
||||
if (!test == !(key[0].sk_flags & SK_NEGATE)) {
|
||||
return (false);
|
||||
}
|
||||
|
||||
scanKeySize -= 1;
|
||||
key++;
|
||||
}
|
||||
|
||||
return (true);
|
||||
return (true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user