mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Phase 2 of pgindent updates.
Change pg_bsd_indent to follow upstream rules for placement of comments
to the right of code, and remove pgindent hack that caused comments
following #endif to not obey the general rule.
Commit e3860ffa4d
wasn't actually using
the published version of pg_bsd_indent, but a hacked-up version that
tried to minimize the amount of movement of comments to the right of
code. The situation of interest is where such a comment has to be
moved to the right of its default placement at column 33 because there's
code there. BSD indent has always moved right in units of tab stops
in such cases --- but in the previous incarnation, indent was working
in 8-space tab stops, while now it knows we use 4-space tabs. So the
net result is that in about half the cases, such comments are placed
one tab stop left of before. This is better all around: it leaves
more room on the line for comment text, and it means that in such
cases the comment uniformly starts at the next 4-space tab stop after
the code, rather than sometimes one and sometimes two tabs after.
Also, ensure that comments following #endif are indented the same
as comments following other preprocessor commands such as #else.
That inconsistency turns out to have been self-inflicted damage
from a poorly-thought-through post-indent "fixup" in pgindent.
This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.
Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
This commit is contained in:
@@ -75,7 +75,7 @@ typedef BloomPageOpaqueData *BloomPageOpaque;
|
||||
|
||||
/* Preserved page numbers */
|
||||
#define BLOOM_METAPAGE_BLKNO (0)
|
||||
#define BLOOM_HEAD_BLKNO (1) /* first data page */
|
||||
#define BLOOM_HEAD_BLKNO (1) /* first data page */
|
||||
|
||||
/*
|
||||
* We store Bloom signatures as arrays of uint16 words.
|
||||
@@ -101,8 +101,8 @@ typedef struct BloomOptions
|
||||
{
|
||||
int32 vl_len_; /* varlena header (do not touch directly!) */
|
||||
int bloomLength; /* length of signature in words (not bits!) */
|
||||
int bitSize[INDEX_MAX_KEYS]; /* # of bits generated for
|
||||
* each index key */
|
||||
int bitSize[INDEX_MAX_KEYS]; /* # of bits generated for each
|
||||
* index key */
|
||||
} BloomOptions;
|
||||
|
||||
/*
|
||||
|
@@ -42,13 +42,13 @@ typedef struct
|
||||
|
||||
/* Methods */
|
||||
|
||||
bool (*f_gt) (const void *, const void *, FmgrInfo *); /* greater than */
|
||||
bool (*f_ge) (const void *, const void *, FmgrInfo *); /* greater or equal */
|
||||
bool (*f_eq) (const void *, const void *, FmgrInfo *); /* equal */
|
||||
bool (*f_le) (const void *, const void *, FmgrInfo *); /* less or equal */
|
||||
bool (*f_lt) (const void *, const void *, FmgrInfo *); /* less than */
|
||||
int (*f_cmp) (const void *, const void *, FmgrInfo *); /* key compare function */
|
||||
float8 (*f_dist) (const void *, const void *, FmgrInfo *); /* key distance function */
|
||||
bool (*f_gt) (const void *, const void *, FmgrInfo *); /* greater than */
|
||||
bool (*f_ge) (const void *, const void *, FmgrInfo *); /* greater or equal */
|
||||
bool (*f_eq) (const void *, const void *, FmgrInfo *); /* equal */
|
||||
bool (*f_le) (const void *, const void *, FmgrInfo *); /* less or equal */
|
||||
bool (*f_lt) (const void *, const void *, FmgrInfo *); /* less than */
|
||||
int (*f_cmp) (const void *, const void *, FmgrInfo *); /* key compare function */
|
||||
float8 (*f_dist) (const void *, const void *, FmgrInfo *); /* key distance function */
|
||||
} gbtree_ninfo;
|
||||
|
||||
|
||||
|
@@ -488,7 +488,7 @@ gbt_var_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v,
|
||||
|
||||
cur = (char *) DatumGetPointer(entryvec->vector[i].key);
|
||||
ro = gbt_var_key_readable((GBT_VARKEY *) cur);
|
||||
if (ro.lower == ro.upper) /* leaf */
|
||||
if (ro.lower == ro.upper) /* leaf */
|
||||
{
|
||||
sv[svcntr] = gbt_var_leaf2node((GBT_VARKEY *) cur, tinfo, flinfo);
|
||||
arr[i].t = sv[svcntr];
|
||||
|
@@ -40,7 +40,7 @@ typedef struct
|
||||
bool (*f_le) (const void *, const void *, Oid, FmgrInfo *); /* less equal */
|
||||
bool (*f_lt) (const void *, const void *, Oid, FmgrInfo *); /* less than */
|
||||
int32 (*f_cmp) (const void *, const void *, Oid, FmgrInfo *); /* compare */
|
||||
GBT_VARKEY *(*f_l2n) (GBT_VARKEY *, FmgrInfo *flinfo); /* convert leaf to node */
|
||||
GBT_VARKEY *(*f_l2n) (GBT_VARKEY *, FmgrInfo *flinfo); /* convert leaf to node */
|
||||
} gbtree_vinfo;
|
||||
|
||||
|
||||
|
@@ -171,7 +171,7 @@ static double
|
||||
uuid_2_double(const pg_uuid_t *u)
|
||||
{
|
||||
uint64 uu[2];
|
||||
const double two64 = 18446744073709551616.0; /* 2^64 */
|
||||
const double two64 = 18446744073709551616.0; /* 2^64 */
|
||||
|
||||
/* Source data may not be suitably aligned, so copy */
|
||||
memcpy(uu, u->data, UUID_LEN);
|
||||
|
@@ -54,10 +54,10 @@ typedef struct NDBOX
|
||||
#define PG_RETURN_NDBOX(x) PG_RETURN_POINTER(x)
|
||||
|
||||
/* GiST operator strategy numbers */
|
||||
#define CubeKNNDistanceCoord 15 /* ~> */
|
||||
#define CubeKNNDistanceTaxicab 16 /* <#> */
|
||||
#define CubeKNNDistanceEuclid 17 /* <-> */
|
||||
#define CubeKNNDistanceChebyshev 18 /* <=> */
|
||||
#define CubeKNNDistanceCoord 15 /* ~> */
|
||||
#define CubeKNNDistanceTaxicab 16 /* <#> */
|
||||
#define CubeKNNDistanceEuclid 17 /* <-> */
|
||||
#define CubeKNNDistanceChebyshev 18 /* <=> */
|
||||
|
||||
/* in cubescan.l */
|
||||
extern int cube_yylex(void);
|
||||
|
@@ -67,7 +67,7 @@ typedef struct remoteConn
|
||||
{
|
||||
PGconn *conn; /* Hold the remote connection */
|
||||
int openCursorCount; /* The number of open cursors */
|
||||
bool newXactForCursor; /* Opened a transaction for a cursor */
|
||||
bool newXactForCursor; /* Opened a transaction for a cursor */
|
||||
} remoteConn;
|
||||
|
||||
typedef struct storeInfo
|
||||
@@ -1098,7 +1098,7 @@ storeQueryResult(volatile storeInfo *sinfo, PGconn *conn, const char *sql)
|
||||
if (!PQsendQuery(conn, sql))
|
||||
elog(ERROR, "could not send query: %s", pchomp(PQerrorMessage(conn)));
|
||||
|
||||
if (!PQsetSingleRowMode(conn)) /* shouldn't fail */
|
||||
if (!PQsetSingleRowMode(conn)) /* shouldn't fail */
|
||||
elog(ERROR, "failed to set single-row mode for dblink query");
|
||||
|
||||
for (;;)
|
||||
|
@@ -544,13 +544,13 @@ fileGetForeignPaths(PlannerInfo *root,
|
||||
*/
|
||||
add_path(baserel, (Path *)
|
||||
create_foreignscan_path(root, baserel,
|
||||
NULL, /* default pathtarget */
|
||||
NULL, /* default pathtarget */
|
||||
baserel->rows,
|
||||
startup_cost,
|
||||
total_cost,
|
||||
NIL, /* no pathkeys */
|
||||
NULL, /* no outer rel either */
|
||||
NULL, /* no extra plan */
|
||||
NIL, /* no pathkeys */
|
||||
NULL, /* no outer rel either */
|
||||
NULL, /* no extra plan */
|
||||
coptions));
|
||||
|
||||
/*
|
||||
|
@@ -111,7 +111,7 @@ The remaining code is authored by Andrew Dunstan <amdunstan@ncshp.org> and
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#endif /* DMETAPHONE_MAIN */
|
||||
#endif /* DMETAPHONE_MAIN */
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
@@ -197,7 +197,7 @@ dmetaphone_alt(PG_FUNCTION_ARGS)
|
||||
* in a case like this.
|
||||
*/
|
||||
|
||||
#define META_FREE(x) ((void)true) /* pfree((x)) */
|
||||
#define META_FREE(x) ((void)true) /* pfree((x)) */
|
||||
#else /* not defined DMETAPHONE_MAIN */
|
||||
|
||||
/* use the standard malloc library when not running in PostgreSQL */
|
||||
@@ -209,7 +209,7 @@ dmetaphone_alt(PG_FUNCTION_ARGS)
|
||||
(v = (t*)realloc((v),((n)*sizeof(t))))
|
||||
|
||||
#define META_FREE(x) free((x))
|
||||
#endif /* defined DMETAPHONE_MAIN */
|
||||
#endif /* defined DMETAPHONE_MAIN */
|
||||
|
||||
|
||||
|
||||
@@ -977,7 +977,7 @@ DoubleMetaphone(char *str, char **codes)
|
||||
}
|
||||
}
|
||||
|
||||
if (GetAt(original, current + 1) == 'J') /* it could happen! */
|
||||
if (GetAt(original, current + 1) == 'J') /* it could happen! */
|
||||
current += 2;
|
||||
else
|
||||
current += 1;
|
||||
|
@@ -181,7 +181,7 @@ extern Pairs *hstoreArrayToPairs(ArrayType *a, int *npairs);
|
||||
#define HStoreExistsStrategyNumber 9
|
||||
#define HStoreExistsAnyStrategyNumber 10
|
||||
#define HStoreExistsAllStrategyNumber 11
|
||||
#define HStoreOldContainsStrategyNumber 13 /* backwards compatibility */
|
||||
#define HStoreOldContainsStrategyNumber 13 /* backwards compatibility */
|
||||
|
||||
/*
|
||||
* defining HSTORE_POLLUTE_NAMESPACE=0 will prevent use of old function names;
|
||||
@@ -202,4 +202,4 @@ extern Pairs *hstoreArrayToPairs(ArrayType *a, int *npairs);
|
||||
extern int no_such_variable
|
||||
#endif
|
||||
|
||||
#endif /* __HSTORE_H__ */
|
||||
#endif /* __HSTORE_H__ */
|
||||
|
@@ -829,7 +829,7 @@ hstore_from_record(PG_FUNCTION_ARGS)
|
||||
my_extra->ncolumns = ncolumns;
|
||||
}
|
||||
|
||||
Assert(ncolumns <= MaxTupleAttributeNumber); /* thus, no overflow */
|
||||
Assert(ncolumns <= MaxTupleAttributeNumber); /* thus, no overflow */
|
||||
pairs = palloc(ncolumns * sizeof(Pairs));
|
||||
|
||||
if (rec)
|
||||
|
@@ -173,4 +173,4 @@ int compDESC(const void *a, const void *b);
|
||||
(direction) ? compASC : compDESC ); \
|
||||
} while(0)
|
||||
|
||||
#endif /* ___INT_H__ */
|
||||
#endif /* ___INT_H__ */
|
||||
|
@@ -282,7 +282,7 @@ internal_size(int *a, int len)
|
||||
|
||||
for (i = 0; i < len; i += 2)
|
||||
{
|
||||
if (!i || a[i] != a[i - 1]) /* do not count repeated range */
|
||||
if (!i || a[i] != a[i - 1]) /* do not count repeated range */
|
||||
size += a[i + 1] - a[i] + 1;
|
||||
}
|
||||
|
||||
|
@@ -131,7 +131,7 @@ invalidindex:
|
||||
elog(DEBUG1, "index %d is invalid", j);
|
||||
return false;
|
||||
}
|
||||
#endif /* ISN_DEBUG */
|
||||
#endif /* ISN_DEBUG */
|
||||
|
||||
/*----------------------------------------------------------
|
||||
* Formatting and conversion routines.
|
||||
@@ -699,11 +699,11 @@ string2ean(const char *str, bool errorOK, ean13 *result,
|
||||
/* recognize and validate the number: */
|
||||
while (*aux2 && length <= 13)
|
||||
{
|
||||
last = (*(aux2 + 1) == '!' || *(aux2 + 1) == '\0'); /* is the last character */
|
||||
last = (*(aux2 + 1) == '!' || *(aux2 + 1) == '\0'); /* is the last character */
|
||||
digit = (isdigit((unsigned char) *aux2) != 0); /* is current character
|
||||
* a digit? */
|
||||
if (*aux2 == '?' && last) /* automagically calculate check digit
|
||||
* if it's '?' */
|
||||
if (*aux2 == '?' && last) /* automagically calculate check digit if
|
||||
* it's '?' */
|
||||
magic = digit = true;
|
||||
if (length == 0 && (*aux2 == 'M' || *aux2 == 'm'))
|
||||
{
|
||||
@@ -832,8 +832,8 @@ string2ean(const char *str, bool errorOK, ean13 *result,
|
||||
goto eanwrongtype;
|
||||
break;
|
||||
case ISMN:
|
||||
memcpy(buf, "9790", 4); /* this isn't for sure yet, for now
|
||||
* ISMN it's only 9790 */
|
||||
memcpy(buf, "9790", 4); /* this isn't for sure yet, for now ISMN
|
||||
* it's only 9790 */
|
||||
valid = (valid && ((rcheck = checkdig(buf, 13)) == check || magic));
|
||||
break;
|
||||
case ISBN:
|
||||
@@ -1123,7 +1123,7 @@ accept_weak_input(PG_FUNCTION_ARGS)
|
||||
g_weak = PG_GETARG_BOOL(0);
|
||||
#else
|
||||
/* function has no effect */
|
||||
#endif /* ISN_WEAK_MODE */
|
||||
#endif /* ISN_WEAK_MODE */
|
||||
PG_RETURN_BOOL(g_weak);
|
||||
}
|
||||
|
||||
|
@@ -32,4 +32,4 @@ typedef uint64 ean13;
|
||||
|
||||
extern void initialize(void);
|
||||
|
||||
#endif /* ISN_H */
|
||||
#endif /* ISN_H */
|
||||
|
@@ -32,11 +32,11 @@ lo_manage(PG_FUNCTION_ARGS)
|
||||
HeapTuple newtuple; /* The new value for tuple */
|
||||
HeapTuple trigtuple; /* The original value of tuple */
|
||||
|
||||
if (!CALLED_AS_TRIGGER(fcinfo)) /* internal error */
|
||||
if (!CALLED_AS_TRIGGER(fcinfo)) /* internal error */
|
||||
elog(ERROR, "%s: not fired by trigger manager",
|
||||
trigdata->tg_trigger->tgname);
|
||||
|
||||
if (!TRIGGER_FIRED_FOR_ROW(trigdata->tg_event)) /* internal error */
|
||||
if (!TRIGGER_FIRED_FOR_ROW(trigdata->tg_event)) /* internal error */
|
||||
elog(ERROR, "%s: must be fired for row",
|
||||
trigdata->tg_trigger->tgname);
|
||||
|
||||
|
@@ -125,7 +125,7 @@ typedef struct
|
||||
#define OPR 3
|
||||
#define OPEN 4
|
||||
#define CLOSE 5
|
||||
#define VALTRUE 6 /* for stop words */
|
||||
#define VALTRUE 6 /* for stop words */
|
||||
#define VALFALSE 7
|
||||
|
||||
|
||||
|
@@ -302,7 +302,7 @@ ltree_picksplit(PG_FUNCTION_ARGS)
|
||||
for (j = FirstOffsetNumber; j <= maxoff; j = OffsetNumberNext(j))
|
||||
{
|
||||
array[j].index = j;
|
||||
lu = GETENTRY(entryvec, j); /* use as tmp val */
|
||||
lu = GETENTRY(entryvec, j); /* use as tmp val */
|
||||
array[j].r = LTG_GETLNODE(lu);
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ ltree_picksplit(PG_FUNCTION_ARGS)
|
||||
lu_l = lu_r = ru_l = ru_r = NULL;
|
||||
for (j = FirstOffsetNumber; j <= maxoff; j = OffsetNumberNext(j))
|
||||
{
|
||||
lu = GETENTRY(entryvec, array[j].index); /* use as tmp val */
|
||||
lu = GETENTRY(entryvec, array[j].index); /* use as tmp val */
|
||||
if (j <= (maxoff - FirstOffsetNumber + 1) / 2)
|
||||
{
|
||||
v->spl_left[v->spl_nleft] = array[j].index;
|
||||
|
@@ -18,4 +18,4 @@
|
||||
/* in rawpage.c */
|
||||
extern Page get_page_from_raw(bytea *raw_page);
|
||||
|
||||
#endif /* _PAGEINSPECT_H_ */
|
||||
#endif /* _PAGEINSPECT_H_ */
|
||||
|
@@ -66,7 +66,7 @@ pg_buffercache_pages(PG_FUNCTION_ARGS)
|
||||
FuncCallContext *funcctx;
|
||||
Datum result;
|
||||
MemoryContext oldcontext;
|
||||
BufferCachePagesContext *fctx; /* User function context. */
|
||||
BufferCachePagesContext *fctx; /* User function context. */
|
||||
TupleDesc tupledesc;
|
||||
TupleDesc expected_tupledesc;
|
||||
HeapTuple tuple;
|
||||
|
@@ -44,8 +44,8 @@ int maxwaittime = 0; /* how long are we prepared to wait for? */
|
||||
int keepfiles = 0; /* number of WAL files to keep, 0 keep all */
|
||||
int maxretries = 3; /* number of retries on restore command */
|
||||
bool debug = false; /* are we debugging? */
|
||||
bool need_cleanup = false; /* do we need to remove files from
|
||||
* archive? */
|
||||
bool need_cleanup = false; /* do we need to remove files from
|
||||
* archive? */
|
||||
|
||||
#ifndef WIN32
|
||||
static volatile sig_atomic_t signaled = false;
|
||||
@@ -59,8 +59,8 @@ char *restartWALFileName; /* the file from which we can restart restore */
|
||||
char *priorWALFileName; /* the file we need to get from archive */
|
||||
char WALFilePath[MAXPGPATH * 2]; /* the file path including archive */
|
||||
char restoreCommand[MAXPGPATH]; /* run this to restore */
|
||||
char exclusiveCleanupFileName[MAXFNAMELEN]; /* the file we need to
|
||||
* get from archive */
|
||||
char exclusiveCleanupFileName[MAXFNAMELEN]; /* the file we need to get
|
||||
* from archive */
|
||||
|
||||
/*
|
||||
* Two types of failover are supported (smart and fast failover).
|
||||
@@ -582,7 +582,7 @@ main(int argc, char **argv)
|
||||
* There's no way to trigger failover via signal on Windows.
|
||||
*/
|
||||
(void) pqsignal(SIGUSR1, sighandler);
|
||||
(void) pqsignal(SIGINT, sighandler); /* deprecated, use SIGUSR1 */
|
||||
(void) pqsignal(SIGINT, sighandler); /* deprecated, use SIGUSR1 */
|
||||
(void) pqsignal(SIGQUIT, sigquit_handler);
|
||||
#endif
|
||||
|
||||
|
@@ -107,7 +107,7 @@ static const uint32 PGSS_PG_MAJOR_VERSION = PG_VERSION_NUM / 100;
|
||||
#define ASSUMED_LENGTH_INIT 1024 /* initial assumed mean query length */
|
||||
#define USAGE_DECREASE_FACTOR (0.99) /* decreased every entry_dealloc */
|
||||
#define STICKY_DECREASE_FACTOR (0.50) /* factor for sticky entries */
|
||||
#define USAGE_DEALLOC_PERCENT 5 /* free this % of entries at once */
|
||||
#define USAGE_DEALLOC_PERCENT 5 /* free this % of entries at once */
|
||||
|
||||
#define JUMBLE_SIZE 1024 /* query serialization buffer size */
|
||||
|
||||
@@ -146,15 +146,15 @@ typedef struct Counters
|
||||
double sum_var_time; /* sum of variances in execution time in msec */
|
||||
int64 rows; /* total # of retrieved or affected rows */
|
||||
int64 shared_blks_hit; /* # of shared buffer hits */
|
||||
int64 shared_blks_read; /* # of shared disk blocks read */
|
||||
int64 shared_blks_read; /* # of shared disk blocks read */
|
||||
int64 shared_blks_dirtied; /* # of shared disk blocks dirtied */
|
||||
int64 shared_blks_written; /* # of shared disk blocks written */
|
||||
int64 local_blks_hit; /* # of local buffer hits */
|
||||
int64 local_blks_read; /* # of local disk blocks read */
|
||||
int64 local_blks_dirtied; /* # of local disk blocks dirtied */
|
||||
int64 local_blks_written; /* # of local disk blocks written */
|
||||
int64 local_blks_dirtied; /* # of local disk blocks dirtied */
|
||||
int64 local_blks_written; /* # of local disk blocks written */
|
||||
int64 temp_blks_read; /* # of temp blocks read */
|
||||
int64 temp_blks_written; /* # of temp blocks written */
|
||||
int64 temp_blks_written; /* # of temp blocks written */
|
||||
double blk_read_time; /* time spent reading, in msec */
|
||||
double blk_write_time; /* time spent writing, in msec */
|
||||
double usage; /* usage factor */
|
||||
@@ -183,7 +183,7 @@ typedef struct pgssEntry
|
||||
typedef struct pgssSharedState
|
||||
{
|
||||
LWLock *lock; /* protects hashtable search/modification */
|
||||
double cur_median_usage; /* current median usage in hashtable */
|
||||
double cur_median_usage; /* current median usage in hashtable */
|
||||
Size mean_query_len; /* current mean entry text length */
|
||||
slock_t mutex; /* protects following fields only: */
|
||||
Size extent; /* current extent of query file */
|
||||
@@ -940,7 +940,7 @@ pgss_ExecutorEnd(QueryDesc *queryDesc)
|
||||
queryId,
|
||||
queryDesc->plannedstmt->stmt_location,
|
||||
queryDesc->plannedstmt->stmt_len,
|
||||
queryDesc->totaltime->total * 1000.0, /* convert to msec */
|
||||
queryDesc->totaltime->total * 1000.0, /* convert to msec */
|
||||
queryDesc->estate->es_processed,
|
||||
&queryDesc->totaltime->bufusage,
|
||||
NULL);
|
||||
@@ -1337,7 +1337,7 @@ pg_stat_statements_reset(PG_FUNCTION_ARGS)
|
||||
#define PG_STAT_STATEMENTS_COLS_V1_1 18
|
||||
#define PG_STAT_STATEMENTS_COLS_V1_2 19
|
||||
#define PG_STAT_STATEMENTS_COLS_V1_3 23
|
||||
#define PG_STAT_STATEMENTS_COLS 23 /* maximum of above */
|
||||
#define PG_STAT_STATEMENTS_COLS 23 /* maximum of above */
|
||||
|
||||
/*
|
||||
* Retrieve statement statistics.
|
||||
@@ -2967,12 +2967,12 @@ generate_normalized_query(pgssJumbleState *jstate, const char *query,
|
||||
char *norm_query;
|
||||
int query_len = *query_len_p;
|
||||
int i,
|
||||
norm_query_buflen, /* Space allowed for norm_query */
|
||||
norm_query_buflen, /* Space allowed for norm_query */
|
||||
len_to_wrt, /* Length (in bytes) to write */
|
||||
quer_loc = 0, /* Source query byte location */
|
||||
n_quer_loc = 0, /* Normalized query byte location */
|
||||
last_off = 0, /* Offset from start for previous tok */
|
||||
last_tok_len = 0; /* Length (in bytes) of that tok */
|
||||
last_tok_len = 0; /* Length (in bytes) of that tok */
|
||||
|
||||
/*
|
||||
* Get constants' lengths (core system only gives us locations). Note
|
||||
|
@@ -132,4 +132,4 @@ extern TRGM *createTrgmNFA(text *text_re, Oid collation,
|
||||
TrgmPackedGraph **graph, MemoryContext rcontext);
|
||||
extern bool trigramsMatchGraph(TrgmPackedGraph *graph, bool *check);
|
||||
|
||||
#endif /* __TRGM_H__ */
|
||||
#endif /* __TRGM_H__ */
|
||||
|
@@ -450,7 +450,7 @@ struct TrgmPackedGraph
|
||||
* by color trigram number.
|
||||
*/
|
||||
int colorTrigramsCount;
|
||||
int *colorTrigramGroups; /* array of size colorTrigramsCount */
|
||||
int *colorTrigramGroups; /* array of size colorTrigramsCount */
|
||||
|
||||
/*
|
||||
* The states of the simplified NFA. State number 0 is always initial
|
||||
@@ -2350,4 +2350,4 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams)
|
||||
pfree(buf.data);
|
||||
}
|
||||
|
||||
#endif /* TRGM_REGEXP_DEBUG */
|
||||
#endif /* TRGM_REGEXP_DEBUG */
|
||||
|
@@ -734,7 +734,7 @@ px_crypt_des(const char *key, const char *setting)
|
||||
p = output + strlen(output);
|
||||
}
|
||||
else
|
||||
#endif /* !DISABLE_XDES */
|
||||
#endif /* !DISABLE_XDES */
|
||||
{
|
||||
/*
|
||||
* "old"-style: setting - 2 bytes of salt key - only up to the first 8
|
||||
|
@@ -1975,7 +1975,7 @@ mp_int_string_len(mp_int z, mp_size radix)
|
||||
if (radix < MP_MIN_RADIX || radix > MP_MAX_RADIX)
|
||||
return MP_RANGE;
|
||||
|
||||
len = s_outlen(z, radix) + 1; /* for terminator */
|
||||
len = s_outlen(z, radix) + 1; /* for terminator */
|
||||
|
||||
/* Allow for sign marker on negatives */
|
||||
if (MP_SIGN(z) == MP_NEG)
|
||||
@@ -2512,7 +2512,7 @@ s_usub(mp_digit *da, mp_digit *db, mp_digit *dc,
|
||||
/* Subtract corresponding digits and propagate borrow */
|
||||
for (pos = 0; pos < size_b; ++pos, ++da, ++db, ++dc)
|
||||
{
|
||||
w = ((mp_word) MP_DIGIT_MAX + 1 + /* MP_RADIX */
|
||||
w = ((mp_word) MP_DIGIT_MAX + 1 + /* MP_RADIX */
|
||||
(mp_word) *da) - w - (mp_word) *db;
|
||||
|
||||
*dc = LOWER_HALF(w);
|
||||
@@ -2522,7 +2522,7 @@ s_usub(mp_digit *da, mp_digit *db, mp_digit *dc,
|
||||
/* Finish the subtraction for remaining upper digits of da */
|
||||
for ( /* */ ; pos < size_a; ++pos, ++da, ++dc)
|
||||
{
|
||||
w = ((mp_word) MP_DIGIT_MAX + 1 + /* MP_RADIX */
|
||||
w = ((mp_word) MP_DIGIT_MAX + 1 + /* MP_RADIX */
|
||||
(mp_word) *da) - w;
|
||||
|
||||
*dc = LOWER_HALF(w);
|
||||
@@ -2594,10 +2594,10 @@ s_kmul(mp_digit *da, mp_digit *db, mp_digit *dc,
|
||||
* t1 and t2 are initially used as temporaries to compute the inner
|
||||
* product (a1 + a0)(b1 + b0) = a1b1 + a1b0 + a0b1 + a0b0
|
||||
*/
|
||||
carry = s_uadd(da, a_top, t1, bot_size, at_size); /* t1 = a1 + a0 */
|
||||
carry = s_uadd(da, a_top, t1, bot_size, at_size); /* t1 = a1 + a0 */
|
||||
t1[bot_size] = carry;
|
||||
|
||||
carry = s_uadd(db, b_top, t2, bot_size, bt_size); /* t2 = b1 + b0 */
|
||||
carry = s_uadd(db, b_top, t2, bot_size, bt_size); /* t2 = b1 + b0 */
|
||||
t2[bot_size] = carry;
|
||||
|
||||
(void) s_kmul(t1, t2, t3, bot_size + 1, bot_size + 1); /* t3 = t1 * t2 */
|
||||
@@ -2609,7 +2609,7 @@ s_kmul(mp_digit *da, mp_digit *db, mp_digit *dc,
|
||||
ZERO(t1, buf_size);
|
||||
ZERO(t2, buf_size);
|
||||
(void) s_kmul(da, db, t1, bot_size, bot_size); /* t1 = a0 * b0 */
|
||||
(void) s_kmul(a_top, b_top, t2, at_size, bt_size); /* t2 = a1 * b1 */
|
||||
(void) s_kmul(a_top, b_top, t2, at_size, bt_size); /* t2 = a1 * b1 */
|
||||
|
||||
/* Subtract out t1 and t2 to get the inner product */
|
||||
s_usub(t3, t1, t3, buf_size + 2, buf_size);
|
||||
@@ -2692,10 +2692,10 @@ s_ksqr(mp_digit *da, mp_digit *dc, mp_size size_a)
|
||||
t3 = t2 + buf_size;
|
||||
ZERO(t1, 4 * buf_size);
|
||||
|
||||
(void) s_ksqr(da, t1, bot_size); /* t1 = a0 ^ 2 */
|
||||
(void) s_ksqr(a_top, t2, at_size); /* t2 = a1 ^ 2 */
|
||||
(void) s_ksqr(da, t1, bot_size); /* t1 = a0 ^ 2 */
|
||||
(void) s_ksqr(a_top, t2, at_size); /* t2 = a1 ^ 2 */
|
||||
|
||||
(void) s_kmul(da, a_top, t3, bot_size, at_size); /* t3 = a0 * a1 */
|
||||
(void) s_kmul(da, a_top, t3, bot_size, at_size); /* t3 = a0 * a1 */
|
||||
|
||||
/* Quick multiply t3 by 2, shifting left (can't overflow) */
|
||||
{
|
||||
@@ -2782,7 +2782,7 @@ s_usqr(mp_digit *da, mp_digit *dc, mp_size size_a)
|
||||
w = UPPER_HALF(w);
|
||||
if (ov)
|
||||
{
|
||||
w += MP_DIGIT_MAX; /* MP_RADIX */
|
||||
w += MP_DIGIT_MAX; /* MP_RADIX */
|
||||
++w;
|
||||
}
|
||||
}
|
||||
|
@@ -106,9 +106,9 @@ void mp_int_free(mp_int z);
|
||||
|
||||
mp_result mp_int_copy(mp_int a, mp_int c); /* c = a */
|
||||
void mp_int_swap(mp_int a, mp_int c); /* swap a, c */
|
||||
void mp_int_zero(mp_int z); /* z = 0 */
|
||||
mp_result mp_int_abs(mp_int a, mp_int c); /* c = |a| */
|
||||
mp_result mp_int_neg(mp_int a, mp_int c); /* c = -a */
|
||||
void mp_int_zero(mp_int z); /* z = 0 */
|
||||
mp_result mp_int_abs(mp_int a, mp_int c); /* c = |a| */
|
||||
mp_result mp_int_neg(mp_int a, mp_int c); /* c = -a */
|
||||
mp_result mp_int_add(mp_int a, mp_int b, mp_int c); /* c = a + b */
|
||||
mp_result mp_int_add_value(mp_int a, int value, mp_int c);
|
||||
mp_result mp_int_sub(mp_int a, mp_int b, mp_int c); /* c = a - b */
|
||||
@@ -116,23 +116,23 @@ mp_result mp_int_sub_value(mp_int a, int value, mp_int c);
|
||||
mp_result mp_int_mul(mp_int a, mp_int b, mp_int c); /* c = a * b */
|
||||
mp_result mp_int_mul_value(mp_int a, int value, mp_int c);
|
||||
mp_result mp_int_mul_pow2(mp_int a, int p2, mp_int c);
|
||||
mp_result mp_int_sqr(mp_int a, mp_int c); /* c = a * a */
|
||||
mp_result mp_int_sqr(mp_int a, mp_int c); /* c = a * a */
|
||||
|
||||
mp_result mp_int_div(mp_int a, mp_int b, /* q = a / b */
|
||||
mp_result mp_int_div(mp_int a, mp_int b, /* q = a / b */
|
||||
mp_int q, mp_int r); /* r = a % b */
|
||||
mp_result mp_int_div_value(mp_int a, int value, /* q = a / value */
|
||||
mp_int q, int *r); /* r = a % value */
|
||||
mp_result mp_int_div_value(mp_int a, int value, /* q = a / value */
|
||||
mp_int q, int *r); /* r = a % value */
|
||||
mp_result mp_int_div_pow2(mp_int a, int p2, /* q = a / 2^p2 */
|
||||
mp_int q, mp_int r); /* r = q % 2^p2 */
|
||||
mp_result mp_int_mod(mp_int a, mp_int m, mp_int c); /* c = a % m */
|
||||
|
||||
#define mp_int_mod_value(A, V, R) mp_int_div_value((A), (V), 0, (R))
|
||||
mp_result mp_int_expt(mp_int a, int b, mp_int c); /* c = a^b */
|
||||
mp_result mp_int_expt(mp_int a, int b, mp_int c); /* c = a^b */
|
||||
mp_result mp_int_expt_value(int a, int b, mp_int c); /* c = a^b */
|
||||
|
||||
int mp_int_compare(mp_int a, mp_int b); /* a <=> b */
|
||||
int mp_int_compare_unsigned(mp_int a, mp_int b); /* |a| <=> |b| */
|
||||
int mp_int_compare_zero(mp_int z); /* a <=> 0 */
|
||||
int mp_int_compare_unsigned(mp_int a, mp_int b); /* |a| <=> |b| */
|
||||
int mp_int_compare_zero(mp_int z); /* a <=> 0 */
|
||||
int mp_int_compare_value(mp_int z, int value); /* a <=> v */
|
||||
|
||||
/* Returns true if v|a, false otherwise (including errors) */
|
||||
@@ -144,15 +144,15 @@ int mp_int_is_pow2(mp_int z);
|
||||
mp_result mp_int_exptmod(mp_int a, mp_int b, mp_int m,
|
||||
mp_int c); /* c = a^b (mod m) */
|
||||
mp_result mp_int_exptmod_evalue(mp_int a, int value,
|
||||
mp_int m, mp_int c); /* c = a^v (mod m) */
|
||||
mp_int m, mp_int c); /* c = a^v (mod m) */
|
||||
mp_result mp_int_exptmod_bvalue(int value, mp_int b,
|
||||
mp_int m, mp_int c); /* c = v^b (mod m) */
|
||||
mp_int m, mp_int c); /* c = v^b (mod m) */
|
||||
mp_result mp_int_exptmod_known(mp_int a, mp_int b,
|
||||
mp_int m, mp_int mu,
|
||||
mp_int c); /* c = a^b (mod m) */
|
||||
mp_result mp_int_redux_const(mp_int m, mp_int c);
|
||||
|
||||
mp_result mp_int_invmod(mp_int a, mp_int m, mp_int c); /* c = 1/a (mod m) */
|
||||
mp_result mp_int_invmod(mp_int a, mp_int m, mp_int c); /* c = 1/a (mod m) */
|
||||
|
||||
mp_result mp_int_gcd(mp_int a, mp_int b, mp_int c); /* c = gcd(a, b) */
|
||||
|
||||
@@ -207,4 +207,4 @@ void s_print(char *tag, mp_int z);
|
||||
void s_print_buf(char *tag, mp_digit *buf, mp_size num);
|
||||
#endif
|
||||
|
||||
#endif /* end IMATH_H_ */
|
||||
#endif /* end IMATH_H_ */
|
||||
|
@@ -42,11 +42,11 @@
|
||||
/*
|
||||
* System reseeds should be separated at least this much.
|
||||
*/
|
||||
#define SYSTEM_RESEED_MIN (20*60) /* 20 min */
|
||||
#define SYSTEM_RESEED_MIN (20*60) /* 20 min */
|
||||
/*
|
||||
* How often to roll dice.
|
||||
*/
|
||||
#define SYSTEM_RESEED_CHECK_TIME (10*60) /* 10 min */
|
||||
#define SYSTEM_RESEED_CHECK_TIME (10*60) /* 10 min */
|
||||
/*
|
||||
* The chance is x/256 that the reseed happens.
|
||||
*/
|
||||
|
@@ -121,4 +121,4 @@ int pullf_create_mbuf_reader(PullFilter **pf_p, MBuf *mbuf);
|
||||
(dst) = __b; \
|
||||
} while (0)
|
||||
|
||||
#endif /* __PX_MBUF_H */
|
||||
#endif /* __PX_MBUF_H */
|
||||
|
@@ -76,4 +76,4 @@ do { \
|
||||
md5_result((x), (y)); \
|
||||
} while (0)
|
||||
|
||||
#endif /* ! _NETINET6_MD5_H_ */
|
||||
#endif /* ! _NETINET6_MD5_H_ */
|
||||
|
@@ -155,8 +155,8 @@ struct PGP_Context
|
||||
*/
|
||||
int mdc_checked;
|
||||
int corrupt_prefix; /* prefix failed RFC 4880 "quick check" */
|
||||
int unsupported_compr; /* has bzip2 compression */
|
||||
int unexpected_binary; /* binary data seen in text_mode */
|
||||
int unsupported_compr; /* has bzip2 compression */
|
||||
int unexpected_binary; /* binary data seen in text_mode */
|
||||
int in_mdc_pkt;
|
||||
int use_mdcbuf_filter;
|
||||
PX_MD *mdc_ctx;
|
||||
|
@@ -79,4 +79,4 @@ char *px_crypt_des(const char *key, const char *setting);
|
||||
char *px_crypt_md5(const char *pw, const char *salt,
|
||||
char *dst, unsigned dstlen);
|
||||
|
||||
#endif /* _PX_CRYPT_H */
|
||||
#endif /* _PX_CRYPT_H */
|
||||
|
@@ -154,7 +154,7 @@ struct px_hmac
|
||||
struct px_cipher
|
||||
{
|
||||
unsigned (*block_size) (PX_Cipher *c);
|
||||
unsigned (*key_size) (PX_Cipher *c); /* max key len */
|
||||
unsigned (*key_size) (PX_Cipher *c); /* max key len */
|
||||
unsigned (*iv_size) (PX_Cipher *c);
|
||||
|
||||
int (*init) (PX_Cipher *c, const uint8 *key, unsigned klen, const uint8 *iv);
|
||||
@@ -239,4 +239,4 @@ void px_debug(const char *fmt,...) pg_attribute_printf(1, 2);
|
||||
(c)->decrypt(c, data, dlen, res, rlen)
|
||||
#define px_combo_free(c) (c)->free(c)
|
||||
|
||||
#endif /* __PX_H */
|
||||
#endif /* __PX_H */
|
||||
|
@@ -97,7 +97,7 @@ static u4byte il_tab[4][256];
|
||||
#endif
|
||||
|
||||
static u4byte tab_gen = 0;
|
||||
#endif /* !PRE_CALC_TABLES */
|
||||
#endif /* !PRE_CALC_TABLES */
|
||||
|
||||
#define ff_mult(a,b) ((a) && (b) ? pow_tab[(log_tab[a] + log_tab[b]) % 255] : 0)
|
||||
|
||||
@@ -250,7 +250,7 @@ gen_tabs(void)
|
||||
}
|
||||
|
||||
tab_gen = 1;
|
||||
#endif /* !PRE_CALC_TABLES */
|
||||
#endif /* !PRE_CALC_TABLES */
|
||||
}
|
||||
|
||||
|
||||
|
@@ -56,4 +56,4 @@ void aes_ecb_decrypt(rijndael_ctx *ctx, uint8 *data, unsigned len);
|
||||
void aes_cbc_encrypt(rijndael_ctx *ctx, uint8 *iva, uint8 *data, unsigned len);
|
||||
void aes_cbc_decrypt(rijndael_ctx *ctx, uint8 *iva, uint8 *data, unsigned len);
|
||||
|
||||
#endif /* _RIJNDAEL_H_ */
|
||||
#endif /* _RIJNDAEL_H_ */
|
||||
|
@@ -72,4 +72,4 @@ typedef struct sha1_ctxt SHA1_CTX;
|
||||
|
||||
#define SHA1_RESULTLEN (160/8)
|
||||
|
||||
#endif /* _NETINET6_SHA1_H_ */
|
||||
#endif /* _NETINET6_SHA1_H_ */
|
||||
|
@@ -333,7 +333,7 @@ pgstatindex_impl(Relation rel, FunctionCallInfo fcinfo)
|
||||
values[j++] = psprintf("%d", indexStat.version);
|
||||
values[j++] = psprintf("%d", indexStat.level);
|
||||
values[j++] = psprintf(INT64_FORMAT,
|
||||
(1 + /* include the metapage in index_size */
|
||||
(1 + /* include the metapage in index_size */
|
||||
indexStat.leaf_pages +
|
||||
indexStat.internal_pages +
|
||||
indexStat.deleted_pages +
|
||||
|
@@ -258,7 +258,7 @@ is_valid_option(const char *keyword, Oid context)
|
||||
{
|
||||
PgFdwOption *opt;
|
||||
|
||||
Assert(postgres_fdw_options); /* must be initialized already */
|
||||
Assert(postgres_fdw_options); /* must be initialized already */
|
||||
|
||||
for (opt = postgres_fdw_options; opt->keyword; opt++)
|
||||
{
|
||||
@@ -277,7 +277,7 @@ is_libpq_option(const char *keyword)
|
||||
{
|
||||
PgFdwOption *opt;
|
||||
|
||||
Assert(postgres_fdw_options); /* must be initialized already */
|
||||
Assert(postgres_fdw_options); /* must be initialized already */
|
||||
|
||||
for (opt = postgres_fdw_options; opt->keyword; opt++)
|
||||
{
|
||||
|
@@ -899,14 +899,14 @@ postgresGetForeignPaths(PlannerInfo *root,
|
||||
* to estimate cost and size of this path.
|
||||
*/
|
||||
path = create_foreignscan_path(root, baserel,
|
||||
NULL, /* default pathtarget */
|
||||
NULL, /* default pathtarget */
|
||||
fpinfo->rows,
|
||||
fpinfo->startup_cost,
|
||||
fpinfo->total_cost,
|
||||
NIL, /* no pathkeys */
|
||||
NULL, /* no outer rel either */
|
||||
NULL, /* no extra plan */
|
||||
NIL); /* no fdw_private list */
|
||||
NULL, /* no outer rel either */
|
||||
NULL, /* no extra plan */
|
||||
NIL); /* no fdw_private list */
|
||||
add_path(baserel, (Path *) path);
|
||||
|
||||
/* Add paths with pathkeys */
|
||||
@@ -1075,7 +1075,7 @@ postgresGetForeignPaths(PlannerInfo *root,
|
||||
rows,
|
||||
startup_cost,
|
||||
total_cost,
|
||||
NIL, /* no pathkeys */
|
||||
NIL, /* no pathkeys */
|
||||
param_info->ppi_req_outer,
|
||||
NULL,
|
||||
NIL); /* no fdw_private list */
|
||||
@@ -1591,7 +1591,7 @@ postgresPlanForeignModify(PlannerInfo *root,
|
||||
/* bit numbers are offset by FirstLowInvalidHeapAttributeNumber */
|
||||
AttrNumber attno = col + FirstLowInvalidHeapAttributeNumber;
|
||||
|
||||
if (attno <= InvalidAttrNumber) /* shouldn't happen */
|
||||
if (attno <= InvalidAttrNumber) /* shouldn't happen */
|
||||
elog(ERROR, "system-column update is not supported");
|
||||
targetAttrs = lappend_int(targetAttrs, attno);
|
||||
}
|
||||
@@ -2173,7 +2173,7 @@ postgresPlanDirectModify(PlannerInfo *root,
|
||||
AttrNumber attno = col + FirstLowInvalidHeapAttributeNumber;
|
||||
TargetEntry *tle;
|
||||
|
||||
if (attno <= InvalidAttrNumber) /* shouldn't happen */
|
||||
if (attno <= InvalidAttrNumber) /* shouldn't happen */
|
||||
elog(ERROR, "system-column update is not supported");
|
||||
|
||||
tle = get_tle_by_resno(subplan->targetlist, attno);
|
||||
@@ -4305,7 +4305,7 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
|
||||
* Note that since this joinrel is at the end of the join_rel_list list
|
||||
* when we are called, we can get the position by list_length.
|
||||
*/
|
||||
Assert(fpinfo->relation_index == 0); /* shouldn't be set yet */
|
||||
Assert(fpinfo->relation_index == 0); /* shouldn't be set yet */
|
||||
fpinfo->relation_index =
|
||||
list_length(root->parse->rtable) + list_length(root->join_rel_list);
|
||||
|
||||
@@ -4316,7 +4316,7 @@ static void
|
||||
add_paths_with_pathkeys_for_rel(PlannerInfo *root, RelOptInfo *rel,
|
||||
Path *epq_path)
|
||||
{
|
||||
List *useful_pathkeys_list = NIL; /* List of all pathkeys */
|
||||
List *useful_pathkeys_list = NIL; /* List of all pathkeys */
|
||||
ListCell *lc;
|
||||
|
||||
useful_pathkeys_list = get_useful_pathkeys_for_relation(root, rel);
|
||||
@@ -4568,7 +4568,7 @@ postgresGetForeignJoinPaths(PlannerInfo *root,
|
||||
rows,
|
||||
startup_cost,
|
||||
total_cost,
|
||||
NIL, /* no pathkeys */
|
||||
NIL, /* no pathkeys */
|
||||
NULL, /* no required_outer */
|
||||
epq_path,
|
||||
NIL); /* no fdw_private */
|
||||
|
@@ -182,4 +182,4 @@ extern bool is_builtin(Oid objectId);
|
||||
extern bool is_shippable(Oid objectId, Oid classId, PgFdwRelationInfo *fpinfo);
|
||||
extern const char *get_jointype_name(JoinType jointype);
|
||||
|
||||
#endif /* POSTGRES_FDW_H */
|
||||
#endif /* POSTGRES_FDW_H */
|
||||
|
@@ -68,10 +68,10 @@ static fmgr_hook_type next_fmgr_hook = NULL;
|
||||
* labels were set during the (sub-)transactions.
|
||||
*/
|
||||
static char *client_label_peer = NULL; /* set by getpeercon(3) */
|
||||
static List *client_label_pending = NIL; /* pending list being set by
|
||||
* sepgsql_setcon() */
|
||||
static char *client_label_committed = NULL; /* set by sepgsql_setcon(),
|
||||
* and already committed */
|
||||
static List *client_label_pending = NIL; /* pending list being set by
|
||||
* sepgsql_setcon() */
|
||||
static char *client_label_committed = NULL; /* set by sepgsql_setcon(), and
|
||||
* already committed */
|
||||
static char *client_label_func = NULL; /* set by trusted procedure */
|
||||
|
||||
typedef struct
|
||||
|
@@ -324,4 +324,4 @@ extern void sepgsql_proc_relabel(Oid functionId, const char *seclabel);
|
||||
extern void sepgsql_proc_setattr(Oid functionId);
|
||||
extern void sepgsql_proc_execute(Oid functionId);
|
||||
|
||||
#endif /* SEPGSQL_H */
|
||||
#endif /* SEPGSQL_H */
|
||||
|
@@ -248,7 +248,7 @@ check_foreign_key(PG_FUNCTION_ARGS)
|
||||
Datum *kvals; /* key values */
|
||||
char *relname; /* referencing relation name */
|
||||
Relation rel; /* triggered relation */
|
||||
HeapTuple trigtuple = NULL; /* tuple to being changed */
|
||||
HeapTuple trigtuple = NULL; /* tuple to being changed */
|
||||
HeapTuple newtuple = NULL; /* tuple to return */
|
||||
TupleDesc tupdesc; /* tuple description */
|
||||
EPlan *plan; /* prepared plan(s) */
|
||||
|
@@ -85,7 +85,7 @@ timetravel(PG_FUNCTION_ARGS)
|
||||
Trigger *trigger; /* to get trigger name */
|
||||
int argc;
|
||||
char **args; /* arguments */
|
||||
int attnum[MaxAttrNum]; /* fnumbers of start/stop columns */
|
||||
int attnum[MaxAttrNum]; /* fnumbers of start/stop columns */
|
||||
Datum oldtimeon,
|
||||
oldtimeoff;
|
||||
Datum newtimeon,
|
||||
|
@@ -1187,8 +1187,8 @@ connectby(char *relname,
|
||||
branch_delim,
|
||||
start_with,
|
||||
start_with, /* current_branch */
|
||||
0, /* initial level is 0 */
|
||||
&serial, /* initial serial is 1 */
|
||||
0, /* initial level is 0 */
|
||||
&serial, /* initial serial is 1 */
|
||||
max_depth,
|
||||
show_branch,
|
||||
show_serial,
|
||||
|
@@ -36,4 +36,4 @@
|
||||
|
||||
#include "fmgr.h"
|
||||
|
||||
#endif /* TABLEFUNC_H */
|
||||
#endif /* TABLEFUNC_H */
|
||||
|
@@ -132,7 +132,7 @@ triggered_change_notification(PG_FUNCTION_ARGS)
|
||||
Form_pg_index index;
|
||||
|
||||
indexTuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexoid));
|
||||
if (!HeapTupleIsValid(indexTuple)) /* should not happen */
|
||||
if (!HeapTupleIsValid(indexTuple)) /* should not happen */
|
||||
elog(ERROR, "cache lookup failed for index %u", indexoid);
|
||||
index = (Form_pg_index) GETSTRUCT(indexTuple);
|
||||
/* we're only interested if it is the primary key and valid */
|
||||
@@ -175,5 +175,5 @@ triggered_change_notification(PG_FUNCTION_ARGS)
|
||||
(errcode(ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED),
|
||||
errmsg("triggered_change_notification: must be called on a table with a primary key")));
|
||||
|
||||
return PointerGetDatum(NULL); /* after trigger; value doesn't matter */
|
||||
return PointerGetDatum(NULL); /* after trigger; value doesn't matter */
|
||||
}
|
||||
|
@@ -110,7 +110,7 @@ do { \
|
||||
uu.clock_seq_hi_and_reserved |= 0x80; \
|
||||
} while(0)
|
||||
|
||||
#endif /* !HAVE_UUID_OSSP */
|
||||
#endif /* !HAVE_UUID_OSSP */
|
||||
|
||||
PG_MODULE_MAGIC;
|
||||
|
||||
@@ -398,7 +398,7 @@ uuid_generate_internal(int v, unsigned char *ns, char *ptr, int len)
|
||||
return DirectFunctionCall1(uuid_in, CStringGetDatum(strbuf));
|
||||
}
|
||||
|
||||
#endif /* HAVE_UUID_OSSP */
|
||||
#endif /* HAVE_UUID_OSSP */
|
||||
|
||||
|
||||
Datum
|
||||
|
@@ -95,7 +95,7 @@ PG_FUNCTION_INFO_V1(xml_is_well_formed);
|
||||
Datum
|
||||
xml_is_well_formed(PG_FUNCTION_ARGS)
|
||||
{
|
||||
text *t = PG_GETARG_TEXT_PP(0); /* document buffer */
|
||||
text *t = PG_GETARG_TEXT_PP(0); /* document buffer */
|
||||
bool result = false;
|
||||
int32 docsize = VARSIZE_ANY_EXHDR(t);
|
||||
xmlDocPtr doctree;
|
||||
@@ -249,7 +249,7 @@ Datum
|
||||
xpath_nodeset(PG_FUNCTION_ARGS)
|
||||
{
|
||||
text *document = PG_GETARG_TEXT_PP(0);
|
||||
text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */
|
||||
text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */
|
||||
xmlChar *toptag = pgxml_texttoxmlchar(PG_GETARG_TEXT_PP(2));
|
||||
xmlChar *septag = pgxml_texttoxmlchar(PG_GETARG_TEXT_PP(3));
|
||||
xmlChar *xpath;
|
||||
@@ -282,7 +282,7 @@ Datum
|
||||
xpath_list(PG_FUNCTION_ARGS)
|
||||
{
|
||||
text *document = PG_GETARG_TEXT_PP(0);
|
||||
text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */
|
||||
text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */
|
||||
xmlChar *plainsep = pgxml_texttoxmlchar(PG_GETARG_TEXT_PP(2));
|
||||
xmlChar *xpath;
|
||||
text *xpres;
|
||||
@@ -311,7 +311,7 @@ Datum
|
||||
xpath_string(PG_FUNCTION_ARGS)
|
||||
{
|
||||
text *document = PG_GETARG_TEXT_PP(0);
|
||||
text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */
|
||||
text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */
|
||||
xmlChar *xpath;
|
||||
int32 pathsize;
|
||||
text *xpres;
|
||||
@@ -352,7 +352,7 @@ Datum
|
||||
xpath_number(PG_FUNCTION_ARGS)
|
||||
{
|
||||
text *document = PG_GETARG_TEXT_PP(0);
|
||||
text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */
|
||||
text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */
|
||||
xmlChar *xpath;
|
||||
float4 fRes;
|
||||
xmlXPathObjectPtr res;
|
||||
@@ -384,7 +384,7 @@ Datum
|
||||
xpath_bool(PG_FUNCTION_ARGS)
|
||||
{
|
||||
text *document = PG_GETARG_TEXT_PP(0);
|
||||
text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */
|
||||
text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */
|
||||
xmlChar *xpath;
|
||||
int bRes;
|
||||
xmlXPathObjectPtr res;
|
||||
|
@@ -29,7 +29,7 @@
|
||||
#include <libxslt/security.h>
|
||||
#include <libxslt/transform.h>
|
||||
#include <libxslt/xsltutils.h>
|
||||
#endif /* USE_LIBXSLT */
|
||||
#endif /* USE_LIBXSLT */
|
||||
|
||||
|
||||
#ifdef USE_LIBXSLT
|
||||
@@ -39,7 +39,7 @@ extern PgXmlErrorContext *pgxml_parser_init(PgXmlStrictness strictness);
|
||||
|
||||
/* local defs */
|
||||
static const char **parse_params(text *paramstr);
|
||||
#endif /* USE_LIBXSLT */
|
||||
#endif /* USE_LIBXSLT */
|
||||
|
||||
|
||||
PG_FUNCTION_INFO_V1(xslt_process);
|
||||
@@ -189,7 +189,7 @@ xslt_process(PG_FUNCTION_ARGS)
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("xslt_process() is not available without libxslt")));
|
||||
PG_RETURN_NULL();
|
||||
#endif /* USE_LIBXSLT */
|
||||
#endif /* USE_LIBXSLT */
|
||||
}
|
||||
|
||||
#ifdef USE_LIBXSLT
|
||||
@@ -253,4 +253,4 @@ parse_params(text *paramstr)
|
||||
return params;
|
||||
}
|
||||
|
||||
#endif /* USE_LIBXSLT */
|
||||
#endif /* USE_LIBXSLT */
|
||||
|
Reference in New Issue
Block a user