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