Commit 319dbfa7 authored by Bruce Momjian's avatar Bruce Momjian

Another PGINDENT run that changes variable indenting and case label indenting....

Another PGINDENT run that changes variable indenting and case label indenting.  Also static variable indenting.
parent a90f12fd
......@@ -40,21 +40,21 @@
#include "utils/builtins.h"
#include "utils/elog.h"
static int32
static int32
array_iterator(Oid elemtype, Oid proc, int and, ArrayType * array, Datum value)
{
HeapTuple typ_tuple;
TypeTupleForm typ_struct;
bool typbyval;
int typlen;
func_ptr proc_fn;
int pronargs;
int nitems,
i,
result;
int ndim,
*dim;
char *p;
HeapTuple typ_tuple;
TypeTupleForm typ_struct;
bool typbyval;
int typlen;
func_ptr proc_fn;
int pronargs;
int nitems,
i,
result;
int ndim,
*dim;
char *p;
/* Sanity checks */
if ((array == (ArrayType *) NULL)
......@@ -101,16 +101,16 @@ array_iterator(Oid elemtype, Oid proc, int and, ArrayType * array, Datum value)
{
switch (typlen)
{
case 1:
result = (int) (*proc_fn) (*p, value);
break;
case 2:
result = (int) (*proc_fn) (*(int16 *) p, value);
break;
case 3:
case 4:
result = (int) (*proc_fn) (*(int32 *) p, value);
break;
case 1:
result = (int) (*proc_fn) (*p, value);
break;
case 2:
result = (int) (*proc_fn) (*(int16 *) p, value);
break;
case 3:
case 4:
result = (int) (*proc_fn) (*(int32 *) p, value);
break;
}
p += typlen;
}
......
......@@ -13,33 +13,34 @@
#include "utils/datetime.h"
TimeADT *
TimeADT *
time_difference(TimeADT * time1, TimeADT * time2)
{
TimeADT *result = (TimeADT *) palloc(sizeof(TimeADT));
TimeADT *result = (TimeADT *) palloc(sizeof(TimeADT));
*result = *time1 - *time2;
return (result);
}
TimeADT *
TimeADT *
currenttime()
{
time_t current_time;
struct tm *tm;
TimeADT *result = (TimeADT *) palloc(sizeof(TimeADT));
time_t current_time;
struct tm *tm;
TimeADT *result = (TimeADT *) palloc(sizeof(TimeADT));
current_time = time(NULL);
tm = localtime(&current_time);
*result = ((((tm->tm_hour * 60) + tm->tm_min) * 60) + tm->tm_sec);
return (result);
}
DateADT
currentdate()
{
time_t current_time;
struct tm *tm;
DateADT result;
time_t current_time;
struct tm *tm;
DateADT result;
current_time = time(NULL);
tm = localtime(&current_time);
......@@ -48,6 +49,7 @@ currentdate()
date2j(100, 1, 1);
return (result);
}
int4
hours(TimeADT * time)
{
......@@ -65,47 +67,52 @@ seconds(TimeADT * time)
{
return (((int) *time) % 60);
}
int4
day(DateADT * date)
{
struct tm tm;
struct tm tm;
j2date((*date + date2j(2000, 1, 1)),
&tm.tm_year, &tm.tm_mon, &tm.tm_mday);
return (tm.tm_mday);
}
int4
month(DateADT * date)
{
struct tm tm;
struct tm tm;
j2date((*date + date2j(2000, 1, 1)),
&tm.tm_year, &tm.tm_mon, &tm.tm_mday);
return (tm.tm_mon);
}
int4
year(DateADT * date)
{
struct tm tm;
struct tm tm;
j2date((*date + date2j(2000, 1, 1)),
&tm.tm_year, &tm.tm_mon, &tm.tm_mday);
return (tm.tm_year);
}
int4
asminutes(TimeADT * time)
{
int seconds = (int) *time;
int seconds = (int) *time;
return (seconds / 60);
}
int4
asseconds(TimeADT * time)
{
int seconds = (int) *time;
int seconds = (int) *time;
return (seconds);
}
......@@ -26,7 +26,7 @@
#endif
#ifndef HAVE_64BIT_INTS
typedef char [8] int64;
typedef char[8] int64;
#elif defined(__alpha)
typedef long int int64;
......@@ -44,40 +44,40 @@ typedef long int int64;
#define INT64_FORMAT "%ld"
#endif
int64 *int8in(char *str);
char *int8out(int64 * val);
int64 *int8in(char *str);
char *int8out(int64 * val);
bool int8eq(int64 * val1, int64 * val2);
bool int8ne(int64 * val1, int64 * val2);
bool int8lt(int64 * val1, int64 * val2);
bool int8gt(int64 * val1, int64 * val2);
bool int8le(int64 * val1, int64 * val2);
bool int8ge(int64 * val1, int64 * val2);
bool int8eq(int64 * val1, int64 * val2);
bool int8ne(int64 * val1, int64 * val2);
bool int8lt(int64 * val1, int64 * val2);
bool int8gt(int64 * val1, int64 * val2);
bool int8le(int64 * val1, int64 * val2);
bool int8ge(int64 * val1, int64 * val2);
bool int84eq(int64 * val1, int32 val2);
bool int84ne(int64 * val1, int32 val2);
bool int84lt(int64 * val1, int32 val2);
bool int84gt(int64 * val1, int32 val2);
bool int84le(int64 * val1, int32 val2);
bool int84ge(int64 * val1, int32 val2);
bool int84eq(int64 * val1, int32 val2);
bool int84ne(int64 * val1, int32 val2);
bool int84lt(int64 * val1, int32 val2);
bool int84gt(int64 * val1, int32 val2);
bool int84le(int64 * val1, int32 val2);
bool int84ge(int64 * val1, int32 val2);
int64 *int8um(int64 * val);
int64 *int8pl(int64 * val1, int64 * val2);
int64 *int8mi(int64 * val1, int64 * val2);
int64 *int8mul(int64 * val1, int64 * val2);
int64 *int8div(int64 * val1, int64 * val2);
int64 *int8um(int64 * val);
int64 *int8pl(int64 * val1, int64 * val2);
int64 *int8mi(int64 * val1, int64 * val2);
int64 *int8mul(int64 * val1, int64 * val2);
int64 *int8div(int64 * val1, int64 * val2);
int64 *int48(int32 val);
int32 int84(int64 * val);
int64 *int48(int32 val);
int32 int84(int64 * val);
#if FALSE
int64 *int28(int16 val);
int16 int82(int64 * val);
int64 *int28(int16 val);
int16 int82(int64 * val);
#endif
float64 i8tod(int64 * val);
int64 *dtoi8(float64 val);
float64 i8tod(int64 * val);
int64 *dtoi8(float64 val);
#if USE_LOCAL_CODE
......@@ -103,10 +103,10 @@ int64 *dtoi8(float64 val);
/* int8in()
*/
int64 *
int64 *
int8in(char *str)
{
int64 *result = PALLOCTYPE(int64);
int64 *result = PALLOCTYPE(int64);
#if HAVE_64BIT_INTS
if (!PointerIsValid(str))
......@@ -126,13 +126,13 @@ int8in(char *str)
/* int8out()
*/
char *
char *
int8out(int64 * val)
{
char *result;
char *result;
int len;
char buf[MAXINT8LEN + 1];
int len;
char buf[MAXINT8LEN + 1];
#if HAVE_64BIT_INTS
if (!PointerIsValid(val))
......@@ -242,10 +242,10 @@ int84ge(int64 * val1, int32 val2)
* Arithmetic operators on 64-bit integers.
*---------------------------------------------------------*/
int64 *
int64 *
int8um(int64 * val)
{
int64 *result = PALLOCTYPE(int64);
int64 *result = PALLOCTYPE(int64);
if (!PointerIsValid(val))
return NULL;
......@@ -255,10 +255,10 @@ int8um(int64 * val)
return (result);
} /* int8um() */
int64 *
int64 *
int8pl(int64 * val1, int64 * val2)
{
int64 *result = PALLOCTYPE(int64);
int64 *result = PALLOCTYPE(int64);
if ((!PointerIsValid(val1)) || (!PointerIsValid(val2)))
return NULL;
......@@ -268,10 +268,10 @@ int8pl(int64 * val1, int64 * val2)
return (result);
} /* int8pl() */
int64 *
int64 *
int8mi(int64 * val1, int64 * val2)
{
int64 *result = PALLOCTYPE(int64);
int64 *result = PALLOCTYPE(int64);
if ((!PointerIsValid(val1)) || (!PointerIsValid(val2)))
return NULL;
......@@ -281,10 +281,10 @@ int8mi(int64 * val1, int64 * val2)
return (result);
} /* int8mi() */
int64 *
int64 *
int8mul(int64 * val1, int64 * val2)
{
int64 *result = PALLOCTYPE(int64);
int64 *result = PALLOCTYPE(int64);
if ((!PointerIsValid(val1)) || (!PointerIsValid(val2)))
return NULL;
......@@ -294,10 +294,10 @@ int8mul(int64 * val1, int64 * val2)
return (result);
} /* int8mul() */
int64 *
int64 *
int8div(int64 * val1, int64 * val2)
{
int64 *result = PALLOCTYPE(int64);
int64 *result = PALLOCTYPE(int64);
if ((!PointerIsValid(val1)) || (!PointerIsValid(val2)))
return NULL;
......@@ -312,10 +312,10 @@ int8div(int64 * val1, int64 * val2)
* Conversion operators.
*---------------------------------------------------------*/
int64 *
int64 *
int48(int32 val)
{
int64 *result = PALLOCTYPE(int64);
int64 *result = PALLOCTYPE(int64);
*result = val;
......@@ -325,7 +325,7 @@ int48(int32 val)
int32
int84(int64 * val)
{
int32 result;
int32 result;
if (!PointerIsValid(val))
elog(WARN, "Invalid (null) int64, can't convert int8 to int4", NULL);
......@@ -339,10 +339,10 @@ int84(int64 * val)
} /* int84() */
#if FALSE
int64 *
int64 *
int28(int16 val)
{
int64 *result;
int64 *result;
if (!PointerIsValid(result = PALLOCTYPE(int64)))
elog(WARN, "Memory allocation failed, can't convert int8 to int2", NULL);
......@@ -355,7 +355,7 @@ int28(int16 val)
int16
int82(int64 * val)
{
int16 result;
int16 result;
if (!PointerIsValid(val))
elog(WARN, "Invalid (null) int8, can't convert to int2", NULL);
......@@ -370,17 +370,17 @@ int82(int64 * val)
float64
i8tod(int64 * val)
{
float64 result = PALLOCTYPE(float64data);
float64 result = PALLOCTYPE(float64data);
*result = *val;
return (result);
} /* i8tod() */
int64 *
int64 *
dtoi8(float64 val)
{
int64 *result = PALLOCTYPE(int64);
int64 *result = PALLOCTYPE(int64);
if ((*val < (-pow(2, 64) + 1)) || (*val > (pow(2, 64) - 1)))
elog(WARN, "Floating point conversion to int64 is out of range", NULL);
......
......@@ -24,10 +24,10 @@ void
halt(va_alist)
va_dcl
{
va_list arg_ptr;
char *format,
*pstr;
void (*sig_func) ();
va_list arg_ptr;
char *format,
*pstr;
void (*sig_func) ();
va_start(arg_ptr);
format = va_arg(arg_ptr, char *);
......
......@@ -3,4 +3,4 @@
**
*/
void halt();
void halt();
......@@ -13,17 +13,17 @@
int
main(int argc, char **argv)
{
char query[4000];
int row = 1;
int aint;
float afloat;
double adouble;
char achar[11],
achar16[17],
abpchar[11],
avarchar[51],
atext[51];
time_t aabstime;
char query[4000];
int row = 1;
int aint;
float afloat;
double adouble;
char achar[11],
achar16[17],
abpchar[11],
avarchar[51],
atext[51];
time_t aabstime;
if (argc != 2)
halt("Usage: %s database\n", argv[0]);
......
......@@ -12,31 +12,31 @@
#include "halt.h"
#include "pginterface.h"
static void sig_disconnect();
static void set_signals();
static void sig_disconnect();
static void set_signals();
#define NUL '\0'
/* GLOBAL VARIABLES */
static PGconn *conn;
static PGconn *conn;
static PGresult *res = NULL;
#define ON_ERROR_STOP 0
#define ON_ERROR_CONTINUE 1
static int on_error_state = ON_ERROR_STOP;
static int on_error_state = ON_ERROR_STOP;
/* LOCAL VARIABLES */
static sigset_t block_sigs,
unblock_sigs;
static int tuple;
unblock_sigs;
static int tuple;
/*
**
** connectdb - returns PGconn structure
**
*/
PGconn *
PGconn *
connectdb(char *dbName,
char *pghost,
char *pgport,
......@@ -68,7 +68,7 @@ disconnectdb()
** doquery - returns PGresult structure
**
*/
PGresult *
PGresult *
doquery(char *query)
{
if (res != NULL)
......@@ -104,9 +104,9 @@ doquery(char *query)
int
fetch(void *param,...)
{
va_list ap;
int arg,
num_fields;
va_list ap;
int arg,
num_fields;
num_fields = PQnfields(res);
......@@ -142,9 +142,9 @@ fetch(void *param,...)
int
fetchwithnulls(void *param,...)
{
va_list ap;
int arg,
num_fields;
va_list ap;
int arg,
num_fields;
num_fields = PQnfields(res);
......
......@@ -3,12 +3,12 @@
*
*/
PGresult *doquery(char *query);
PGconn *connectdb();
void disconnectdb();
int fetch(void *param,...);
int fetchwithnulls(void *param,...);
void on_error_continue();
void on_error_stop();
PGresult *doquery(char *query);
PGconn *connectdb();
void disconnectdb();
int fetch(void *param,...);
int fetchwithnulls(void *param,...);
void on_error_continue();
void on_error_stop();
#define END_OF_TUPLES (-1)
......@@ -15,26 +15,26 @@
int
main(int argc, char **argv)
{
char query[4000];
int row = 1;
int aint;
float afloat;
double adouble;
char achar[11],
achar16[17],
abpchar[11],
avarchar[51],
atext[51];
time_t aabstime;
int aint_null,
afloat_null,
adouble_null,
achar_null,
achar16_null,
abpchar_null,
avarchar_null,
atext_null,
aabstime_null;
char query[4000];
int row = 1;
int aint;
float afloat;
double adouble;
char achar[11],
achar16[17],
abpchar[11],
avarchar[51],
atext[51];
time_t aabstime;
int aint_null,
afloat_null,
adouble_null,
achar_null,
achar16_null,
abpchar_null,
avarchar_null,
atext_null,
aabstime_null;
if (argc != 2)
halt("Usage: %s database\n", argv[0]);
......
......@@ -13,10 +13,10 @@
int
main(int argc, char **argv)
{
char query[4000];
int row = 0;
int count;
char line[4000];
char query[4000];
int row = 0;
int count;
char line[4000];
if (argc != 2)
halt("Usage: %s database\n", argv[0]);
......
......@@ -11,18 +11,18 @@
#include <ctype.h>
/* prototype for soundex function */
char *soundex(char *instr, char *outstr);
char *soundex(char *instr, char *outstr);
text *
text *
text_soundex(text * t)
{
/* ABCDEFGHIJKLMNOPQRSTUVWXYZ */
char *table = "01230120022455012623010202";
int count = 0;
text *new_t;
char *table = "01230120022455012623010202";
int count = 0;
text *new_t;
char outstr[6 + 1]; /* max length of soundex is 6 */
char *instr;
char outstr[6 + 1]; /* max length of soundex is 6 */
char *instr;
/* make a null-terminated string */
instr = palloc(VARSIZE(t) + 1);
......@@ -47,11 +47,11 @@ text_soundex(text * t)
return (new_t);
}
char *
char *
soundex(char *instr, char *outstr)
{ /* ABCDEFGHIJKLMNOPQRSTUVWXYZ */
char *table = "01230120022455012623010202";
int count = 0;
char *table = "01230120022455012623010202";
int count = 0;
while (!isalpha(instr[0]) && instr[0])
++instr;
......
......@@ -45,15 +45,15 @@
* representation of data.
*/
char *
char *
string_output(char *data, int size)
{
register unsigned char c,
*p,
*r,
*result;
register int l,
len;
*p,
*r,
*result;
register int l,
len;
if (data == NULL)
{
......@@ -74,23 +74,23 @@ string_output(char *data, int size)
{
switch (*p)
{
case '\\':
case '"':
case '{':
case '}':
case '\b':
case '\f':
case '\n':
case '\r':
case '\t':
case '\v':
len++;
break;
default:
if (NOTPRINTABLE(*p))
{
len += 3;
}
case '\\':
case '"':
case '{':
case '}':
case '\b':
case '\f':
case '\n':
case '\r':
case '\t':
case '\v':
len++;
break;
default:
if (NOTPRINTABLE(*p))
{
len += 3;
}
}
}
len++;
......@@ -101,53 +101,53 @@ string_output(char *data, int size)
{
switch (c)
{
case '\\':
case '"':
case '{':
case '}':
*r++ = '\\';
*r++ = c;
break;
case '\b':
*r++ = '\\';
*r++ = 'b';
break;
case '\f':
*r++ = '\\';
*r++ = 'f';
break;
case '\n':
*r++ = '\\';
*r++ = 'n';
break;
case '\r':
*r++ = '\\';
*r++ = 'r';
break;
case '\t':
*r++ = '\\';
*r++ = 't';
break;
case '\v':
*r++ = '\\';
*r++ = 'v';
break;
default:
if (NOTPRINTABLE(c))
{
*r = '\\';
r += 3;
*r-- = DIGIT(c & 07);
c >>= 3;
*r-- = DIGIT(c & 07);
c >>= 3;
*r = DIGIT(c & 03);
r += 3;
}
else
{
case '\\':
case '"':
case '{':
case '}':
*r++ = '\\';
*r++ = c;
}
break;
case '\b':
*r++ = '\\';
*r++ = 'b';
break;
case '\f':
*r++ = '\\';
*r++ = 'f';
break;
case '\n':
*r++ = '\\';
*r++ = 'n';
break;
case '\r':
*r++ = '\\';
*r++ = 'r';
break;
case '\t':
*r++ = '\\';
*r++ = 't';
break;
case '\v':
*r++ = '\\';
*r++ = 'v';
break;
default:
if (NOTPRINTABLE(c))
{
*r = '\\';
r += 3;
*r-- = DIGIT(c & 07);
c >>= 3;
*r-- = DIGIT(c & 07);
c >>= 3;
*r = DIGIT(c & 03);
r += 3;
}
else
{
*r++ = c;
}
}
}
*r = '\0';
......@@ -181,13 +181,13 @@ string_output(char *data, int size)
* a pointer to the new string or the header.
*/
char *
char *
string_input(char *str, int size, int hdrsize, int *rtn_size)
{
register unsigned char *p,
*r;
unsigned char *result;
int len;
*r;
unsigned char *result;
int len;
if ((str == NULL) || (hdrsize < 0))
{
......@@ -247,48 +247,48 @@ string_input(char *str, int size, int hdrsize, int *rtn_size)
{
switch (c = *p++)
{
case '\0':
p--;
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
c = VALUE(c);
if (isdigit(*p))
{
c = (c << 3) + VALUE(*p++);
}
if (isdigit(*p))
{
c = (c << 3) + VALUE(*p++);
}
*r++ = c;
break;
case 'b':
*r++ = '\b';
break;
case 'f':
*r++ = '\f';
break;
case 'n':
*r++ = '\n';
break;
case 'r':
*r++ = '\r';
break;
case 't':
*r++ = '\t';
break;
case 'v':
*r++ = '\v';
break;
default:
*r++ = c;
case '\0':
p--;
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
c = VALUE(c);
if (isdigit(*p))
{
c = (c << 3) + VALUE(*p++);
}
if (isdigit(*p))
{
c = (c << 3) + VALUE(*p++);
}
*r++ = c;
break;
case 'b':
*r++ = '\b';
break;
case 'f':
*r++ = '\f';
break;
case 'n':
*r++ = '\n';
break;
case 'r':
*r++ = '\r';
break;
case 't':
*r++ = '\t';
break;
case 'v':
*r++ = '\v';
break;
default:
*r++ = c;
}
}
else
......@@ -300,10 +300,10 @@ string_input(char *str, int size, int hdrsize, int *rtn_size)
return ((char *) result);
}
char *
char *
c_charout(int32 c)
{
char str[2];
char str[2];
str[0] = (char) c;
str[1] = '\0';
......@@ -311,25 +311,25 @@ c_charout(int32 c)
return (string_output(str, 1));
}
char *
char *
c_char2out(uint16 s)
{
return (string_output((char *) &s, 2));
}
char *
char *
c_char4out(uint32 s)
{
return (string_output((char *) &s, 4));
}
char *
char *
c_char8out(char *s)
{
return (string_output(s, 8));
}
char *
char *
c_char16out(char *s)
{
return (string_output(s, 16));
......@@ -339,11 +339,11 @@ c_char16out(char *s)
* This can be used for text, bytea, SET and unknown data types
*/
char *
char *
c_textout(struct varlena * vlena)
{
int len = 0;
char *s = NULL;
int len = 0;
char *s = NULL;
if (vlena)
{
......@@ -357,10 +357,10 @@ c_textout(struct varlena * vlena)
* This can be used for varchar and bpchar strings
*/
char *
char *
c_varcharout(char *s)
{
int len;
int len;
if (s)
{
......@@ -375,7 +375,7 @@ struct varlena *
c_textin(char *str)
{
struct varlena *result;
int len;
int len;
if (str == NULL)
{
......@@ -388,7 +388,7 @@ c_textin(char *str)
return (result);
}
char *
char *
c_char16in(char *str)
{
return (string_input(str, 16, 0, NULL));
......
This diff is collapsed.
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/heapvalid.c,v 1.17 1997/09/07 04:37:36 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/heapvalid.c,v 1.18 1997/09/08 02:19:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -36,9 +36,9 @@ heap_keytest(HeapTuple t,
int nkeys,
ScanKey keys)
{
bool isnull;
Datum atp;
int test;
bool isnull;
Datum atp;
int test;
for (; nkeys--; keys++)
{
......@@ -101,11 +101,11 @@ heap_tuple_satisfies(ItemId itemId,
int nKeys,
ScanKey key)
{
HeapTuple tuple,
result;
bool res;
TransactionId old_tmin,
old_tmax;
HeapTuple tuple,
result;
bool res;
TransactionId old_tmin,
old_tmax;
if (!ItemIdIsUsed(itemId))
return NULL;
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.16 1997/09/07 04:37:37 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.17 1997/09/08 02:19:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -26,8 +26,8 @@
#include <string.h>
#endif
static Size IndexInfoFindDataOffset(unsigned short t_info);
static char *
static Size IndexInfoFindDataOffset(unsigned short t_info);
static char *
fastgetiattr(IndexTuple tup, int attnum,
TupleDesc att, bool * isnull);
......@@ -45,15 +45,15 @@ index_formtuple(TupleDesc tupleDescriptor,
Datum value[],
char null[])
{
register char *tp; /* tuple pointer */
IndexTuple tuple; /* return tuple */
Size size,
hoff;
int i;
unsigned short infomask = 0;
bool hasnull = false;
char tupmask = 0;
int numberOfAttributes = tupleDescriptor->natts;
register char *tp; /* tuple pointer */
IndexTuple tuple; /* return tuple */
Size size,
hoff;
int i;
unsigned short infomask = 0;
bool hasnull = false;
char tupmask = 0;
int numberOfAttributes = tupleDescriptor->natts;
if (numberOfAttributes > MaxIndexAttributeNumber)
elog(WARN, "index_formtuple: numberOfAttributes of %d > %d",
......@@ -133,16 +133,16 @@ index_formtuple(TupleDesc tupleDescriptor,
* the same attribute descriptor will go much quicker. -cim 5/4/91
* ----------------
*/
static char *
static char *
fastgetiattr(IndexTuple tup,
int attnum,
TupleDesc tupleDesc,
bool * isnull)
{
register char *tp; /* ptr to att in tuple */
register char *bp = NULL; /* ptr to att in tuple */
int slow; /* do we have to walk nulls? */
register int data_off; /* tuple data offset */
register char *tp; /* ptr to att in tuple */
register char *bp = NULL; /* ptr to att in tuple */
int slow; /* do we have to walk nulls? */
register int data_off; /* tuple data offset */
AttributeTupleForm *att = tupleDesc->attrs;
/* ----------------
......@@ -212,11 +212,11 @@ fastgetiattr(IndexTuple tup,
* ----------------
*/
{
register int i = 0; /* current offset in bp */
register int mask; /* bit in byte we're looking at */
register char n; /* current byte in bp */
register int byte,
finalbit;
register int i = 0; /* current offset in bp */
register int mask; /* bit in byte we're looking at */
register char n; /* current byte in bp */
register int byte,
finalbit;
byte = attnum >> 3;
finalbit = attnum & 0x07;
......@@ -256,7 +256,7 @@ fastgetiattr(IndexTuple tup,
}
else if (!IndexTupleAllFixed(tup))
{
register int j = 0;
register int j = 0;
for (j = 0; j < attnum && !slow; j++)
if (att[j]->attlen < 1)
......@@ -272,8 +272,8 @@ fastgetiattr(IndexTuple tup,
if (!slow)
{
register int j = 1;
register long off;
register int j = 1;
register long off;
/*
* need to set cache for some atts
......@@ -297,26 +297,26 @@ fastgetiattr(IndexTuple tup,
switch (att[j]->attlen)
{
case -1:
off = (att[j]->attalign == 'd') ?
DOUBLEALIGN(off) : INTALIGN(off);
break;
case sizeof(char):
break;
case sizeof(short):
off = SHORTALIGN(off);
break;
case sizeof(int32):
off = INTALIGN(off);
break;
default:
if (att[j]->attlen > sizeof(int32))
case -1:
off = (att[j]->attalign == 'd') ?
DOUBLEALIGN(off) : LONGALIGN(off);
else
elog(WARN, "fastgetiattr: attribute %d has len %d",
j, att[j]->attlen);
break;
DOUBLEALIGN(off) : INTALIGN(off);
break;
case sizeof(char):
break;
case sizeof(short):
off = SHORTALIGN(off);
break;
case sizeof(int32):
off = INTALIGN(off);
break;
default:
if (att[j]->attlen > sizeof(int32))
off = (att[j]->attalign == 'd') ?
DOUBLEALIGN(off) : LONGALIGN(off);
else
elog(WARN, "fastgetiattr: attribute %d has len %d",
j, att[j]->attlen);
break;
}
......@@ -329,9 +329,9 @@ fastgetiattr(IndexTuple tup,
}
else
{
register bool usecache = true;
register int off = 0;
register int i;
register bool usecache = true;
register int off = 0;
register int i;
/*
* Now we know that we have to walk the tuple CAREFULLY.
......@@ -361,31 +361,31 @@ fastgetiattr(IndexTuple tup,
att[i]->attcacheoff = off;
switch (att[i]->attlen)
{
case sizeof(char):
off++;
break;
case sizeof(short):
off = SHORTALIGN(off) +sizeof(short);
break;
case sizeof(int32):
off = INTALIGN(off) + sizeof(int32);
break;
case -1:
usecache = false;
off = (att[i]->attalign == 'd') ?
DOUBLEALIGN(off) : INTALIGN(off);
off += VARSIZE(tp + off);
break;
default:
if (att[i]->attlen > sizeof(int32))
case sizeof(char):
off++;
break;
case sizeof(short):
off = SHORTALIGN(off) +sizeof(short);
break;
case sizeof(int32):
off = INTALIGN(off) + sizeof(int32);
break;
case -1:
usecache = false;
off = (att[i]->attalign == 'd') ?
DOUBLEALIGN(off) + att[i]->attlen :
LONGALIGN(off) + att[i]->attlen;
else
elog(WARN, "fastgetiattr2: attribute %d has len %d",
i, att[i]->attlen);
break;
DOUBLEALIGN(off) : INTALIGN(off);
off += VARSIZE(tp + off);
break;
default:
if (att[i]->attlen > sizeof(int32))
off = (att[i]->attalign == 'd') ?
DOUBLEALIGN(off) + att[i]->attlen :
LONGALIGN(off) + att[i]->attlen;
else
elog(WARN, "fastgetiattr2: attribute %d has len %d",
i, att[i]->attlen);
break;
}
}
......@@ -395,27 +395,27 @@ fastgetiattr(IndexTuple tup,
*/
switch (att[attnum]->attlen)
{
case -1:
off = (att[attnum]->attalign == 'd') ?
DOUBLEALIGN(off) : INTALIGN(off);
break;
case sizeof(char):
break;
case sizeof(short):
off = SHORTALIGN(off);
break;
case sizeof(int32):
off = INTALIGN(off);
break;
default:
if (att[attnum]->attlen < sizeof(int32))
elog(WARN, "fastgetattr3: attribute %d has len %d",
attnum, att[attnum]->attlen);
if (att[attnum]->attalign == 'd')
off = DOUBLEALIGN(off);
else
off = LONGALIGN(off);
break;
case -1:
off = (att[attnum]->attalign == 'd') ?
DOUBLEALIGN(off) : INTALIGN(off);
break;
case sizeof(char):
break;
case sizeof(short):
off = SHORTALIGN(off);
break;
case sizeof(int32):
off = INTALIGN(off);
break;
default:
if (att[attnum]->attlen < sizeof(int32))
elog(WARN, "fastgetattr3: attribute %d has len %d",
attnum, att[attnum]->attlen);
if (att[attnum]->attalign == 'd')
off = DOUBLEALIGN(off);
else
off = LONGALIGN(off);
break;
}
return (fetchatt(&att[attnum], tp + off));
......@@ -461,14 +461,14 @@ FormRetrieveIndexResult(ItemPointer indexItemPointer,
*
* Change me if adding an attribute to IndexTuples!!!!!!!!!!!
*/
static Size
static Size
IndexInfoFindDataOffset(unsigned short t_info)
{
if (!(t_info & INDEX_NULL_MASK))
return ((Size) sizeof(IndexTupleData));
else
{
Size size = sizeof(IndexTupleData);
Size size = sizeof(IndexTupleData);
if (t_info & INDEX_NULL_MASK)
{
......@@ -485,8 +485,8 @@ IndexInfoFindDataOffset(unsigned short t_info)
void
CopyIndexTuple(IndexTuple source, IndexTuple * target)
{
Size size;
IndexTuple ret;
Size size;
IndexTuple ret;
size = IndexTupleSize(source);
if (*target == NULL)
......
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.15 1997/09/07 04:37:38 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.16 1997/09/08 02:19:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -24,7 +24,7 @@
* index scan key qualification code
* ----------------------------------------------------------------
*/
int NIndexTupleProcessed;
int NIndexTupleProcessed;
/* ----------------
* index_keytest
......@@ -40,9 +40,9 @@ index_keytest(IndexTuple tuple,
int scanKeySize,
ScanKey key)
{
bool isNull;
Datum datum;
int test;
bool isNull;
Datum datum;
int test;
IncrIndexProcessed();
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.16 1997/09/07 04:37:39 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.17 1997/09/08 02:19:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -35,7 +35,7 @@
Oid
typtoout(Oid type)
{
HeapTuple typeTuple;
HeapTuple typeTuple;
typeTuple = SearchSysCacheTuple(TYPOID,
ObjectIdGetDatum(type),
......@@ -52,7 +52,7 @@ typtoout(Oid type)
Oid
gettypelem(Oid type)
{
HeapTuple typeTuple;
HeapTuple typeTuple;
typeTuple = SearchSysCacheTuple(TYPOID,
ObjectIdGetDatum(type),
......@@ -73,13 +73,13 @@ gettypelem(Oid type)
void
printtup(HeapTuple tuple, TupleDesc typeinfo)
{
int i,
j,
k;
char *outputstr,
*attr;
bool isnull;
Oid typoutput;
int i,
j,
k;
char *outputstr,
*attr;
bool isnull;
Oid typoutput;
/* ----------------
* tell the frontend to expect new tuple data
......@@ -158,8 +158,8 @@ printatt(unsigned attributeId,
void
showatts(char *name, TupleDesc tupleDesc)
{
int i;
int natts = tupleDesc->natts;
int i;
int natts = tupleDesc->natts;
AttributeTupleForm *attinfo = tupleDesc->attrs;
puts(name);
......@@ -175,11 +175,11 @@ showatts(char *name, TupleDesc tupleDesc)
void
debugtup(HeapTuple tuple, TupleDesc typeinfo)
{
register int i;
char *attr,
*value;
bool isnull;
Oid typoutput;
register int i;
char *attr,
*value;
bool isnull;
Oid typoutput;
for (i = 0; i < tuple->t_natts; ++i)
{
......@@ -209,11 +209,11 @@ debugtup(HeapTuple tuple, TupleDesc typeinfo)
void
printtup_internal(HeapTuple tuple, TupleDesc typeinfo)
{
int i,
j,
k;
char *attr;
bool isnull;
int i,
j,
k;
char *attr;
bool isnull;
/* ----------------
* tell the frontend to expect new tuple data
......@@ -254,7 +254,7 @@ printtup_internal(HeapTuple tuple, TupleDesc typeinfo)
#endif
for (i = 0; i < tuple->t_natts; ++i)
{
int32 len = typeinfo->attrs[i]->attlen;
int32 len = typeinfo->attrs[i]->attlen;
attr = heap_getattr(tuple, InvalidBuffer, i + 1, typeinfo, &isnull);
if (!isnull)
......@@ -269,7 +269,7 @@ printtup_internal(HeapTuple tuple, TupleDesc typeinfo)
pq_putnchar(VARDATA(attr), len);
#ifdef IPORTAL_DEBUG
{
char *d = VARDATA(attr);
char *d = VARDATA(attr);
fprintf(stderr, "length %d data %x%x%x%x\n",
len, *d, *(d + 1), *(d + 2), *(d + 3));
......@@ -281,25 +281,25 @@ printtup_internal(HeapTuple tuple, TupleDesc typeinfo)
/* fixed size */
if (typeinfo->attrs[i]->attbyval)
{
int8 i8;
int16 i16;
int32 i32;
int8 i8;
int16 i16;
int32 i32;
pq_putint(len, sizeof(int32));
switch (len)
{
case sizeof(int8):
i8 = DatumGetChar(attr);
pq_putnchar((char *) &i8, len);
break;
case sizeof(int16):
i16 = DatumGetInt16(attr);
pq_putnchar((char *) &i16, len);
break;
case sizeof(int32):
i32 = DatumGetInt32(attr);
pq_putnchar((char *) &i32, len);
break;
case sizeof(int8):
i8 = DatumGetChar(attr);
pq_putnchar((char *) &i8, len);
break;
case sizeof(int16):
i16 = DatumGetInt16(attr);
pq_putnchar((char *) &i16, len);
break;
case sizeof(int32):
i32 = DatumGetInt32(attr);
pq_putnchar((char *) &i32, len);
break;
}
#ifdef IPORTAL_DEBUG
fprintf(stderr, "byval length %d data %d\n", len, attr);
......
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.20 1997/09/07 04:37:41 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.21 1997/09/08 02:19:56 momjian Exp $
*
* NOTES
* some of the executor utility code such as "ExecTypeFromTL" should be
......@@ -42,8 +42,8 @@
TupleDesc
CreateTemplateTupleDesc(int natts)
{
uint32 size;
TupleDesc desc;
uint32 size;
TupleDesc desc;
/* ----------------
* sanity checks
......@@ -77,7 +77,7 @@ CreateTemplateTupleDesc(int natts)
TupleDesc
CreateTupleDesc(int natts, AttributeTupleForm * attrs)
{
TupleDesc desc;
TupleDesc desc;
/* ----------------
* sanity checks
......@@ -105,9 +105,9 @@ CreateTupleDesc(int natts, AttributeTupleForm * attrs)
TupleDesc
CreateTupleDescCopy(TupleDesc tupdesc)
{
TupleDesc desc;
int i,
size;
TupleDesc desc;
int i,
size;
desc = (TupleDesc) palloc(sizeof(struct tupleDesc));
desc->natts = tupdesc->natts;
......@@ -139,10 +139,10 @@ CreateTupleDescCopy(TupleDesc tupdesc)
TupleDesc
CreateTupleDescCopyConstr(TupleDesc tupdesc)
{
TupleDesc desc;
TupleConstr *constr = tupdesc->constr;
int i,
size;
TupleDesc desc;
TupleConstr *constr = tupdesc->constr;
int i,
size;
desc = (TupleDesc) palloc(sizeof(struct tupleDesc));
desc->natts = tupdesc->natts;
......@@ -158,7 +158,7 @@ CreateTupleDescCopyConstr(TupleDesc tupdesc)
}
if (constr)
{
TupleConstr *cpy = (TupleConstr *) palloc(sizeof(TupleConstr));
TupleConstr *cpy = (TupleConstr *) palloc(sizeof(TupleConstr));
cpy->has_not_null = constr->has_not_null;
......@@ -201,7 +201,7 @@ CreateTupleDescCopyConstr(TupleDesc tupdesc)
void
FreeTupleDesc(TupleDesc tupdesc)
{
int i;
int i;
for (i = 0; i < tupdesc->natts; i++)
pfree(tupdesc->attrs[i]);
......@@ -210,7 +210,7 @@ FreeTupleDesc(TupleDesc tupdesc)
{
if (tupdesc->constr->num_defval > 0)
{
AttrDefault *attrdef = tupdesc->constr->defval;
AttrDefault *attrdef = tupdesc->constr->defval;
for (i = tupdesc->constr->num_defval - 1; i >= 0; i--)
{
......@@ -223,7 +223,7 @@ FreeTupleDesc(TupleDesc tupdesc)
}
if (tupdesc->constr->num_check > 0)
{
ConstrCheck *check = tupdesc->constr->check;
ConstrCheck *check = tupdesc->constr->check;
for (i = tupdesc->constr->num_check - 1; i >= 0; i--)
{
......@@ -258,8 +258,8 @@ TupleDescInitEntry(TupleDesc desc,
int attdim,
bool attisset)
{
HeapTuple tuple;
TypeTupleForm typeForm;
HeapTuple tuple;
TypeTupleForm typeForm;
AttributeTupleForm att;
/* ----------------
......@@ -378,7 +378,7 @@ TupleDescInitEntry(TupleDesc desc,
*/
if (attisset)
{
Type t = type("oid");
Type t = type("oid");
att->attlen = tlen(t);
att->attbyval = tbyval(t);
......@@ -411,7 +411,7 @@ TupleDescMakeSelfReference(TupleDesc desc,
char *relname)
{
AttributeTupleForm att;
Type t = type("oid");
Type t = type("oid");
att = desc->attrs[attnum - 1];
att->atttypid = TypeShellMake(relname);
......@@ -439,17 +439,17 @@ TupleDescMakeSelfReference(TupleDesc desc,
TupleDesc
BuildDescForRelation(List * schema, char *relname)
{
int natts;
AttrNumber attnum;
List *p;
TupleDesc desc;
AttrDefault *attrdef = NULL;
TupleConstr *constr = (TupleConstr *) palloc(sizeof(TupleConstr));
char *attname;
char *typename;
int attdim;
int ndef = 0;
bool attisset;
int natts;
AttrNumber attnum;
List *p;
TupleDesc desc;
AttrDefault *attrdef = NULL;
TupleConstr *constr = (TupleConstr *) palloc(sizeof(TupleConstr));
char *attname;
char *typename;
int attdim;
int ndef = 0;
bool attisset;
/* ----------------
* allocate a new tuple descriptor
......@@ -465,8 +465,8 @@ BuildDescForRelation(List * schema, char *relname)
foreach(p, schema)
{
ColumnDef *entry;
List *arry;
ColumnDef *entry;
List *arry;
/* ----------------
* for each entry in the list, get the name and type
......
This diff is collapsed.
......@@ -62,19 +62,19 @@ gistgettuple(IndexScanDesc s, ScanDirection dir)
return (res);
}
static RetrieveIndexResult
static RetrieveIndexResult
gistfirst(IndexScanDesc s, ScanDirection dir)
{
Buffer b;
Page p;
OffsetNumber n;
OffsetNumber maxoff;
Buffer b;
Page p;
OffsetNumber n;
OffsetNumber maxoff;
RetrieveIndexResult res;
GISTPageOpaque po;
GISTScanOpaque so;
GISTSTACK *stk;
BlockNumber blk;
IndexTuple it;
GISTPageOpaque po;
GISTScanOpaque so;
GISTSTACK *stk;
BlockNumber blk;
IndexTuple it;
b = ReadBuffer(s->relation, GISTP_ROOT);
p = BufferGetPage(b);
......@@ -145,19 +145,19 @@ gistfirst(IndexScanDesc s, ScanDirection dir)
}
}
static RetrieveIndexResult
static RetrieveIndexResult
gistnext(IndexScanDesc s, ScanDirection dir)
{
Buffer b;
Page p;
OffsetNumber n;
OffsetNumber maxoff;
Buffer b;
Page p;
OffsetNumber n;
OffsetNumber maxoff;
RetrieveIndexResult res;
GISTPageOpaque po;
GISTScanOpaque so;
GISTSTACK *stk;
BlockNumber blk;
IndexTuple it;
GISTPageOpaque po;
GISTScanOpaque so;
GISTSTACK *stk;
BlockNumber blk;
IndexTuple it;
blk = ItemPointerGetBlockNumber(&(s->currentItemData));
n = ItemPointerGetOffsetNumber(&(s->currentItemData));
......@@ -247,7 +247,7 @@ gistnext(IndexScanDesc s, ScanDirection dir)
}
/* Similar to index_keytest, but decompresses the key in the IndexTuple */
static bool
static bool
gistindex_keytest(IndexTuple tuple,
TupleDesc tupdesc,
int scanKeySize,
......@@ -257,10 +257,10 @@ gistindex_keytest(IndexTuple tuple,
Page p,
OffsetNumber offset)
{
bool isNull;
Datum datum;
int test;
GISTENTRY de;
bool isNull;
Datum datum;
int test;
GISTENTRY de;
IncrIndexProcessed();
......@@ -308,14 +308,14 @@ gistindex_keytest(IndexTuple tuple,
}
static OffsetNumber
static OffsetNumber
gistfindnext(IndexScanDesc s, Page p, OffsetNumber n, ScanDirection dir)
{
OffsetNumber maxoff;
char *it;
GISTPageOpaque po;
GISTScanOpaque so;
GISTSTATE *giststate;
OffsetNumber maxoff;
char *it;
GISTPageOpaque po;
GISTScanOpaque so;
GISTSTATE *giststate;
maxoff = PageGetMaxOffsetNumber(p);
po = (GISTPageOpaque) PageGetSpecialPointer(p);
......@@ -355,11 +355,11 @@ gistfindnext(IndexScanDesc s, Page p, OffsetNumber n, ScanDirection dir)
return (n);
}
static RetrieveIndexResult
static RetrieveIndexResult
gistscancache(IndexScanDesc s, ScanDirection dir)
{
RetrieveIndexResult res;
ItemPointer ip;
ItemPointer ip;
if (!(ScanDirectionIsNoMovement(dir)
&& ItemPointerIsValid(&(s->currentItemData))))
......@@ -384,14 +384,14 @@ gistscancache(IndexScanDesc s, ScanDirection dir)
* gistheapptr returns the item pointer to the tuple in the heap relation
* for which itemp is the index relation item pointer.
*/
static ItemPointer
static ItemPointer
gistheapptr(Relation r, ItemPointer itemp)
{
Buffer b;
Page p;
IndexTuple it;
ItemPointer ip;
OffsetNumber n;
Buffer b;
Page p;
IndexTuple it;
ItemPointer ip;
OffsetNumber n;
ip = (ItemPointer) palloc(sizeof(ItemPointerData));
if (ItemPointerIsValid(itemp))
......
......@@ -27,8 +27,8 @@
#endif
/* routines defined and used here */
static void gistregscan(IndexScanDesc s);
static void gistdropscan(IndexScanDesc s);
static void gistregscan(IndexScanDesc s);
static void gistdropscan(IndexScanDesc s);
static void
gistadjone(IndexScanDesc s, int op, BlockNumber blkno,
OffsetNumber offnum);
......@@ -51,9 +51,9 @@ adjustiptr(IndexScanDesc s, ItemPointer iptr,
typedef struct GISTScanListData
{
IndexScanDesc gsl_scan;
IndexScanDesc gsl_scan;
struct GISTScanListData *gsl_next;
} GISTScanListData;
} GISTScanListData;
typedef GISTScanListData *GISTScanList;
......@@ -66,7 +66,7 @@ gistbeginscan(Relation r,
uint16 nkeys,
ScanKey key)
{
IndexScanDesc s;
IndexScanDesc s;
RelationSetLockForRead(r);
s = RelationGetIndexScan(r, fromEnd, nkeys, key);
......@@ -78,8 +78,8 @@ gistbeginscan(Relation r,
void
gistrescan(IndexScanDesc s, bool fromEnd, ScanKey key)
{
GISTScanOpaque p;
int i;
GISTScanOpaque p;
int i;
if (!IndexScanIsValid(s))
{
......@@ -173,10 +173,10 @@ gistrescan(IndexScanDesc s, bool fromEnd, ScanKey key)
void
gistmarkpos(IndexScanDesc s)
{
GISTScanOpaque p;
GISTSTACK *o,
*n,
*tmp;
GISTScanOpaque p;
GISTSTACK *o,
*n,
*tmp;
s->currentMarkData = s->currentItemData;
p = (GISTScanOpaque) s->opaque;
......@@ -206,10 +206,10 @@ gistmarkpos(IndexScanDesc s)
void
gistrestrpos(IndexScanDesc s)
{
GISTScanOpaque p;
GISTSTACK *o,
*n,
*tmp;
GISTScanOpaque p;
GISTSTACK *o,
*n,
*tmp;
s->currentItemData = s->currentMarkData;
p = (GISTScanOpaque) s->opaque;
......@@ -239,7 +239,7 @@ gistrestrpos(IndexScanDesc s)
void
gistendscan(IndexScanDesc s)
{
GISTScanOpaque p;
GISTScanOpaque p;
p = (GISTScanOpaque) s->opaque;
......@@ -257,7 +257,7 @@ gistendscan(IndexScanDesc s)
static void
gistregscan(IndexScanDesc s)
{
GISTScanList l;
GISTScanList l;
l = (GISTScanList) palloc(sizeof(GISTScanListData));
l->gsl_scan = s;
......@@ -268,8 +268,8 @@ gistregscan(IndexScanDesc s)
static void
gistdropscan(IndexScanDesc s)
{
GISTScanList l;
GISTScanList prev;
GISTScanList l;
GISTScanList prev;
prev = (GISTScanList) NULL;
......@@ -294,8 +294,8 @@ gistdropscan(IndexScanDesc s)
void
gistadjscans(Relation r, int op, BlockNumber blkno, OffsetNumber offnum)
{
GISTScanList l;
Oid relid;
GISTScanList l;
Oid relid;
relid = r->rd_id;
for (l = GISTScans; l != (GISTScanList) NULL; l = l->gsl_next)
......@@ -321,7 +321,7 @@ gistadjone(IndexScanDesc s,
BlockNumber blkno,
OffsetNumber offnum)
{
GISTScanOpaque so;
GISTScanOpaque so;
adjustiptr(s, &(s->currentItemData), op, blkno, offnum);
adjustiptr(s, &(s->currentMarkData), op, blkno, offnum);
......@@ -349,8 +349,8 @@ adjustiptr(IndexScanDesc s,
BlockNumber blkno,
OffsetNumber offnum)
{
OffsetNumber curoff;
GISTScanOpaque so;
OffsetNumber curoff;
GISTScanOpaque so;
if (ItemPointerIsValid(iptr))
{
......@@ -361,39 +361,43 @@ adjustiptr(IndexScanDesc s,
switch (op)
{
case GISTOP_DEL:
/* back up one if we need to */
if (curoff >= offnum)
{
if (curoff > FirstOffsetNumber)
{
/* just adjust the item pointer */
ItemPointerSet(iptr, blkno, OffsetNumberPrev(curoff));
}
else
case GISTOP_DEL:
/* back up one if we need to */
if (curoff >= offnum)
{
/* remember that we're before the current tuple */
ItemPointerSet(iptr, blkno, FirstOffsetNumber);
if (iptr == &(s->currentItemData))
so->s_flags |= GS_CURBEFORE;
if (curoff > FirstOffsetNumber)
{
/* just adjust the item pointer */
ItemPointerSet(iptr, blkno, OffsetNumberPrev(curoff));
}
else
so->s_flags |= GS_MRKBEFORE;
{
/*
* remember that we're before the current
* tuple
*/
ItemPointerSet(iptr, blkno, FirstOffsetNumber);
if (iptr == &(s->currentItemData))
so->s_flags |= GS_CURBEFORE;
else
so->s_flags |= GS_MRKBEFORE;
}
}
}
break;
case GISTOP_SPLIT:
/* back to start of page on split */
ItemPointerSet(iptr, blkno, FirstOffsetNumber);
if (iptr == &(s->currentItemData))
so->s_flags &= ~GS_CURBEFORE;
else
so->s_flags &= ~GS_MRKBEFORE;
break;
default:
elog(WARN, "Bad operation in GiST scan adjust: %d", op);
break;
case GISTOP_SPLIT:
/* back to start of page on split */
ItemPointerSet(iptr, blkno, FirstOffsetNumber);
if (iptr == &(s->currentItemData))
so->s_flags &= ~GS_CURBEFORE;
else
so->s_flags &= ~GS_MRKBEFORE;
break;
default:
elog(WARN, "Bad operation in GiST scan adjust: %d", op);
}
}
}
......
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.13 1997/09/07 04:37:49 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.14 1997/09/08 02:20:10 momjian Exp $
*
* NOTES
* This file contains only the public interface routines.
......@@ -31,7 +31,7 @@
#include <string.h>
#endif
bool BuildingHash = false;
bool BuildingHash = false;
/*
* hashbuild() -- build a new hash index.
......@@ -52,30 +52,30 @@ hashbuild(Relation heap,
FuncIndexInfo * finfo,
PredInfo * predInfo)
{
HeapScanDesc hscan;
Buffer buffer;
HeapTuple htup;
IndexTuple itup;
TupleDesc htupdesc,
itupdesc;
Datum *attdata;
bool *nulls;
HeapScanDesc hscan;
Buffer buffer;
HeapTuple htup;
IndexTuple itup;
TupleDesc htupdesc,
itupdesc;
Datum *attdata;
bool *nulls;
InsertIndexResult res;
int nhtups,
nitups;
int i;
HashItem hitem;
int nhtups,
nitups;
int i;
HashItem hitem;
#ifndef OMIT_PARTIAL_INDEX
ExprContext *econtext;
TupleTable tupleTable;
ExprContext *econtext;
TupleTable tupleTable;
TupleTableSlot *slot;
#endif
Oid hrelid,
irelid;
Node *pred,
*oldPred;
Oid hrelid,
irelid;
Node *pred,
*oldPred;
/* note that this is a new btree */
BuildingHash = true;
......@@ -171,8 +171,8 @@ hashbuild(Relation heap,
*/
for (i = 1; i <= natts; i++)
{
int attoff;
bool attnull;
int attoff;
bool attnull;
/*
* Offsets are from the start of the tuple, and are
......@@ -280,8 +280,8 @@ hashbuild(Relation heap,
InsertIndexResult
hashinsert(Relation rel, Datum * datum, char *nulls, ItemPointer ht_ctid, Relation heapRel)
{
HashItem hitem;
IndexTuple itup;
HashItem hitem;
IndexTuple itup;
InsertIndexResult res;
......@@ -306,7 +306,7 @@ hashinsert(Relation rel, Datum * datum, char *nulls, ItemPointer ht_ctid, Relati
/*
* hashgettuple() -- Get the next tuple in the scan.
*/
char *
char *
hashgettuple(IndexScanDesc scan, ScanDirection dir)
{
RetrieveIndexResult res;
......@@ -329,14 +329,14 @@ hashgettuple(IndexScanDesc scan, ScanDirection dir)
/*
* hashbeginscan() -- start a scan on a hash index
*/
char *
char *
hashbeginscan(Relation rel,
bool fromEnd,
uint16 keysz,
ScanKey scankey)
{
IndexScanDesc scan;
HashScanOpaque so;
IndexScanDesc scan;
HashScanOpaque so;
scan = RelationGetIndexScan(rel, fromEnd, keysz, scankey);
so = (HashScanOpaque) palloc(sizeof(HashScanOpaqueData));
......@@ -356,8 +356,8 @@ hashbeginscan(Relation rel,
void
hashrescan(IndexScanDesc scan, bool fromEnd, ScanKey scankey)
{
ItemPointer iptr;
HashScanOpaque so;
ItemPointer iptr;
HashScanOpaque so;
so = (HashScanOpaque) scan->opaque;
......@@ -391,8 +391,8 @@ void
hashendscan(IndexScanDesc scan)
{
ItemPointer iptr;
HashScanOpaque so;
ItemPointer iptr;
HashScanOpaque so;
so = (HashScanOpaque) scan->opaque;
......@@ -426,8 +426,8 @@ hashendscan(IndexScanDesc scan)
void
hashmarkpos(IndexScanDesc scan)
{
ItemPointer iptr;
HashScanOpaque so;
ItemPointer iptr;
HashScanOpaque so;
/*
* see if we ever call this code. if we do, then so_mrkbuf a useful
......@@ -463,8 +463,8 @@ hashmarkpos(IndexScanDesc scan)
void
hashrestrpos(IndexScanDesc scan)
{
ItemPointer iptr;
HashScanOpaque so;
ItemPointer iptr;
HashScanOpaque so;
/*
* see if we ever call this code. if we do, then so_mrkbuf a useful
......
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.4 1997/09/07 04:37:53 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.5 1997/09/08 02:20:13 momjian Exp $
*
* NOTES
* These functions are stored in pg_amproc. For each operator class
......@@ -36,10 +36,10 @@ hashint4(uint32 key)
uint32
hashfloat4(float32 keyp)
{
int len;
int loop;
uint32 h;
char *kp = (char *) keyp;
int len;
int loop;
uint32 h;
char *kp = (char *) keyp;
len = sizeof(float32data);
......@@ -55,25 +55,25 @@ hashfloat4(float32 keyp)
switch (len & (8 - 1))
{
case 0:
do
{ /* All fall throughs */
HASH4;
case 7:
HASH4;
case 6:
HASH4;
case 5:
HASH4;
case 4:
HASH4;
case 3:
HASH4;
case 2:
HASH4;
case 1:
HASH4;
} while (--loop);
case 0:
do
{ /* All fall throughs */
HASH4;
case 7:
HASH4;
case 6:
HASH4;
case 5:
HASH4;
case 4:
HASH4;
case 3:
HASH4;
case 2:
HASH4;
case 1:
HASH4;
} while (--loop);
}
}
return (h);
......@@ -83,10 +83,10 @@ hashfloat4(float32 keyp)
uint32
hashfloat8(float64 keyp)
{
int len;
int loop;
uint32 h;
char *kp = (char *) keyp;
int len;
int loop;
uint32 h;
char *kp = (char *) keyp;
len = sizeof(float64data);
......@@ -102,25 +102,25 @@ hashfloat8(float64 keyp)
switch (len & (8 - 1))
{
case 0:
do
{ /* All fall throughs */
HASH4;
case 7:
HASH4;
case 6:
HASH4;
case 5:
HASH4;
case 4:
HASH4;
case 3:
HASH4;
case 2:
HASH4;
case 1:
HASH4;
} while (--loop);
case 0:
do
{ /* All fall throughs */
HASH4;
case 7:
HASH4;
case 6:
HASH4;
case 5:
HASH4;
case 4:
HASH4;
case 3:
HASH4;
case 2:
HASH4;
case 1:
HASH4;
} while (--loop);
}
}
return (h);
......@@ -137,8 +137,8 @@ hashoid(Oid key)
uint32
hashchar(char key)
{
int len;
uint32 h;
int len;
uint32 h;
len = sizeof(char);
......@@ -156,9 +156,9 @@ hashchar(char key)
uint32
hashchar2(uint16 intkey)
{
uint32 h;
int len;
char *key = (char *) &intkey;
uint32 h;
int len;
char *key = (char *) &intkey;
h = 0;
len = sizeof(uint16);
......@@ -173,9 +173,9 @@ hashchar2(uint16 intkey)
uint32
hashchar4(uint32 intkey)
{
uint32 h;
int len;
char *key = (char *) &intkey;
uint32 h;
int len;
char *key = (char *) &intkey;
h = 0;
len = sizeof(uint32);
......@@ -190,8 +190,8 @@ hashchar4(uint32 intkey)
uint32
hashchar8(char *key)
{
uint32 h;
int len;
uint32 h;
int len;
h = 0;
len = sizeof(char8);
......@@ -206,9 +206,9 @@ hashchar8(char *key)
uint32
hashname(NameData * n)
{
uint32 h;
int len;
char *key;
uint32 h;
int len;
char *key;
key = n->data;
......@@ -226,8 +226,8 @@ hashname(NameData * n)
uint32
hashchar16(char *key)
{
uint32 h;
int len;
uint32 h;
int len;
h = 0;
len = sizeof(char16);
......@@ -254,10 +254,10 @@ hashchar16(char *key)
uint32
hashtext(struct varlena * key)
{
int keylen;
char *keydata;
uint32 n;
int loop;
int keylen;
char *keydata;
uint32 n;
int loop;
keydata = VARDATA(key);
keylen = VARSIZE(key);
......@@ -274,25 +274,25 @@ hashtext(struct varlena * key)
switch (keylen & (8 - 1))
{
case 0:
do
{ /* All fall throughs */
HASHC;
case 7:
HASHC;
case 6:
HASHC;
case 5:
HASHC;
case 4:
HASHC;
case 3:
HASHC;
case 2:
HASHC;
case 1:
HASHC;
} while (--loop);
case 0:
do
{ /* All fall throughs */
HASHC;
case 7:
HASHC;
case 6:
HASHC;
case 5:
HASHC;
case 4:
HASHC;
case 3:
HASHC;
case 2:
HASHC;
case 1:
HASHC;
} while (--loop);
}
}
return (n);
......
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.9 1997/09/07 04:37:56 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.10 1997/09/08 02:20:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -32,15 +32,15 @@ static OffsetNumber _hash_pgaddtup(Relation rel, Buffer buf, int keysz, ScanKey
InsertIndexResult
_hash_doinsert(Relation rel, HashItem hitem)
{
Buffer buf;
Buffer metabuf;
BlockNumber blkno;
HashMetaPage metap;
IndexTuple itup;
Buffer buf;
Buffer metabuf;
BlockNumber blkno;
HashMetaPage metap;
IndexTuple itup;
InsertIndexResult res;
ScanKey itup_scankey;
int natts;
Page page;
ScanKey itup_scankey;
int natts;
Page page;
metabuf = _hash_getbuf(rel, HASH_METAPAGE, HASH_READ);
metap = (HashMetaPage) BufferGetPage(metabuf);
......@@ -101,7 +101,7 @@ _hash_doinsert(Relation rel, HashItem hitem)
* we will have dropped both the pin and the write lock on the buffer.
*
*/
static InsertIndexResult
static InsertIndexResult
_hash_insertonpg(Relation rel,
Buffer buf,
int keysz,
......@@ -110,15 +110,15 @@ _hash_insertonpg(Relation rel,
Buffer metabuf)
{
InsertIndexResult res;
Page page;
BlockNumber itup_blkno;
OffsetNumber itup_off;
int itemsz;
HashPageOpaque pageopaque;
bool do_expand = false;
Buffer ovflbuf;
HashMetaPage metap;
Bucket bucket;
Page page;
BlockNumber itup_blkno;
OffsetNumber itup_off;
int itemsz;
HashPageOpaque pageopaque;
bool do_expand = false;
Buffer ovflbuf;
HashMetaPage metap;
Bucket bucket;
metap = (HashMetaPage) BufferGetPage(metabuf);
_hash_checkpage((Page) metap, LH_META_PAGE);
......@@ -218,7 +218,7 @@ _hash_insertonpg(Relation rel,
* write lock and reference associated with the page's buffer. It is
* an error to call pgaddtup() without a write lock and reference.
*/
static OffsetNumber
static OffsetNumber
_hash_pgaddtup(Relation rel,
Buffer buf,
int keysz,
......@@ -226,8 +226,8 @@ _hash_pgaddtup(Relation rel,
Size itemsize,
HashItem hitem)
{
OffsetNumber itup_off;
Page page;
OffsetNumber itup_off;
Page page;
page = BufferGetPage(buf);
_hash_checkpage(page, LH_BUCKET_PAGE | LH_OVERFLOW_PAGE);
......
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.10 1997/09/07 04:37:57 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.11 1997/09/08 02:20:17 momjian Exp $
*
* NOTES
* Overflow pages look like ordinary relation pages.
......@@ -27,7 +27,7 @@
#endif
static OverflowPageAddress _hash_getovfladdr(Relation rel, Buffer * metabufp);
static uint32 _hash_firstfreebit(uint32 map);
static uint32 _hash_firstfreebit(uint32 map);
/*
* _hash_addovflpage
......@@ -44,13 +44,13 @@ _hash_addovflpage(Relation rel, Buffer * metabufp, Buffer buf)
{
OverflowPageAddress oaddr;
BlockNumber ovflblkno;
Buffer ovflbuf;
HashMetaPage metap;
HashPageOpaque ovflopaque;
HashPageOpaque pageopaque;
Page page;
Page ovflpage;
BlockNumber ovflblkno;
Buffer ovflbuf;
HashMetaPage metap;
HashPageOpaque ovflopaque;
HashPageOpaque pageopaque;
Page page;
Page ovflpage;
/* this had better be the last page in a bucket chain */
page = BufferGetPage(buf);
......@@ -99,24 +99,24 @@ _hash_addovflpage(Relation rel, Buffer * metabufp, Buffer buf)
* is exchanged for a read lock.
*
*/
static OverflowPageAddress
static OverflowPageAddress
_hash_getovfladdr(Relation rel, Buffer * metabufp)
{
HashMetaPage metap;
Buffer mapbuf = 0;
BlockNumber blkno;
PageOffset offset;
HashMetaPage metap;
Buffer mapbuf = 0;
BlockNumber blkno;
PageOffset offset;
OverflowPageAddress oaddr;
SplitNumber splitnum;
uint32 *freep = NULL;
uint32 max_free;
uint32 bit;
uint32 first_page;
uint32 free_bit;
uint32 free_page;
uint32 in_use_bits;
uint32 i,
j;
SplitNumber splitnum;
uint32 *freep = NULL;
uint32 max_free;
uint32 bit;
uint32 first_page;
uint32 free_bit;
uint32 free_page;
uint32 in_use_bits;
uint32 i,
j;
metap = (HashMetaPage) _hash_chgbufaccess(rel, metabufp, HASH_READ, HASH_WRITE);
......@@ -130,7 +130,7 @@ _hash_getovfladdr(Relation rel, Buffer * metabufp)
first_page = metap->LAST_FREED >> (metap->BSHIFT + BYTE_TO_BIT);
for (i = first_page; i <= free_page; i++)
{
Page mappage;
Page mappage;
blkno = metap->hashm_mapp[i];
mapbuf = _hash_getbuf(rel, blkno, HASH_WRITE);
......@@ -279,11 +279,11 @@ found:
* splitnumber.
*
*/
static uint32
static uint32
_hash_firstfreebit(uint32 map)
{
uint32 i,
mask;
uint32 i,
mask;
mask = 0x1;
for (i = 0; i < BITS_PER_MAP; i++)
......@@ -306,22 +306,22 @@ _hash_firstfreebit(uint32 map)
Buffer
_hash_freeovflpage(Relation rel, Buffer ovflbuf)
{
HashMetaPage metap;
Buffer metabuf;
Buffer mapbuf;
BlockNumber prevblkno;
BlockNumber blkno;
BlockNumber nextblkno;
HashPageOpaque ovflopaque;
Page ovflpage;
Page mappage;
HashMetaPage metap;
Buffer metabuf;
Buffer mapbuf;
BlockNumber prevblkno;
BlockNumber blkno;
BlockNumber nextblkno;
HashPageOpaque ovflopaque;
Page ovflpage;
Page mappage;
OverflowPageAddress addr;
SplitNumber splitnum;
uint32 *freep;
uint32 ovflpgno;
int32 bitmappage,
bitmapbit;
Bucket bucket;
SplitNumber splitnum;
uint32 *freep;
uint32 ovflpgno;
int32 bitmappage,
bitmapbit;
Bucket bucket;
metabuf = _hash_getbuf(rel, HASH_METAPAGE, HASH_WRITE);
metap = (HashMetaPage) BufferGetPage(metabuf);
......@@ -348,9 +348,9 @@ _hash_freeovflpage(Relation rel, Buffer ovflbuf)
*/
if (BlockNumberIsValid(prevblkno))
{
Buffer prevbuf = _hash_getbuf(rel, prevblkno, HASH_WRITE);
Page prevpage = BufferGetPage(prevbuf);
HashPageOpaque prevopaque =
Buffer prevbuf = _hash_getbuf(rel, prevblkno, HASH_WRITE);
Page prevpage = BufferGetPage(prevbuf);
HashPageOpaque prevopaque =
(HashPageOpaque) PageGetSpecialPointer(prevpage);
_hash_checkpage(prevpage, LH_BUCKET_PAGE | LH_OVERFLOW_PAGE);
......@@ -360,9 +360,9 @@ _hash_freeovflpage(Relation rel, Buffer ovflbuf)
}
if (BlockNumberIsValid(nextblkno))
{
Buffer nextbuf = _hash_getbuf(rel, nextblkno, HASH_WRITE);
Page nextpage = BufferGetPage(nextbuf);
HashPageOpaque nextopaque =
Buffer nextbuf = _hash_getbuf(rel, nextblkno, HASH_WRITE);
Page nextpage = BufferGetPage(nextbuf);
HashPageOpaque nextopaque =
(HashPageOpaque) PageGetSpecialPointer(nextpage);
_hash_checkpage(nextpage, LH_OVERFLOW_PAGE);
......@@ -436,13 +436,13 @@ _hash_initbitmap(Relation rel,
int32 nbits,
int32 ndx)
{
Buffer buf;
BlockNumber blkno;
Page pg;
HashPageOpaque op;
uint32 *freep;
int clearbytes,
clearints;
Buffer buf;
BlockNumber blkno;
Page pg;
HashPageOpaque op;
uint32 *freep;
int clearbytes,
clearints;
blkno = OADDR_TO_BLKNO(pnum);
buf = _hash_getbuf(rel, blkno, HASH_WRITE);
......@@ -496,18 +496,18 @@ _hash_squeezebucket(Relation rel,
HashMetaPage metap,
Bucket bucket)
{
Buffer wbuf;
Buffer rbuf = 0;
BlockNumber wblkno;
BlockNumber rblkno;
Page wpage;
Page rpage;
HashPageOpaque wopaque;
HashPageOpaque ropaque;
OffsetNumber woffnum;
OffsetNumber roffnum;
HashItem hitem;
int itemsz;
Buffer wbuf;
Buffer rbuf = 0;
BlockNumber wblkno;
BlockNumber rblkno;
Page wpage;
Page rpage;
HashPageOpaque wopaque;
HashPageOpaque ropaque;
OffsetNumber woffnum;
OffsetNumber roffnum;
HashItem hitem;
int itemsz;
/* elog(DEBUG, "_hash_squeezebucket: squeezing bucket %d", bucket); */
......
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.10 1997/09/07 04:38:00 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.11 1997/09/08 02:20:18 momjian Exp $
*
* NOTES
* Postgres hash pages look like ordinary relation pages. The opaque
......@@ -38,9 +38,9 @@
#include <string.h>
#endif
static void _hash_setpagelock(Relation rel, BlockNumber blkno, int access);
static void _hash_unsetpagelock(Relation rel, BlockNumber blkno, int access);
static void _hash_splitpage(Relation rel, Buffer metabuf, Bucket obucket, Bucket nbucket);
static void _hash_setpagelock(Relation rel, BlockNumber blkno, int access);
static void _hash_unsetpagelock(Relation rel, BlockNumber blkno, int access);
static void _hash_splitpage(Relation rel, Buffer metabuf, Bucket obucket, Bucket nbucket);
/*
* We use high-concurrency locking on hash indices. There are two cases in
......@@ -68,16 +68,16 @@ static void _hash_splitpage(Relation rel, Buffer metabuf, Bucket obucket, Bucke
void
_hash_metapinit(Relation rel)
{
HashMetaPage metap;
HashPageOpaque pageopaque;
Buffer metabuf;
Buffer buf;
Page pg;
int nbuckets;
uint32 nelem; /* number elements */
uint32 lg2nelem; /* _hash_log2(nelem) */
uint32 nblocks;
uint16 i;
HashMetaPage metap;
HashPageOpaque pageopaque;
Buffer metabuf;
Buffer buf;
Page pg;
int nbuckets;
uint32 nelem; /* number elements */
uint32 lg2nelem; /* _hash_log2(nelem) */
uint32 nblocks;
uint16 i;
/* can't be sharing this with anyone, now... */
if (USELOCKING)
......@@ -188,7 +188,7 @@ _hash_metapinit(Relation rel)
Buffer
_hash_getbuf(Relation rel, BlockNumber blkno, int access)
{
Buffer buf;
Buffer buf;
if (blkno == P_NEW)
{
......@@ -196,14 +196,14 @@ _hash_getbuf(Relation rel, BlockNumber blkno, int access)
}
switch (access)
{
case HASH_WRITE:
case HASH_READ:
_hash_setpagelock(rel, blkno, access);
break;
default:
elog(WARN, "_hash_getbuf: invalid access (%d) on new blk: %s",
access, RelationGetRelationName(rel));
break;
case HASH_WRITE:
case HASH_READ:
_hash_setpagelock(rel, blkno, access);
break;
default:
elog(WARN, "_hash_getbuf: invalid access (%d) on new blk: %s",
access, RelationGetRelationName(rel));
break;
}
buf = ReadBuffer(rel, blkno);
......@@ -217,19 +217,19 @@ _hash_getbuf(Relation rel, BlockNumber blkno, int access)
void
_hash_relbuf(Relation rel, Buffer buf, int access)
{
BlockNumber blkno;
BlockNumber blkno;
blkno = BufferGetBlockNumber(buf);
switch (access)
{
case HASH_WRITE:
case HASH_READ:
_hash_unsetpagelock(rel, blkno, access);
break;
default:
elog(WARN, "_hash_relbuf: invalid access (%d) on blk %x: %s",
access, blkno, RelationGetRelationName(rel));
case HASH_WRITE:
case HASH_READ:
_hash_unsetpagelock(rel, blkno, access);
break;
default:
elog(WARN, "_hash_relbuf: invalid access (%d) on blk %x: %s",
access, blkno, RelationGetRelationName(rel));
}
ReleaseBuffer(buf);
......@@ -245,7 +245,7 @@ _hash_relbuf(Relation rel, Buffer buf, int access)
void
_hash_wrtbuf(Relation rel, Buffer buf)
{
BlockNumber blkno;
BlockNumber blkno;
blkno = BufferGetBlockNumber(buf);
WriteBuffer(buf);
......@@ -262,7 +262,7 @@ _hash_wrtbuf(Relation rel, Buffer buf)
void
_hash_wrtnorelbuf(Relation rel, Buffer buf)
{
BlockNumber blkno;
BlockNumber blkno;
blkno = BufferGetBlockNumber(buf);
WriteNoReleaseBuffer(buf);
......@@ -274,22 +274,22 @@ _hash_chgbufaccess(Relation rel,
int from_access,
int to_access)
{
BlockNumber blkno;
BlockNumber blkno;
blkno = BufferGetBlockNumber(*bufp);
switch (from_access)
{
case HASH_WRITE:
_hash_wrtbuf(rel, *bufp);
break;
case HASH_READ:
_hash_relbuf(rel, *bufp, from_access);
break;
default:
elog(WARN, "_hash_chgbufaccess: invalid access (%d) on blk %x: %s",
from_access, blkno, RelationGetRelationName(rel));
break;
case HASH_WRITE:
_hash_wrtbuf(rel, *bufp);
break;
case HASH_READ:
_hash_relbuf(rel, *bufp, from_access);
break;
default:
elog(WARN, "_hash_chgbufaccess: invalid access (%d) on blk %x: %s",
from_access, blkno, RelationGetRelationName(rel));
break;
}
*bufp = _hash_getbuf(rel, blkno, to_access);
return (BufferGetPage(*bufp));
......@@ -328,16 +328,16 @@ _hash_setpagelock(Relation rel,
switch (access)
{
case HASH_WRITE:
RelationSetSingleWLockPage(rel, &iptr);
break;
case HASH_READ:
RelationSetSingleRLockPage(rel, &iptr);
break;
default:
elog(WARN, "_hash_setpagelock: invalid access (%d) on blk %x: %s",
access, blkno, RelationGetRelationName(rel));
break;
case HASH_WRITE:
RelationSetSingleWLockPage(rel, &iptr);
break;
case HASH_READ:
RelationSetSingleRLockPage(rel, &iptr);
break;
default:
elog(WARN, "_hash_setpagelock: invalid access (%d) on blk %x: %s",
access, blkno, RelationGetRelationName(rel));
break;
}
}
}
......@@ -355,16 +355,16 @@ _hash_unsetpagelock(Relation rel,
switch (access)
{
case HASH_WRITE:
RelationUnsetSingleWLockPage(rel, &iptr);
break;
case HASH_READ:
RelationUnsetSingleRLockPage(rel, &iptr);
break;
default:
elog(WARN, "_hash_unsetpagelock: invalid access (%d) on blk %x: %s",
access, blkno, RelationGetRelationName(rel));
break;
case HASH_WRITE:
RelationUnsetSingleWLockPage(rel, &iptr);
break;
case HASH_READ:
RelationUnsetSingleRLockPage(rel, &iptr);
break;
default:
elog(WARN, "_hash_unsetpagelock: invalid access (%d) on blk %x: %s",
access, blkno, RelationGetRelationName(rel));
break;
}
}
}
......@@ -372,13 +372,13 @@ _hash_unsetpagelock(Relation rel,
void
_hash_pagedel(Relation rel, ItemPointer tid)
{
Buffer buf;
Buffer metabuf;
Page page;
BlockNumber blkno;
OffsetNumber offno;
HashMetaPage metap;
HashPageOpaque opaque;
Buffer buf;
Buffer metabuf;
Page page;
BlockNumber blkno;
OffsetNumber offno;
HashMetaPage metap;
HashPageOpaque opaque;
blkno = ItemPointerGetBlockNumber(tid);
offno = ItemPointerGetOffsetNumber(tid);
......@@ -414,10 +414,10 @@ _hash_pagedel(Relation rel, ItemPointer tid)
void
_hash_expandtable(Relation rel, Buffer metabuf)
{
HashMetaPage metap;
Bucket old_bucket;
Bucket new_bucket;
uint32 spare_ndx;
HashMetaPage metap;
Bucket old_bucket;
Bucket new_bucket;
uint32 spare_ndx;
/* elog(DEBUG, "_hash_expandtable: expanding..."); */
......@@ -472,26 +472,26 @@ _hash_splitpage(Relation rel,
Bucket obucket,
Bucket nbucket)
{
Bucket bucket;
Buffer obuf;
Buffer nbuf;
Buffer ovflbuf;
BlockNumber oblkno;
BlockNumber nblkno;
bool null;
Datum datum;
HashItem hitem;
HashPageOpaque oopaque;
HashPageOpaque nopaque;
HashMetaPage metap;
IndexTuple itup;
int itemsz;
OffsetNumber ooffnum;
OffsetNumber noffnum;
OffsetNumber omaxoffnum;
Page opage;
Page npage;
TupleDesc itupdesc;
Bucket bucket;
Buffer obuf;
Buffer nbuf;
Buffer ovflbuf;
BlockNumber oblkno;
BlockNumber nblkno;
bool null;
Datum datum;
HashItem hitem;
HashPageOpaque oopaque;
HashPageOpaque nopaque;
HashMetaPage metap;
IndexTuple itup;
int itemsz;
OffsetNumber ooffnum;
OffsetNumber noffnum;
OffsetNumber omaxoffnum;
Page opage;
Page npage;
TupleDesc itupdesc;
/* elog(DEBUG, "_hash_splitpage: splitting %d into %d,%d",
obucket, obucket, nbucket);
......
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.9 1997/09/07 04:38:01 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.10 1997/09/08 02:20:20 momjian Exp $
*
* NOTES
* Because we can be doing an index scan on a relation while we
......@@ -31,14 +31,14 @@
#include <access/hash.h>
static void _hash_scandel(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno);
static bool _hash_scantouched(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno);
static void _hash_scandel(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno);
static bool _hash_scantouched(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno);
typedef struct HashScanListData
{
IndexScanDesc hashsl_scan;
IndexScanDesc hashsl_scan;
struct HashScanListData *hashsl_next;
} HashScanListData;
} HashScanListData;
typedef HashScanListData *HashScanList;
......@@ -50,7 +50,7 @@ static HashScanList HashScans = (HashScanList) NULL;
void
_hash_regscan(IndexScanDesc scan)
{
HashScanList new_el;
HashScanList new_el;
new_el = (HashScanList) palloc(sizeof(HashScanListData));
new_el->hashsl_scan = scan;
......@@ -64,8 +64,8 @@ _hash_regscan(IndexScanDesc scan)
void
_hash_dropscan(IndexScanDesc scan)
{
HashScanList chk,
last;
HashScanList chk,
last;
last = (HashScanList) NULL;
for (chk = HashScans;
......@@ -89,8 +89,8 @@ _hash_dropscan(IndexScanDesc scan)
void
_hash_adjscans(Relation rel, ItemPointer tid)
{
HashScanList l;
Oid relid;
HashScanList l;
Oid relid;
relid = rel->rd_id;
for (l = HashScans; l != (HashScanList) NULL; l = l->hashsl_next)
......@@ -104,10 +104,10 @@ _hash_adjscans(Relation rel, ItemPointer tid)
static void
_hash_scandel(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno)
{
ItemPointer current;
Buffer buf;
Buffer metabuf;
HashScanOpaque so;
ItemPointer current;
Buffer buf;
Buffer metabuf;
HashScanOpaque so;
if (!_hash_scantouched(scan, blkno, offno))
return;
......@@ -144,12 +144,12 @@ _hash_scandel(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno)
}
}
static bool
static bool
_hash_scantouched(IndexScanDesc scan,
BlockNumber blkno,
OffsetNumber offno)
{
ItemPointer current;
ItemPointer current;
current = &(scan->currentItemData);
if (ItemPointerIsValid(current)
......
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.11 1997/09/07 04:38:02 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.12 1997/09/08 02:20:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -34,9 +34,9 @@ _hash_search(Relation rel,
Buffer * bufP,
HashMetaPage metap)
{
BlockNumber blkno;
Datum keyDatum;
Bucket bucket;
BlockNumber blkno;
Datum keyDatum;
Bucket bucket;
if (scankey == (ScanKey) NULL ||
(keyDatum = scankey[0].sk_argument) == (Datum) NULL)
......@@ -70,16 +70,16 @@ _hash_search(Relation rel,
RetrieveIndexResult
_hash_next(IndexScanDesc scan, ScanDirection dir)
{
Relation rel;
Buffer buf;
Buffer metabuf;
Page page;
OffsetNumber offnum;
Relation rel;
Buffer buf;
Buffer metabuf;
Page page;
OffsetNumber offnum;
RetrieveIndexResult res;
ItemPointer current;
HashItem hitem;
IndexTuple itup;
HashScanOpaque so;
ItemPointer current;
HashItem hitem;
IndexTuple itup;
HashScanOpaque so;
rel = scan->relation;
so = (HashScanOpaque) scan->opaque;
......@@ -129,7 +129,7 @@ static void
_hash_readnext(Relation rel,
Buffer * bufp, Page * pagep, HashPageOpaque * opaquep)
{
BlockNumber blkno;
BlockNumber blkno;
blkno = (*opaquep)->hasho_nextblkno;
_hash_relbuf(rel, *bufp, HASH_READ);
......@@ -148,7 +148,7 @@ static void
_hash_readprev(Relation rel,
Buffer * bufp, Page * pagep, HashPageOpaque * opaquep)
{
BlockNumber blkno;
BlockNumber blkno;
blkno = (*opaquep)->hasho_prevblkno;
_hash_relbuf(rel, *bufp, HASH_READ);
......@@ -180,18 +180,18 @@ _hash_readprev(Relation rel,
RetrieveIndexResult
_hash_first(IndexScanDesc scan, ScanDirection dir)
{
Relation rel;
Buffer buf;
Buffer metabuf;
Page page;
HashPageOpaque opaque;
HashMetaPage metap;
HashItem hitem;
IndexTuple itup;
ItemPointer current;
OffsetNumber offnum;
Relation rel;
Buffer buf;
Buffer metabuf;
Page page;
HashPageOpaque opaque;
HashMetaPage metap;
HashItem hitem;
IndexTuple itup;
ItemPointer current;
OffsetNumber offnum;
RetrieveIndexResult res;
HashScanOpaque so;
HashScanOpaque so;
rel = scan->relation;
so = (HashScanOpaque) scan->opaque;
......@@ -286,20 +286,20 @@ _hash_first(IndexScanDesc scan, ScanDirection dir)
bool
_hash_step(IndexScanDesc scan, Buffer * bufP, ScanDirection dir, Buffer metabuf)
{
Relation rel;
ItemPointer current;
HashScanOpaque so;
int allbuckets;
HashMetaPage metap;
Buffer buf;
Page page;
HashPageOpaque opaque;
OffsetNumber maxoff;
OffsetNumber offnum;
Bucket bucket;
BlockNumber blkno;
HashItem hitem;
IndexTuple itup;
Relation rel;
ItemPointer current;
HashScanOpaque so;
int allbuckets;
HashMetaPage metap;
Buffer buf;
Page page;
HashPageOpaque opaque;
OffsetNumber maxoff;
OffsetNumber offnum;
Bucket bucket;
BlockNumber blkno;
HashItem hitem;
IndexTuple itup;
rel = scan->relation;
current = &(scan->currentItemData);
......@@ -341,107 +341,107 @@ _hash_step(IndexScanDesc scan, Buffer * bufP, ScanDirection dir, Buffer metabuf)
switch (dir)
{
case ForwardScanDirection:
if (offnum != InvalidOffsetNumber)
{
offnum = OffsetNumberNext(offnum); /* move forward */
}
else
{
offnum = FirstOffsetNumber; /* new page */
}
while (offnum > maxoff)
{
case ForwardScanDirection:
if (offnum != InvalidOffsetNumber)
{
offnum = OffsetNumberNext(offnum); /* move forward */
}
else
{
offnum = FirstOffsetNumber; /* new page */
}
while (offnum > maxoff)
{
/*
* either this page is empty (maxoff ==
* InvalidOffsetNumber) or we ran off the end.
*/
_hash_readnext(rel, &buf, &page, &opaque);
if (BufferIsInvalid(buf))
{ /* end of chain */
if (allbuckets && bucket < metap->hashm_maxbucket)
{
++bucket;
blkno = BUCKET_TO_BLKNO(bucket);
buf = _hash_getbuf(rel, blkno, HASH_READ);
page = BufferGetPage(buf);
_hash_checkpage(page, LH_BUCKET_PAGE);
opaque = (HashPageOpaque) PageGetSpecialPointer(page);
Assert(opaque->hasho_bucket == bucket);
while (PageIsEmpty(page) &&
/*
* either this page is empty (maxoff ==
* InvalidOffsetNumber) or we ran off the end.
*/
_hash_readnext(rel, &buf, &page, &opaque);
if (BufferIsInvalid(buf))
{ /* end of chain */
if (allbuckets && bucket < metap->hashm_maxbucket)
{
++bucket;
blkno = BUCKET_TO_BLKNO(bucket);
buf = _hash_getbuf(rel, blkno, HASH_READ);
page = BufferGetPage(buf);
_hash_checkpage(page, LH_BUCKET_PAGE);
opaque = (HashPageOpaque) PageGetSpecialPointer(page);
Assert(opaque->hasho_bucket == bucket);
while (PageIsEmpty(page) &&
BlockNumberIsValid(opaque->hasho_nextblkno))
{
_hash_readnext(rel, &buf, &page, &opaque);
}
maxoff = PageGetMaxOffsetNumber(page);
offnum = FirstOffsetNumber;
}
else
{
_hash_readnext(rel, &buf, &page, &opaque);
maxoff = offnum = InvalidOffsetNumber;
break; /* while */
}
maxoff = PageGetMaxOffsetNumber(page);
offnum = FirstOffsetNumber;
}
else
{
maxoff = offnum = InvalidOffsetNumber;
break; /* while */
/* _hash_readnext never returns an empty page */
maxoff = PageGetMaxOffsetNumber(page);
offnum = FirstOffsetNumber;
}
}
break;
case BackwardScanDirection:
if (offnum != InvalidOffsetNumber)
{
offnum = OffsetNumberPrev(offnum); /* move back */
}
else
{
/* _hash_readnext never returns an empty page */
maxoff = PageGetMaxOffsetNumber(page);
offnum = FirstOffsetNumber;
offnum = maxoff; /* new page */
}
}
break;
case BackwardScanDirection:
if (offnum != InvalidOffsetNumber)
{
offnum = OffsetNumberPrev(offnum); /* move back */
}
else
{
offnum = maxoff;/* new page */
}
while (offnum < FirstOffsetNumber)
{
while (offnum < FirstOffsetNumber)
{
/*
* either this page is empty (offnum ==
* InvalidOffsetNumber) or we ran off the end.
*/
_hash_readprev(rel, &buf, &page, &opaque);
if (BufferIsInvalid(buf))
{ /* end of chain */
if (allbuckets && bucket > 0)
{
--bucket;
blkno = BUCKET_TO_BLKNO(bucket);
buf = _hash_getbuf(rel, blkno, HASH_READ);
page = BufferGetPage(buf);
_hash_checkpage(page, LH_BUCKET_PAGE);
opaque = (HashPageOpaque) PageGetSpecialPointer(page);
Assert(opaque->hasho_bucket == bucket);
while (BlockNumberIsValid(opaque->hasho_nextblkno))
/*
* either this page is empty (offnum ==
* InvalidOffsetNumber) or we ran off the end.
*/
_hash_readprev(rel, &buf, &page, &opaque);
if (BufferIsInvalid(buf))
{ /* end of chain */
if (allbuckets && bucket > 0)
{
_hash_readnext(rel, &buf, &page, &opaque);
--bucket;
blkno = BUCKET_TO_BLKNO(bucket);
buf = _hash_getbuf(rel, blkno, HASH_READ);
page = BufferGetPage(buf);
_hash_checkpage(page, LH_BUCKET_PAGE);
opaque = (HashPageOpaque) PageGetSpecialPointer(page);
Assert(opaque->hasho_bucket == bucket);
while (BlockNumberIsValid(opaque->hasho_nextblkno))
{
_hash_readnext(rel, &buf, &page, &opaque);
}
maxoff = offnum = PageGetMaxOffsetNumber(page);
}
else
{
maxoff = offnum = InvalidOffsetNumber;
break; /* while */
}
maxoff = offnum = PageGetMaxOffsetNumber(page);
}
else
{
maxoff = offnum = InvalidOffsetNumber;
break; /* while */
/* _hash_readprev never returns an empty page */
maxoff = offnum = PageGetMaxOffsetNumber(page);
}
}
else
{
/* _hash_readprev never returns an empty page */
maxoff = offnum = PageGetMaxOffsetNumber(page);
}
}
break;
default:
/* NoMovementScanDirection */
/* this should not be reached */
break;
break;
default:
/* NoMovementScanDirection */
/* this should not be reached */
break;
}
/* we ran off the end of the world without finding a match */
......
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/Attic/hashstrat.c,v 1.10 1997/09/07 04:38:03 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/Attic/hashstrat.c,v 1.11 1997/09/08 02:20:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -52,12 +52,12 @@ static StrategyEvaluationData HTEvaluationData = {
*/
#ifdef NOT_USED
static StrategyNumber
static StrategyNumber
_hash_getstrat(Relation rel,
AttrNumber attno,
RegProcedure proc)
{
StrategyNumber strat;
StrategyNumber strat;
strat = RelationGetStrategy(rel, attno, &HTEvaluationData, proc);
......@@ -69,7 +69,7 @@ _hash_getstrat(Relation rel,
#endif
#ifdef NOT_USED
static bool
static bool
_hash_invokestrat(Relation rel,
AttrNumber attno,
StrategyNumber strat,
......
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashutil.c,v 1.10 1997/09/07 04:38:04 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashutil.c,v 1.11 1997/09/08 02:20:25 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -28,13 +28,13 @@
ScanKey
_hash_mkscankey(Relation rel, IndexTuple itup, HashMetaPage metap)
{
ScanKey skey;
TupleDesc itupdesc;
int natts;
AttrNumber i;
Datum arg;
RegProcedure proc;
bool null;
ScanKey skey;
TupleDesc itupdesc;
int natts;
AttrNumber i;
Datum arg;
RegProcedure proc;
bool null;
natts = rel->rd_rel->relnatts;
itupdesc = RelationGetTupleDescriptor(rel);
......@@ -73,9 +73,9 @@ _hash_checkqual(IndexScanDesc scan, IndexTuple itup)
HashItem
_hash_formitem(IndexTuple itup)
{
int nbytes_hitem;
HashItem hitem;
Size tuplen;
int nbytes_hitem;
HashItem hitem;
Size tuplen;
/* disallow nulls in hash keys */
if (itup->t_info & INDEX_NULL_MASK)
......@@ -95,9 +95,9 @@ _hash_formitem(IndexTuple itup)
Bucket
_hash_call(Relation rel, HashMetaPage metap, Datum key)
{
uint32 n;
Bucket bucket;
RegProcedure proc;
uint32 n;
Bucket bucket;
RegProcedure proc;
proc = metap->hashm_procid;
n = (uint32) fmgr(proc, key);
......@@ -113,8 +113,8 @@ _hash_call(Relation rel, HashMetaPage metap, Datum key)
uint32
_hash_log2(uint32 num)
{
uint32 i,
limit;
uint32 i,
limit;
limit = 1;
for (i = 0; limit < num; limit = limit << 1, i++)
......@@ -128,7 +128,7 @@ _hash_log2(uint32 num)
void
_hash_checkpage(Page page, int flags)
{
HashPageOpaque opaque;
HashPageOpaque opaque;
Assert(page);
Assert(((PageHeader) (page))->pd_lower >= (sizeof(PageHeaderData) - sizeof(ItemIdData)));
......
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.16 1997/09/07 04:38:09 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.17 1997/09/08 02:20:28 momjian Exp $
*
*
* INTERFACE ROUTINES
......@@ -96,7 +96,7 @@
#include <string.h>
#endif
static bool ImmediateInvalidation;
static bool ImmediateInvalidation;
/* ----------------------------------------------------------------
* heap support routines
......@@ -210,7 +210,7 @@ nextpage(int page, int dir)
* real work in scanning tuples.
* ----------------
*/
static HeapTuple
static HeapTuple
heapgettup(Relation relation,
ItemPointer tid,
int dir,
......@@ -219,14 +219,14 @@ heapgettup(Relation relation,
int nkeys,
ScanKey key)
{
ItemId lpp;
Page dp;
int page;
int pages;
int lines;
HeapTuple rtup;
OffsetNumber lineoff;
int linesleft;
ItemId lpp;
Page dp;
int page;
int pages;
int lines;
HeapTuple rtup;
OffsetNumber lineoff;
int linesleft;
/* ----------------
* increment access statistics
......@@ -432,7 +432,7 @@ heapgettup(Relation relation,
if ((rtup = heap_tuple_satisfies(lpp, relation, *b, (PageHeader) dp,
timeQual, nkeys, key)) != NULL)
{
ItemPointer iptr = &(rtup->t_ctid);
ItemPointer iptr = &(rtup->t_ctid);
if (ItemPointerGetBlockNumber(iptr) != page)
{
......@@ -541,7 +541,7 @@ SetHeapAccessMethodImmediateInvalidation(bool on)
Relation
heap_open(Oid relationId)
{
Relation r;
Relation r;
/* ----------------
* increment access statistics
......@@ -570,7 +570,7 @@ heap_open(Oid relationId)
Relation
heap_openr(char *relationName)
{
Relation r;
Relation r;
/* ----------------
* increment access statistics
......@@ -621,7 +621,7 @@ heap_beginscan(Relation relation,
unsigned nkeys,
ScanKey key)
{
HeapScanDesc sdesc;
HeapScanDesc sdesc;
/* ----------------
* increment access statistics
......@@ -808,7 +808,7 @@ heap_getnext(HeapScanDesc scandesc,
Buffer * b)
{
register HeapScanDesc sdesc = scandesc;
Buffer localb;
Buffer localb;
/* ----------------
* increment access statistics
......@@ -880,7 +880,7 @@ heap_getnext(HeapScanDesc scandesc,
}
else
{ /* NONTUP */
ItemPointer iptr;
ItemPointer iptr;
iptr = (sdesc->rs_ctup != NULL) ?
&(sdesc->rs_ctup->t_ctid) : (ItemPointer) NULL;
......@@ -967,7 +967,7 @@ heap_getnext(HeapScanDesc scandesc,
}
else
{ /* NONTUP */
ItemPointer iptr;
ItemPointer iptr;
iptr = (sdesc->rs_ctup != NULL) ?
&sdesc->rs_ctup->t_ctid : (ItemPointer) NULL;
......@@ -1035,11 +1035,11 @@ heap_fetch(Relation relation,
ItemPointer tid,
Buffer * b)
{
ItemId lp;
Buffer buffer;
PageHeader dp;
HeapTuple tuple;
OffsetNumber offnum;
ItemId lp;
Buffer buffer;
PageHeader dp;
HeapTuple tuple;
OffsetNumber offnum;
/* ----------------
* increment access statistics
......@@ -1203,10 +1203,10 @@ heap_insert(Relation relation, HeapTuple tup)
int
heap_delete(Relation relation, ItemPointer tid)
{
ItemId lp;
HeapTuple tp;
PageHeader dp;
Buffer b;
ItemId lp;
HeapTuple tp;
PageHeader dp;
Buffer b;
/* ----------------
* increment access statistics
......@@ -1313,10 +1313,10 @@ heap_delete(Relation relation, ItemPointer tid)
int
heap_replace(Relation relation, ItemPointer otid, HeapTuple tup)
{
ItemId lp;
HeapTuple tp;
Page dp;
Buffer buffer;
ItemId lp;
HeapTuple tp;
Page dp;
Buffer buffer;
/* ----------------
* increment access statistics
......
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Id: hio.c,v 1.10 1997/09/07 04:38:11 momjian Exp $
* $Id: hio.c,v 1.11 1997/09/08 02:20:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -35,13 +35,13 @@ RelationPutHeapTuple(Relation relation,
BlockNumber blockIndex,
HeapTuple tuple)
{
Buffer buffer;
Page pageHeader;
BlockNumber numberOfBlocks;
OffsetNumber offnum;
unsigned int len;
ItemId itemId;
Item item;
Buffer buffer;
Page pageHeader;
BlockNumber numberOfBlocks;
OffsetNumber offnum;
unsigned int len;
ItemId itemId;
Item item;
/* ----------------
* increment access statistics
......@@ -108,13 +108,13 @@ RelationPutHeapTuple(Relation relation,
void
RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple)
{
Buffer buffer;
Page pageHeader;
BlockNumber lastblock;
OffsetNumber offnum;
unsigned int len;
ItemId itemId;
Item item;
Buffer buffer;
Page pageHeader;
BlockNumber lastblock;
OffsetNumber offnum;
unsigned int len;
ItemId itemId;
Item item;
Assert(RelationIsValid(relation));
Assert(HeapTupleIsValid(tuple));
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment