Commit 1ccd4232 authored by Bruce Momjian's avatar Bruce Momjian

Massive commit to run PGINDENT on all *.c and *.h files.

parent 8fecd4fe
This diff is collapsed.
...@@ -13,86 +13,99 @@ ...@@ -13,86 +13,99 @@
#include "utils/datetime.h" #include "utils/datetime.h"
TimeADT *time_difference(TimeADT * time1, TimeADT * time2) TimeADT *
time_difference(TimeADT * time1, TimeADT * time2)
{ {
TimeADT *result = (TimeADT *) palloc(sizeof(TimeADT)); TimeADT *result = (TimeADT *) palloc(sizeof(TimeADT));
*result = *time1 - *time2;
return (result); *result = *time1 - *time2;
return (result);
} }
TimeADT *currenttime() TimeADT *
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 currentdate() DateADT
currentdate()
{ {
time_t current_time; time_t current_time;
struct tm *tm; struct tm *tm;
DateADT result; DateADT result;
current_time = time(NULL);
tm = localtime(&current_time); current_time = time(NULL);
tm = localtime(&current_time);
result = date2j(tm->tm_year,tm->tm_mon + 1,tm->tm_mday) -
date2j(100,1,1); result = date2j(tm->tm_year, tm->tm_mon + 1, tm->tm_mday) -
return (result); date2j(100, 1, 1);
return (result);
} }
int4 hours(TimeADT * time) int4
hours(TimeADT * time)
{ {
return(*time / (60*60)); return (*time / (60 * 60));
} }
int4 minutes(TimeADT * time) int4
minutes(TimeADT * time)
{ {
return(((int) (*time / 60)) % 60); return (((int) (*time / 60)) % 60);
} }
int4 seconds(TimeADT * time) int4
seconds(TimeADT * time)
{ {
return(((int) *time) % 60); return (((int) *time) % 60);
} }
int4 day(DateADT *date) int4
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 month(DateADT *date) int4
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 year(DateADT *date) int4
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 asminutes(TimeADT * time) int4
asminutes(TimeADT * time)
{ {
int seconds = (int) *time; int seconds = (int) *time;
return (seconds / 60); return (seconds / 60);
} }
int4 asseconds(TimeADT * time) int4
asseconds(TimeADT * time)
{ {
int seconds = (int) *time; int seconds = (int) *time;
return (seconds); return (seconds);
} }
This diff is collapsed.
/* /*
** **
** halt.c ** halt.c
** **
** This is used to print out error messages and exit ** This is used to print out error messages and exit
*/ */
#include <varargs.h> #include <varargs.h>
...@@ -15,44 +15,46 @@ ...@@ -15,44 +15,46 @@
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
** **
** halt - print error message, and call clean up routine or exit ** halt - print error message, and call clean up routine or exit
** **
**------------------------------------------------------------------------*/ **------------------------------------------------------------------------*/
/*VARARGS*/ /*VARARGS*/
void halt(va_alist) void
halt(va_alist)
va_dcl va_dcl
{ {
va_list arg_ptr; va_list arg_ptr;
char *format, *pstr; char *format,
void (*sig_func)(); *pstr;
void (*sig_func) ();
va_start(arg_ptr); va_start(arg_ptr);
format = va_arg(arg_ptr,char *); format = va_arg(arg_ptr, char *);
if (strncmp(format,"PERROR", 6) != 0) if (strncmp(format, "PERROR", 6) != 0)
vfprintf(stderr,format,arg_ptr); vfprintf(stderr, format, arg_ptr);
else else
{ {
for (pstr=format+6; *pstr == ' ' || *pstr == ':'; pstr++) for (pstr = format + 6; *pstr == ' ' || *pstr == ':'; pstr++)
; ;
vfprintf(stderr,pstr,arg_ptr); vfprintf(stderr, pstr, arg_ptr);
perror(""); perror("");
} }
va_end(arg_ptr); va_end(arg_ptr);
fflush(stderr); fflush(stderr);
/* call one clean up function if defined */ /* call one clean up function if defined */
if ( (sig_func = signal(SIGTERM, SIG_DFL)) != SIG_DFL && if ((sig_func = signal(SIGTERM, SIG_DFL)) != SIG_DFL &&
sig_func != SIG_IGN) sig_func != SIG_IGN)
(*sig_func)(0); (*sig_func) (0);
else if ( (sig_func = signal(SIGHUP, SIG_DFL)) != SIG_DFL && else if ((sig_func = signal(SIGHUP, SIG_DFL)) != SIG_DFL &&
sig_func != SIG_IGN) sig_func != SIG_IGN)
(*sig_func)(0); (*sig_func) (0);
else if ( (sig_func = signal(SIGINT, SIG_DFL)) != SIG_DFL && else if ((sig_func = signal(SIGINT, SIG_DFL)) != SIG_DFL &&
sig_func != SIG_IGN) sig_func != SIG_IGN)
(*sig_func)(0); (*sig_func) (0);
else if ( (sig_func = signal(SIGQUIT, SIG_DFL)) != SIG_DFL && else if ((sig_func = signal(SIGQUIT, SIG_DFL)) != SIG_DFL &&
sig_func != SIG_IGN) sig_func != SIG_IGN)
(*sig_func)(0); (*sig_func) (0);
exit(1); exit(1);
} }
...@@ -3,5 +3,4 @@ ...@@ -3,5 +3,4 @@
** **
*/ */
void halt(); void halt();
...@@ -10,20 +10,25 @@ ...@@ -10,20 +10,25 @@
#include "halt.h" #include "halt.h"
#include "pginterface.h" #include "pginterface.h"
int main(int argc, char **argv) int
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], achar16[17], abpchar[11], avarchar[51], atext[51]; char achar[11],
time_t aabstime; achar16[17],
abpchar[11],
avarchar[51],
atext[51];
time_t aabstime;
if (argc != 2) if (argc != 2)
halt("Usage: %s database\n",argv[0]); halt("Usage: %s database\n", argv[0]);
connectdb(argv[1],NULL,NULL,NULL,NULL); connectdb(argv[1], NULL, NULL, NULL, NULL);
on_error_continue(); on_error_continue();
doquery("DROP TABLE testfetch"); doquery("DROP TABLE testfetch");
...@@ -42,9 +47,9 @@ int main(int argc, char **argv) ...@@ -42,9 +47,9 @@ int main(int argc, char **argv)
aabstime abstime) \ aabstime abstime) \
"); ");
while(1) while (1)
{ {
sprintf(query,"INSERT INTO testfetch VALUES ( \ sprintf(query, "INSERT INTO testfetch VALUES ( \
%d, \ %d, \
2322.12, \ 2322.12, \
'923121.0323'::float8, \ '923121.0323'::float8, \
...@@ -55,44 +60,43 @@ int main(int argc, char **argv) ...@@ -55,44 +60,43 @@ int main(int argc, char **argv)
'Ernie', \ 'Ernie', \
'now' )", row); 'now' )", row);
doquery(query); doquery(query);
doquery("BEGIN WORK"); doquery("BEGIN WORK");
doquery("DECLARE c_testfetch BINARY CURSOR FOR \ doquery("DECLARE c_testfetch BINARY CURSOR FOR \
SELECT * FROM testfetch"); SELECT * FROM testfetch");
doquery("FETCH ALL IN c_testfetch"); doquery("FETCH ALL IN c_testfetch");
while (fetch( while (fetch(
&aint, &aint,
&afloat, &afloat,
&adouble, &adouble,
achar, achar,
achar16, achar16,
abpchar, abpchar,
avarchar, avarchar,
atext, atext,
&aabstime) != END_OF_TUPLES) &aabstime) != END_OF_TUPLES)
printf("int %d\nfloat %f\ndouble %f\nchar %s\nchar16 %s\n\ printf("int %d\nfloat %f\ndouble %f\nchar %s\nchar16 %s\n\
bpchar %s\nvarchar %s\ntext %s\nabstime %s", bpchar %s\nvarchar %s\ntext %s\nabstime %s",
aint, aint,
afloat, afloat,
adouble, adouble,
achar, achar,
achar16, achar16,
abpchar, abpchar,
avarchar, avarchar,
atext, atext,
ctime(&aabstime)); ctime(&aabstime));
doquery("CLOSE c_testfetch"); doquery("CLOSE c_testfetch");
doquery("COMMIT WORK"); doquery("COMMIT WORK");
printf("--- %-d rows inserted so far\n",row); printf("--- %-d rows inserted so far\n", row);
row++; row++;
} }
disconnectdb(); disconnectdb();
return 0; return 0;
} }
...@@ -12,77 +12,82 @@ ...@@ -12,77 +12,82 @@
#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, unblock_sigs; static sigset_t block_sigs,
static int tuple; unblock_sigs;
static int tuple;
/* /*
** **
** connectdb - returns PGconn structure ** connectdb - returns PGconn structure
** **
*/ */
PGconn *connectdb( char *dbName, PGconn *
char *pghost, connectdb(char *dbName,
char *pgport, char *pghost,
char *pgoptions, char *pgport,
char *pgtty) char *pgoptions,
char *pgtty)
{ {
/* make a connection to the database */ /* make a connection to the database */
conn = PQsetdb(pghost, pgport, pgoptions, pgtty, dbName); conn = PQsetdb(pghost, pgport, pgoptions, pgtty, dbName);
if (PQstatus(conn) == CONNECTION_BAD) if (PQstatus(conn) == CONNECTION_BAD)
halt("Connection to database '%s' failed.\n%s\n", dbName, halt("Connection to database '%s' failed.\n%s\n", dbName,
PQerrorMessage(conn)); PQerrorMessage(conn));
set_signals(); set_signals();
return conn; return conn;
} }
/* /*
** **
** disconnectdb ** disconnectdb
** **
*/ */
void disconnectdb() void
disconnectdb()
{ {
PQfinish(conn); PQfinish(conn);
} }
/* /*
** **
** doquery - returns PGresult structure ** doquery - returns PGresult structure
** **
*/ */
PGresult *doquery(char *query) PGresult *
doquery(char *query)
{ {
if (res != NULL) if (res != NULL)
PQclear(res); PQclear(res);
sigprocmask(SIG_SETMASK,&block_sigs,NULL); sigprocmask(SIG_SETMASK, &block_sigs, NULL);
res = PQexec(conn, query); res = PQexec(conn, query);
sigprocmask(SIG_SETMASK,&unblock_sigs,NULL); sigprocmask(SIG_SETMASK, &unblock_sigs, NULL);
if (on_error_state == ON_ERROR_STOP && if (on_error_state == ON_ERROR_STOP &&
(res == NULL || (res == NULL ||
PQresultStatus(res) == PGRES_BAD_RESPONSE || PQresultStatus(res) == PGRES_BAD_RESPONSE ||
PQresultStatus(res) == PGRES_NONFATAL_ERROR || PQresultStatus(res) == PGRES_NONFATAL_ERROR ||
PQresultStatus(res) == PGRES_FATAL_ERROR)) PQresultStatus(res) == PGRES_FATAL_ERROR))
{ {
if (res != NULL) if (res != NULL)
fprintf(stderr,"query error: %s\n",PQcmdStatus(res)); fprintf(stderr, "query error: %s\n", PQcmdStatus(res));
else fprintf(stderr,"connection error: %s\n",PQerrorMessage(conn)); else
fprintf(stderr, "connection error: %s\n", PQerrorMessage(conn));
PQfinish(conn); PQfinish(conn);
halt("failed request: %s\n", query); halt("failed request: %s\n", query);
} }
...@@ -92,14 +97,16 @@ PGresult *doquery(char *query) ...@@ -92,14 +97,16 @@ PGresult *doquery(char *query)
/* /*
** **
** fetch - returns tuple number (starts at 0), or the value END_OF_TUPLES ** fetch - returns tuple number (starts at 0), or the value END_OF_TUPLES
** NULL pointers are skipped ** NULL pointers are skipped
** **
*/ */
int fetch(void *param, ...) int
fetch(void *param,...)
{ {
va_list ap; va_list ap;
int arg, num_fields; int arg,
num_fields;
num_fields = PQnfields(res); num_fields = PQnfields(res);
...@@ -113,11 +120,11 @@ int fetch(void *param, ...) ...@@ -113,11 +120,11 @@ int fetch(void *param, ...)
{ {
if (PQfsize(res, arg) == -1) if (PQfsize(res, arg) == -1)
{ {
memcpy(param,PQgetvalue(res,tuple,arg),PQgetlength(res,tuple,arg)); memcpy(param, PQgetvalue(res, tuple, arg), PQgetlength(res, tuple, arg));
((char *)param)[PQgetlength(res,tuple,arg)] = NUL; ((char *) param)[PQgetlength(res, tuple, arg)] = NUL;
} }
else else
memcpy(param,PQgetvalue(res,tuple,arg),PQfsize(res,arg)); memcpy(param, PQgetvalue(res, tuple, arg), PQfsize(res, arg));
} }
param = va_arg(ap, char *); param = va_arg(ap, char *);
} }
...@@ -127,15 +134,17 @@ int fetch(void *param, ...) ...@@ -127,15 +134,17 @@ int fetch(void *param, ...)
/* /*
** **
** fetchwithnulls - returns tuple number (starts at 0), ** fetchwithnulls - returns tuple number (starts at 0),
** or the value END_OF_TUPLES ** or the value END_OF_TUPLES
** Returns true or false into null indicator variables ** Returns true or false into null indicator variables
** NULL pointers are skipped ** NULL pointers are skipped
*/ */
int fetchwithnulls(void *param, ...) int
fetchwithnulls(void *param,...)
{ {
va_list ap; va_list ap;
int arg, num_fields; int arg,
num_fields;
num_fields = PQnfields(res); num_fields = PQnfields(res);
...@@ -149,17 +158,17 @@ int fetchwithnulls(void *param, ...) ...@@ -149,17 +158,17 @@ int fetchwithnulls(void *param, ...)
{ {
if (PQfsize(res, arg) == -1) if (PQfsize(res, arg) == -1)
{ {
memcpy(param,PQgetvalue(res,tuple,arg),PQgetlength(res,tuple,arg)); memcpy(param, PQgetvalue(res, tuple, arg), PQgetlength(res, tuple, arg));
((char *)param)[PQgetlength(res,tuple,arg)] = NUL; ((char *) param)[PQgetlength(res, tuple, arg)] = NUL;
} }
else else
memcpy(param,PQgetvalue(res,tuple,arg),PQfsize(res,arg)); memcpy(param, PQgetvalue(res, tuple, arg), PQfsize(res, arg));
} }
param = va_arg(ap, char *); param = va_arg(ap, char *);
if (PQgetisnull(res,tuple,arg) != 0) if (PQgetisnull(res, tuple, arg) != 0)
*(int *)param = 1; *(int *) param = 1;
else else
*(int *)param = 0; *(int *) param = 0;
param = va_arg(ap, char *); param = va_arg(ap, char *);
} }
va_end(ap); va_end(ap);
...@@ -168,52 +177,56 @@ int fetchwithnulls(void *param, ...) ...@@ -168,52 +177,56 @@ int fetchwithnulls(void *param, ...)
/* /*
** **
** on_error_stop ** on_error_stop
** **
*/ */
void on_error_stop() void
on_error_stop()
{ {
on_error_state = ON_ERROR_STOP; on_error_state = ON_ERROR_STOP;
} }
/* /*
** **
** on_error_continue ** on_error_continue
** **
*/ */
void on_error_continue() void
on_error_continue()
{ {
on_error_state = ON_ERROR_CONTINUE; on_error_state = ON_ERROR_CONTINUE;
} }
/* /*
** **
** sig_disconnect ** sig_disconnect
** **
*/ */
static void sig_disconnect() static void
sig_disconnect()
{ {
fprintf(stderr,"exiting...\n"); fprintf(stderr, "exiting...\n");
PQfinish(conn); PQfinish(conn);
exit(1); exit(1);
} }
/* /*
** **
** set_signals ** set_signals
** **
*/ */
static void set_signals() static void
set_signals()
{ {
sigemptyset(&block_sigs); sigemptyset(&block_sigs);
sigemptyset(&unblock_sigs); sigemptyset(&unblock_sigs);
sigaddset(&block_sigs,SIGTERM); sigaddset(&block_sigs, SIGTERM);
sigaddset(&block_sigs,SIGHUP); sigaddset(&block_sigs, SIGHUP);
sigaddset(&block_sigs,SIGINT); sigaddset(&block_sigs, SIGINT);
/* sigaddset(&block_sigs,SIGQUIT); no block */ /* sigaddset(&block_sigs,SIGQUIT); no block */
sigprocmask(SIG_SETMASK,&unblock_sigs,NULL); sigprocmask(SIG_SETMASK, &unblock_sigs, NULL);
signal(SIGTERM,sig_disconnect); signal(SIGTERM, sig_disconnect);
signal(SIGHUP,sig_disconnect); signal(SIGHUP, sig_disconnect);
signal(SIGINT,sig_disconnect); signal(SIGINT, sig_disconnect);
signal(SIGQUIT,sig_disconnect); signal(SIGQUIT, sig_disconnect);
} }
...@@ -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)
...@@ -12,29 +12,34 @@ ...@@ -12,29 +12,34 @@
#include <libpq-fe.h> #include <libpq-fe.h>
#include <pginterface.h> #include <pginterface.h>
int main(int argc, char **argv) int
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], achar16[17], abpchar[11], avarchar[51], atext[51]; char achar[11],
time_t aabstime; achar16[17],
int aint_null, abpchar[11],
afloat_null, avarchar[51],
adouble_null, atext[51];
achar_null, time_t aabstime;
achar16_null, int aint_null,
abpchar_null, afloat_null,
avarchar_null, adouble_null,
atext_null, achar_null,
aabstime_null; achar16_null,
abpchar_null,
avarchar_null,
atext_null,
aabstime_null;
if (argc != 2) if (argc != 2)
halt("Usage: %s database\n",argv[0]); halt("Usage: %s database\n", argv[0]);
connectdb(argv[1],NULL,NULL,NULL,NULL); connectdb(argv[1], NULL, NULL, NULL, NULL);
on_error_continue(); on_error_continue();
doquery("DROP TABLE testfetch"); doquery("DROP TABLE testfetch");
...@@ -54,7 +59,7 @@ int main(int argc, char **argv) ...@@ -54,7 +59,7 @@ int main(int argc, char **argv)
"); ");
#ifdef TEST_NON_NULLS #ifdef TEST_NON_NULLS
sprintf(query,"INSERT INTO testfetch VALUES ( \ sprintf(query, "INSERT INTO testfetch VALUES ( \
0, \ 0, \
0, \ 0, \
0, \ 0, \
...@@ -65,7 +70,7 @@ int main(int argc, char **argv) ...@@ -65,7 +70,7 @@ int main(int argc, char **argv)
'', \ '', \
'');"); '');");
#else #else
sprintf(query,"INSERT INTO testfetch VALUES ( \ sprintf(query, "INSERT INTO testfetch VALUES ( \
NULL, \ NULL, \
NULL, \ NULL, \
NULL, \ NULL, \
...@@ -85,55 +90,54 @@ int main(int argc, char **argv) ...@@ -85,55 +90,54 @@ int main(int argc, char **argv)
doquery("FETCH ALL IN c_testfetch"); doquery("FETCH ALL IN c_testfetch");
if (fetchwithnulls( if (fetchwithnulls(
&aint, &aint,
&aint_null, &aint_null,
&afloat, &afloat,
&afloat_null, &afloat_null,
&adouble, &adouble,
&adouble_null, &adouble_null,
achar, achar,
&achar_null, &achar_null,
achar16, achar16,
&achar16_null, &achar16_null,
abpchar, abpchar,
&abpchar_null, &abpchar_null,
avarchar, avarchar,
&avarchar_null, &avarchar_null,
atext, atext,
&atext_null, &atext_null,
&aabstime, &aabstime,
&aabstime_null) != END_OF_TUPLES) &aabstime_null) != END_OF_TUPLES)
printf("int %d\nfloat %f\ndouble %f\nchar %s\nchar16 %s\n\ printf("int %d\nfloat %f\ndouble %f\nchar %s\nchar16 %s\n\
bpchar %s\nvarchar %s\ntext %s\nabstime %s\n", bpchar %s\nvarchar %s\ntext %s\nabstime %s\n",
aint, aint,
afloat, afloat,
adouble, adouble,
achar, achar,
achar16, achar16,
abpchar, abpchar,
avarchar, avarchar,
atext, atext,
ctime(&aabstime)); ctime(&aabstime));
printf("NULL:\nint %d\nfloat %d\ndouble %d\nchar %d\nchar16 %d\n\ printf("NULL:\nint %d\nfloat %d\ndouble %d\nchar %d\nchar16 %d\n\
bpchar %d\nvarchar %d\ntext %d\nabstime %d\n", bpchar %d\nvarchar %d\ntext %d\nabstime %d\n",
aint_null, 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);
doquery("CLOSE c_testfetch"); doquery("CLOSE c_testfetch");
doquery("COMMIT WORK"); doquery("COMMIT WORK");
printf("--- %-d rows inserted so far\n",row); printf("--- %-d rows inserted so far\n", row);
row++; row++;
disconnectdb(); disconnectdb();
return 0; return 0;
} }
...@@ -10,17 +10,18 @@ ...@@ -10,17 +10,18 @@
#include <libpq-fe.h> #include <libpq-fe.h>
#include "pginterface.h" #include "pginterface.h"
int main(int argc, char **argv) int
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]);
connectdb(argv[1],NULL,NULL,NULL,NULL); connectdb(argv[1], NULL, NULL, NULL, NULL);
on_error_continue(); on_error_continue();
doquery("DROP TABLE words"); doquery("DROP TABLE words");
on_error_stop(); on_error_stop();
...@@ -35,33 +36,33 @@ int main(int argc, char **argv) ...@@ -35,33 +36,33 @@ int main(int argc, char **argv)
word text_ops )\ word text_ops )\
"); ");
while(1) while (1)
{ {
if (scanf("%s",line) != 1) if (scanf("%s", line) != 1)
break; break;
doquery("BEGIN WORK"); doquery("BEGIN WORK");
sprintf(query,"\ sprintf(query, "\
DECLARE c_words BINARY CURSOR FOR \ DECLARE c_words BINARY CURSOR FOR \
SELECT count(*) \ SELECT count(*) \
FROM words \ FROM words \
WHERE word = '%s'", line); WHERE word = '%s'", line);
doquery(query); doquery(query);
doquery("FETCH ALL IN c_words"); doquery("FETCH ALL IN c_words");
while (fetch(&count) == END_OF_TUPLES) while (fetch(&count) == END_OF_TUPLES)
count = 0; count = 0;
doquery("CLOSE c_words"); doquery("CLOSE c_words");
doquery("COMMIT WORK"); doquery("COMMIT WORK");
if (count == 0) if (count == 0)
sprintf(query,"\ sprintf(query, "\
INSERT INTO words \ INSERT INTO words \
VALUES (1, '%s')", line); VALUES (1, '%s')", line);
else else
sprintf(query,"\ sprintf(query, "\
UPDATE words \ UPDATE words \
SET matches = matches + 1 \ SET matches = matches + 1 \
WHERE word = '%s'", line); WHERE word = '%s'", line);
doquery(query); doquery(query);
row++; row++;
} }
...@@ -69,4 +70,3 @@ int main(int argc, char **argv) ...@@ -69,4 +70,3 @@ int main(int argc, char **argv)
disconnectdb(); disconnectdb();
return 0; return 0;
} }
...@@ -4,80 +4,86 @@ ...@@ -4,80 +4,86 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include "postgres.h" /* for char16, etc. */ #include "postgres.h" /* for char16, etc. */
#include "utils/palloc.h" /* for palloc */ #include "utils/palloc.h" /* for palloc */
#include "libpq-fe.h" /* for TUPLE */ #include "libpq-fe.h" /* for TUPLE */
#include <stdio.h> #include <stdio.h>
#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_soundex(text *t) text *
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);
memcpy(instr,VARDATA(t),VARSIZE(t)-VARHDRSZ); memcpy(instr, VARDATA(t), VARSIZE(t) - VARHDRSZ);
instr[VARSIZE(t)-VARHDRSZ] = (char)0; instr[VARSIZE(t) - VARHDRSZ] = (char) 0;
/* load soundex into outstr */ /* load soundex into outstr */
soundex(instr, outstr); soundex(instr, outstr);
/* Now the outstr contains the soundex of instr */ /* Now the outstr contains the soundex of instr */
/* copy outstr to new_t */ /* copy outstr to new_t */
new_t = (text *) palloc(strlen(outstr)+VARHDRSZ); new_t = (text *) palloc(strlen(outstr) + VARHDRSZ);
memset(new_t, 0, strlen(outstr)+1); memset(new_t, 0, strlen(outstr) + 1);
VARSIZE(new_t) = strlen(outstr)+VARHDRSZ; VARSIZE(new_t) = strlen(outstr) + VARHDRSZ;
memcpy((void *) VARDATA(new_t), memcpy((void *) VARDATA(new_t),
(void *) outstr, (void *) outstr,
strlen(outstr)); strlen(outstr));
/* free instr */ /* free instr */
pfree(instr); pfree(instr);
return(new_t); return (new_t);
} }
char *soundex(char *instr, char *outstr) char *
{ /* ABCDEFGHIJKLMNOPQRSTUVWXYZ */ soundex(char *instr, char *outstr)
char *table = "01230120022455012623010202"; { /* ABCDEFGHIJKLMNOPQRSTUVWXYZ */
int count = 0; char *table = "01230120022455012623010202";
int count = 0;
while(!isalpha(instr[0]) && instr[0])
++instr; while (!isalpha(instr[0]) && instr[0])
++instr;
if(!instr[0]) { /* Hey! Where'd the string go? */
outstr[0]=(char)0; if (!instr[0])
return outstr; { /* Hey! Where'd the string go? */
} outstr[0] = (char) 0;
return outstr;
if(toupper(instr[0]) == 'P' && toupper(instr[1]) == 'H') { }
instr[0] = 'F';
instr[1] = 'A'; if (toupper(instr[0]) == 'P' && toupper(instr[1]) == 'H')
} {
instr[0] = 'F';
*outstr++ = (char)toupper(*instr++); instr[1] = 'A';
}
while(*instr && count < 5) {
if(isalpha(*instr) && *instr != *(instr-1)) { *outstr++ = (char) toupper(*instr++);
*outstr = table[toupper(instr[0]) - 'A'];
if(*outstr != '0') { while (*instr && count < 5)
++outstr; {
++count; if (isalpha(*instr) && *instr != *(instr - 1))
} {
} *outstr = table[toupper(instr[0]) - 'A'];
++instr; if (*outstr != '0')
} {
++outstr;
*outstr = '\0'; ++count;
return(outstr); }
}
++instr;
}
*outstr = '\0';
return (outstr);
} }
This diff is collapsed.
This diff is collapsed.
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* *
* heapvalid.c-- * heapvalid.c--
* heap tuple qualification validity checking code * heap tuple qualification validity checking code
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/heapvalid.c,v 1.16 1997/08/29 09:12:20 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/access/common/Attic/heapvalid.c,v 1.17 1997/09/07 04:37:36 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -25,128 +25,138 @@ ...@@ -25,128 +25,138 @@
#include <utils/builtins.h> #include <utils/builtins.h>
/* ---------------- /* ----------------
* heap_keytest * heap_keytest
* *
* Test a heap tuple with respect to a scan key. * Test a heap tuple with respect to a scan key.
* ---------------- * ----------------
*/ */
bool bool
heap_keytest(HeapTuple t, heap_keytest(HeapTuple t,
TupleDesc tupdesc, TupleDesc tupdesc,
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++)
atp = (Datum)heap_getattr(t, InvalidBuffer, {
keys->sk_attno, atp = (Datum) heap_getattr(t, InvalidBuffer,
tupdesc, keys->sk_attno,
&isnull); tupdesc,
&isnull);
if (isnull)
/* XXX eventually should check if SK_ISNULL */ if (isnull)
return false; /* XXX eventually should check if SK_ISNULL */
return false;
if (keys->sk_flags & SK_ISNULL) {
return (false); if (keys->sk_flags & SK_ISNULL)
{
return (false);
}
if (keys->sk_func == (func_ptr) oideq) /* optimization */
test = (keys->sk_argument == atp);
else if (keys->sk_flags & SK_COMMUTE)
test = (long) FMGR_PTR2(keys->sk_func, keys->sk_procedure,
keys->sk_argument, atp);
else
test = (long) FMGR_PTR2(keys->sk_func, keys->sk_procedure,
atp, keys->sk_argument);
if (!test == !(keys->sk_flags & SK_NEGATE))
return false;
} }
if (keys->sk_func == (func_ptr)oideq) /* optimization */ return true;
test = (keys->sk_argument == atp);
else if (keys->sk_flags & SK_COMMUTE)
test = (long) FMGR_PTR2(keys->sk_func, keys->sk_procedure,
keys->sk_argument, atp);
else
test = (long) FMGR_PTR2(keys->sk_func, keys->sk_procedure,
atp, keys->sk_argument);
if (!test == !(keys->sk_flags & SK_NEGATE))
return false;
}
return true;
} }
/* ---------------- /* ----------------
* heap_tuple_satisfies * heap_tuple_satisfies
* *
* Returns a valid HeapTuple if it satisfies the timequal and keytest. * Returns a valid HeapTuple if it satisfies the timequal and keytest.
* Returns NULL otherwise. Used to be heap_satisifies (sic) which * Returns NULL otherwise. Used to be heap_satisifies (sic) which
* returned a boolean. It now returns a tuple so that we can avoid doing two * returned a boolean. It now returns a tuple so that we can avoid doing two
* PageGetItem's per tuple. * PageGetItem's per tuple.
* *
* Complete check of validity including LP_CTUP and keytest. * Complete check of validity including LP_CTUP and keytest.
* This should perhaps be combined with valid somehow in the * This should perhaps be combined with valid somehow in the
* future. (Also, additional rule tests/time range tests.) * future. (Also, additional rule tests/time range tests.)
* *
* on 8/21/92 mao says: i rearranged the tests here to do keytest before * on 8/21/92 mao says: i rearranged the tests here to do keytest before
* SatisfiesTimeQual. profiling indicated that even for vacuumed relations, * SatisfiesTimeQual. profiling indicated that even for vacuumed relations,
* time qual checking was more expensive than key testing. time qual is * time qual checking was more expensive than key testing. time qual is
* least likely to fail, too. we should really add the time qual test to * least likely to fail, too. we should really add the time qual test to
* the restriction and optimize it in the normal way. this has interactions * the restriction and optimize it in the normal way. this has interactions
* with joey's expensive function work. * with joey's expensive function work.
* ---------------- * ----------------
*/ */
HeapTuple HeapTuple
heap_tuple_satisfies(ItemId itemId, heap_tuple_satisfies(ItemId itemId,
Relation relation, Relation relation,
Buffer buffer, Buffer buffer,
PageHeader disk_page, PageHeader disk_page,
TimeQual qual, TimeQual qual,
int nKeys, int nKeys,
ScanKey key) ScanKey key)
{ {
HeapTuple tuple, result; HeapTuple tuple,
bool res; result;
TransactionId old_tmin, old_tmax; bool res;
TransactionId old_tmin,
if (! ItemIdIsUsed(itemId)) old_tmax;
return NULL;
if (!ItemIdIsUsed(itemId))
tuple = (HeapTuple) PageGetItem((Page) disk_page, itemId); return NULL;
if (key != NULL) tuple = (HeapTuple) PageGetItem((Page) disk_page, itemId);
res = heap_keytest(tuple, RelationGetTupleDescriptor(relation),
nKeys, key); if (key != NULL)
else res = heap_keytest(tuple, RelationGetTupleDescriptor(relation),
res = TRUE; nKeys, key);
else
result = (HeapTuple)NULL; res = TRUE;
if (res) {
if(relation->rd_rel->relkind == RELKIND_UNCATALOGED) { result = (HeapTuple) NULL;
result = tuple; if (res)
} else { {
old_tmin = tuple->t_tmin; if (relation->rd_rel->relkind == RELKIND_UNCATALOGED)
old_tmax = tuple->t_tmax; {
res = HeapTupleSatisfiesTimeQual(tuple,qual); result = tuple;
if(tuple->t_tmin != old_tmin || }
tuple->t_tmax != old_tmax) { else
SetBufferCommitInfoNeedsSave(buffer); {
} old_tmin = tuple->t_tmin;
if(res) { old_tmax = tuple->t_tmax;
result = tuple; res = HeapTupleSatisfiesTimeQual(tuple, qual);
} if (tuple->t_tmin != old_tmin ||
tuple->t_tmax != old_tmax)
{
SetBufferCommitInfoNeedsSave(buffer);
}
if (res)
{
result = tuple;
}
}
} }
}
return result; return result;
} }
/* /*
* TupleUpdatedByCurXactAndCmd() -- Returns true if this tuple has * TupleUpdatedByCurXactAndCmd() -- Returns true if this tuple has
* already been updated once by the current transaction/command * already been updated once by the current transaction/command
* pair. * pair.
*/ */
bool bool
TupleUpdatedByCurXactAndCmd(HeapTuple t) TupleUpdatedByCurXactAndCmd(HeapTuple t)
{ {
if (TransactionIdEquals(t->t_xmax, if (TransactionIdEquals(t->t_xmax,
GetCurrentTransactionId()) && GetCurrentTransactionId()) &&
CommandIdGEScanCommandId (t->t_cmax)) CommandIdGEScanCommandId(t->t_cmax))
return true; return true;
return false; return false;
} }
This diff is collapsed.
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* *
* indexvalid.c-- * indexvalid.c--
* index tuple qualification validity checking code * index tuple qualification validity checking code
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.14 1997/03/18 18:38:19 scrappy Exp $ * $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.15 1997/09/07 04:37:38 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -21,64 +21,70 @@ ...@@ -21,64 +21,70 @@
#include <executor/execdebug.h> #include <executor/execdebug.h>
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
* index scan key qualification code * index scan key qualification code
* ---------------------------------------------------------------- * ----------------------------------------------------------------
*/ */
int NIndexTupleProcessed; int NIndexTupleProcessed;
/* ---------------- /* ----------------
* index_keytest * index_keytest
* *
* old comments * old comments
* May eventually combine with other tests (like timeranges)? * May eventually combine with other tests (like timeranges)?
* Should have Buffer buffer; as an argument and pass it to amgetattr. * Should have Buffer buffer; as an argument and pass it to amgetattr.
* ---------------- * ----------------
*/ */
bool bool
index_keytest(IndexTuple tuple, index_keytest(IndexTuple tuple,
TupleDesc tupdesc, TupleDesc tupdesc,
int scanKeySize, int scanKeySize,
ScanKey key) ScanKey key)
{ {
bool isNull; bool isNull;
Datum datum; Datum datum;
int test; int test;
IncrIndexProcessed();
while (scanKeySize > 0) {
datum = index_getattr(tuple,
key[0].sk_attno,
tupdesc,
&isNull);
if (isNull) {
/* XXX eventually should check if SK_ISNULL */
return (false);
}
if (key[0].sk_flags & SK_ISNULL) {
return (false);
}
if (key[0].sk_flags & SK_COMMUTE) { IncrIndexProcessed();
test = (*(key[0].sk_func))
(DatumGetPointer(key[0].sk_argument), while (scanKeySize > 0)
datum) ? 1 : 0; {
} else { datum = index_getattr(tuple,
test = (*(key[0].sk_func)) key[0].sk_attno,
(datum, tupdesc,
DatumGetPointer(key[0].sk_argument)) ? 1 : 0; &isNull);
}
if (isNull)
if (!test == !(key[0].sk_flags & SK_NEGATE)) { {
return (false); /* XXX eventually should check if SK_ISNULL */
return (false);
}
if (key[0].sk_flags & SK_ISNULL)
{
return (false);
}
if (key[0].sk_flags & SK_COMMUTE)
{
test = (*(key[0].sk_func))
(DatumGetPointer(key[0].sk_argument),
datum) ? 1 : 0;
}
else
{
test = (*(key[0].sk_func))
(datum,
DatumGetPointer(key[0].sk_argument)) ? 1 : 0;
}
if (!test == !(key[0].sk_flags & SK_NEGATE))
{
return (false);
}
scanKeySize -= 1;
key++;
} }
scanKeySize -= 1;
key++;
}
return (true);
}
return (true);
}
This diff is collapsed.
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* *
* scan.c-- * scan.c--
* scan direction and key code * scan direction and key code
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/scankey.c,v 1.9 1996/11/05 07:42:45 scrappy Exp $ * $Header: /cvsroot/pgsql/src/backend/access/common/scankey.c,v 1.10 1997/09/07 04:37:39 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -19,49 +19,49 @@ ...@@ -19,49 +19,49 @@
/* /*
* ScanKeyEntryIsLegal -- * ScanKeyEntryIsLegal --
* True iff the scan key entry is legal. * True iff the scan key entry is legal.
*/ */
#define ScanKeyEntryIsLegal(entry) \ #define ScanKeyEntryIsLegal(entry) \
((bool) (AssertMacro(PointerIsValid(entry)) && \ ((bool) (AssertMacro(PointerIsValid(entry)) && \
AttributeNumberIsValid(entry->sk_attno))) AttributeNumberIsValid(entry->sk_attno)))
/* /*
* ScanKeyEntrySetIllegal -- * ScanKeyEntrySetIllegal --
* Marks a scan key entry as illegal. * Marks a scan key entry as illegal.
*/ */
void void
ScanKeyEntrySetIllegal(ScanKey entry) ScanKeyEntrySetIllegal(ScanKey entry)
{ {
Assert(PointerIsValid(entry)); Assert(PointerIsValid(entry));
entry->sk_flags = 0; /* just in case... */ entry->sk_flags = 0; /* just in case... */
entry->sk_attno = InvalidAttrNumber; entry->sk_attno = InvalidAttrNumber;
entry->sk_procedure = 0; /* should be InvalidRegProcedure */ entry->sk_procedure = 0; /* should be InvalidRegProcedure */
} }
/* /*
* ScanKeyEntryInitialize -- * ScanKeyEntryInitialize --
* Initializes an scan key entry. * Initializes an scan key entry.
* *
* Note: * Note:
* Assumes the scan key entry is valid. * Assumes the scan key entry is valid.
* Assumes the intialized scan key entry will be legal. * Assumes the intialized scan key entry will be legal.
*/ */
void void
ScanKeyEntryInitialize(ScanKey entry, ScanKeyEntryInitialize(ScanKey entry,
bits16 flags, bits16 flags,
AttrNumber attributeNumber, AttrNumber attributeNumber,
RegProcedure procedure, RegProcedure procedure,
Datum argument) Datum argument)
{ {
Assert(PointerIsValid(entry)); Assert(PointerIsValid(entry));
entry->sk_flags = flags; entry->sk_flags = flags;
entry->sk_attno = attributeNumber; entry->sk_attno = attributeNumber;
entry->sk_procedure = procedure; entry->sk_procedure = procedure;
entry->sk_argument = argument; entry->sk_argument = argument;
fmgr_info(procedure, &entry->sk_func, &entry->sk_nargs); fmgr_info(procedure, &entry->sk_func, &entry->sk_nargs);
Assert(ScanKeyEntryIsLegal(entry)); Assert(ScanKeyEntryIsLegal(entry));
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* *
* btstrat.c-- * btstrat.c--
* Srategy map entries for the btree indexed access method * Srategy map entries for the btree indexed access method
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/Attic/hashstrat.c,v 1.9 1997/08/20 02:01:42 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/access/hash/Attic/hashstrat.c,v 1.10 1997/09/07 04:38:03 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
#include <postgres.h> #include <postgres.h>
#include <access/hash.h> #include <access/hash.h>
#include <access/istrat.h> #include <access/istrat.h>
/* /*
* only one valid strategy for hash tables: equality. * only one valid strategy for hash tables: equality.
*/ */
#ifdef NOT_USED #ifdef NOT_USED
static StrategyNumber HTNegate[1] = { static StrategyNumber HTNegate[1] = {
InvalidStrategy InvalidStrategy
}; };
static StrategyNumber HTCommute[1] = { static StrategyNumber HTCommute[1] = {
HTEqualStrategyNumber HTEqualStrategyNumber
}; };
static StrategyNumber HTNegateCommute[1] = { static StrategyNumber HTNegateCommute[1] = {
InvalidStrategy InvalidStrategy
}; };
static StrategyEvaluationData HTEvaluationData = { static StrategyEvaluationData HTEvaluationData = {
/* XXX static for simplicity */ /* XXX static for simplicity */
HTMaxStrategyNumber, HTMaxStrategyNumber,
(StrategyTransformMap)HTNegate, (StrategyTransformMap) HTNegate,
(StrategyTransformMap)HTCommute, (StrategyTransformMap) HTCommute,
(StrategyTransformMap)HTNegateCommute, (StrategyTransformMap) HTNegateCommute,
{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL} {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
}; };
#endif #endif
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
* RelationGetHashStrategy * RelationGetHashStrategy
* ---------------------------------------------------------------- * ----------------------------------------------------------------
*/ */
#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);
Assert(StrategyNumberIsValid(strat)); Assert(StrategyNumberIsValid(strat));
return (strat); return (strat);
} }
#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,
Datum left, Datum left,
Datum right) Datum right)
{ {
return (RelationInvokeStrategy(rel, &HTEvaluationData, attno, strat, return (RelationInvokeStrategy(rel, &HTEvaluationData, attno, strat,
left, right)); left, right));
} }
#endif #endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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