mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Phase 2 pgindent run for v12.
Switch to 2.1 version of pg_bsd_indent. This formats multiline function declarations "correctly", that is with additional lines of parameter declarations indented to match where the first line's left parenthesis is. Discussion: https://postgr.es/m/CAEepm=0P3FeTXRcU5B2W3jv3PgRVZ-kGUXLGfd42FFhUROO3ug@mail.gmail.com
This commit is contained in:
@ -126,45 +126,45 @@ PG_FUNCTION_INFO_V1(bt_index_check);
|
||||
PG_FUNCTION_INFO_V1(bt_index_parent_check);
|
||||
|
||||
static void bt_index_check_internal(Oid indrelid, bool parentcheck,
|
||||
bool heapallindexed, bool rootdescend);
|
||||
bool heapallindexed, bool rootdescend);
|
||||
static inline void btree_index_checkable(Relation rel);
|
||||
static void bt_check_every_level(Relation rel, Relation heaprel,
|
||||
bool heapkeyspace, bool readonly, bool heapallindexed,
|
||||
bool rootdescend);
|
||||
bool heapkeyspace, bool readonly, bool heapallindexed,
|
||||
bool rootdescend);
|
||||
static BtreeLevel bt_check_level_from_leftmost(BtreeCheckState *state,
|
||||
BtreeLevel level);
|
||||
BtreeLevel level);
|
||||
static void bt_target_page_check(BtreeCheckState *state);
|
||||
static BTScanInsert bt_right_page_check_scankey(BtreeCheckState *state);
|
||||
static void bt_downlink_check(BtreeCheckState *state, BTScanInsert targetkey,
|
||||
BlockNumber childblock);
|
||||
BlockNumber childblock);
|
||||
static void bt_downlink_missing_check(BtreeCheckState *state);
|
||||
static void bt_tuple_present_callback(Relation index, HeapTuple htup,
|
||||
Datum *values, bool *isnull,
|
||||
bool tupleIsAlive, void *checkstate);
|
||||
Datum *values, bool *isnull,
|
||||
bool tupleIsAlive, void *checkstate);
|
||||
static IndexTuple bt_normalize_tuple(BtreeCheckState *state,
|
||||
IndexTuple itup);
|
||||
IndexTuple itup);
|
||||
static bool bt_rootdescend(BtreeCheckState *state, IndexTuple itup);
|
||||
static inline bool offset_is_negative_infinity(BTPageOpaque opaque,
|
||||
OffsetNumber offset);
|
||||
OffsetNumber offset);
|
||||
static inline bool invariant_l_offset(BtreeCheckState *state, BTScanInsert key,
|
||||
OffsetNumber upperbound);
|
||||
OffsetNumber upperbound);
|
||||
static inline bool invariant_leq_offset(BtreeCheckState *state,
|
||||
BTScanInsert key,
|
||||
OffsetNumber upperbound);
|
||||
BTScanInsert key,
|
||||
OffsetNumber upperbound);
|
||||
static inline bool invariant_g_offset(BtreeCheckState *state, BTScanInsert key,
|
||||
OffsetNumber lowerbound);
|
||||
OffsetNumber lowerbound);
|
||||
static inline bool invariant_l_nontarget_offset(BtreeCheckState *state,
|
||||
BTScanInsert key,
|
||||
BlockNumber nontargetblock,
|
||||
Page nontarget,
|
||||
OffsetNumber upperbound);
|
||||
BTScanInsert key,
|
||||
BlockNumber nontargetblock,
|
||||
Page nontarget,
|
||||
OffsetNumber upperbound);
|
||||
static Page palloc_btree_page(BtreeCheckState *state, BlockNumber blocknum);
|
||||
static inline BTScanInsert bt_mkscankey_pivotsearch(Relation rel,
|
||||
IndexTuple itup);
|
||||
IndexTuple itup);
|
||||
static ItemId PageGetItemIdCareful(BtreeCheckState *state, BlockNumber block,
|
||||
Page page, OffsetNumber offset);
|
||||
Page page, OffsetNumber offset);
|
||||
static inline ItemPointer BTreeTupleGetHeapTIDCareful(BtreeCheckState *state,
|
||||
IndexTuple itup, bool nonpivot);
|
||||
IndexTuple itup, bool nonpivot);
|
||||
|
||||
/*
|
||||
* bt_index_check(index regclass, heapallindexed boolean)
|
||||
|
@ -77,8 +77,8 @@ void _PG_fini(void);
|
||||
|
||||
static void explain_ExecutorStart(QueryDesc *queryDesc, int eflags);
|
||||
static void explain_ExecutorRun(QueryDesc *queryDesc,
|
||||
ScanDirection direction,
|
||||
uint64 count, bool execute_once);
|
||||
ScanDirection direction,
|
||||
uint64 count, bool execute_once);
|
||||
static void explain_ExecutorFinish(QueryDesc *queryDesc);
|
||||
static void explain_ExecutorEnd(QueryDesc *queryDesc);
|
||||
|
||||
|
@ -189,26 +189,26 @@ extern bool blvalidate(Oid opclassoid);
|
||||
|
||||
/* index access method interface functions */
|
||||
extern bool blinsert(Relation index, Datum *values, bool *isnull,
|
||||
ItemPointer ht_ctid, Relation heapRel,
|
||||
IndexUniqueCheck checkUnique,
|
||||
struct IndexInfo *indexInfo);
|
||||
ItemPointer ht_ctid, Relation heapRel,
|
||||
IndexUniqueCheck checkUnique,
|
||||
struct IndexInfo *indexInfo);
|
||||
extern IndexScanDesc blbeginscan(Relation r, int nkeys, int norderbys);
|
||||
extern int64 blgetbitmap(IndexScanDesc scan, TIDBitmap *tbm);
|
||||
extern void blrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys,
|
||||
ScanKey orderbys, int norderbys);
|
||||
ScanKey orderbys, int norderbys);
|
||||
extern void blendscan(IndexScanDesc scan);
|
||||
extern IndexBuildResult *blbuild(Relation heap, Relation index,
|
||||
struct IndexInfo *indexInfo);
|
||||
struct IndexInfo *indexInfo);
|
||||
extern void blbuildempty(Relation index);
|
||||
extern IndexBulkDeleteResult *blbulkdelete(IndexVacuumInfo *info,
|
||||
IndexBulkDeleteResult *stats, IndexBulkDeleteCallback callback,
|
||||
void *callback_state);
|
||||
IndexBulkDeleteResult *stats, IndexBulkDeleteCallback callback,
|
||||
void *callback_state);
|
||||
extern IndexBulkDeleteResult *blvacuumcleanup(IndexVacuumInfo *info,
|
||||
IndexBulkDeleteResult *stats);
|
||||
IndexBulkDeleteResult *stats);
|
||||
extern bytea *bloptions(Datum reloptions, bool validate);
|
||||
extern void blcostestimate(PlannerInfo *root, IndexPath *path,
|
||||
double loop_count, Cost *indexStartupCost,
|
||||
Cost *indexTotalCost, Selectivity *indexSelectivity,
|
||||
double *indexCorrelation, double *indexPages);
|
||||
double loop_count, Cost *indexStartupCost,
|
||||
Cost *indexTotalCost, Selectivity *indexSelectivity,
|
||||
double *indexCorrelation, double *indexPages);
|
||||
|
||||
#endif
|
||||
|
@ -110,26 +110,26 @@ do { \
|
||||
extern Interval *abs_interval(Interval *a);
|
||||
|
||||
extern bool gbt_num_consistent(const GBT_NUMKEY_R *key, const void *query,
|
||||
const StrategyNumber *strategy, bool is_leaf,
|
||||
const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
|
||||
const StrategyNumber *strategy, bool is_leaf,
|
||||
const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
|
||||
|
||||
extern float8 gbt_num_distance(const GBT_NUMKEY_R *key, const void *query,
|
||||
bool is_leaf, const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
|
||||
bool is_leaf, const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
|
||||
|
||||
extern GIST_SPLITVEC *gbt_num_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v,
|
||||
const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
|
||||
const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
|
||||
|
||||
extern GISTENTRY *gbt_num_compress(GISTENTRY *entry, const gbtree_ninfo *tinfo);
|
||||
|
||||
extern GISTENTRY *gbt_num_fetch(GISTENTRY *entry, const gbtree_ninfo *tinfo);
|
||||
|
||||
extern void *gbt_num_union(GBT_NUMKEY *out, const GistEntryVector *entryvec,
|
||||
const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
|
||||
const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
|
||||
|
||||
extern bool gbt_num_same(const GBT_NUMKEY *a, const GBT_NUMKEY *b,
|
||||
const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
|
||||
const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
|
||||
|
||||
extern void gbt_num_bin_union(Datum *u, GBT_NUMKEY *e,
|
||||
const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
|
||||
const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
|
||||
|
||||
#endif
|
||||
|
@ -52,22 +52,22 @@ extern GBT_VARKEY *gbt_var_key_copy(const GBT_VARKEY_R *u);
|
||||
extern GISTENTRY *gbt_var_compress(GISTENTRY *entry, const gbtree_vinfo *tinfo);
|
||||
|
||||
extern GBT_VARKEY *gbt_var_union(const GistEntryVector *entryvec, int32 *size,
|
||||
Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
|
||||
Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
|
||||
|
||||
extern bool gbt_var_same(Datum d1, Datum d2, Oid collation,
|
||||
const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
|
||||
const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
|
||||
|
||||
extern float *gbt_var_penalty(float *res, const GISTENTRY *o, const GISTENTRY *n,
|
||||
Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
|
||||
Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
|
||||
|
||||
extern bool gbt_var_consistent(GBT_VARKEY_R *key, const void *query,
|
||||
StrategyNumber strategy, Oid collation, bool is_leaf,
|
||||
const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
|
||||
StrategyNumber strategy, Oid collation, bool is_leaf,
|
||||
const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
|
||||
|
||||
extern GIST_SPLITVEC *gbt_var_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v,
|
||||
Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
|
||||
Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
|
||||
|
||||
extern void gbt_var_bin_union(Datum *u, GBT_VARKEY *e, Oid collation,
|
||||
const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
|
||||
const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
|
||||
|
||||
#endif
|
||||
|
@ -89,12 +89,12 @@ typedef struct storeInfo
|
||||
static Datum dblink_record_internal(FunctionCallInfo fcinfo, bool is_async);
|
||||
static void prepTuplestoreResult(FunctionCallInfo fcinfo);
|
||||
static void materializeResult(FunctionCallInfo fcinfo, PGconn *conn,
|
||||
PGresult *res);
|
||||
PGresult *res);
|
||||
static void materializeQueryResult(FunctionCallInfo fcinfo,
|
||||
PGconn *conn,
|
||||
const char *conname,
|
||||
const char *sql,
|
||||
bool fail);
|
||||
PGconn *conn,
|
||||
const char *conname,
|
||||
const char *sql,
|
||||
bool fail);
|
||||
static PGresult *storeQueryResult(volatile storeInfo *sinfo, PGconn *conn, const char *sql);
|
||||
static void storeRow(volatile storeInfo *sinfo, PGresult *res, bool first);
|
||||
static remoteConn *getConnectionByName(const char *name);
|
||||
@ -114,14 +114,14 @@ static char *generate_relation_name(Relation rel);
|
||||
static void dblink_connstr_check(const char *connstr);
|
||||
static void dblink_security_check(PGconn *conn, remoteConn *rconn);
|
||||
static void dblink_res_error(PGconn *conn, const char *conname, PGresult *res,
|
||||
bool fail, const char *fmt,...) pg_attribute_printf(5, 6);
|
||||
bool fail, const char *fmt,...) pg_attribute_printf(5, 6);
|
||||
static char *get_connect_string(const char *servername);
|
||||
static char *escape_param_str(const char *from);
|
||||
static void validate_pkattnums(Relation rel,
|
||||
int2vector *pkattnums_arg, int32 pknumatts_arg,
|
||||
int **pkattnums, int *pknumatts);
|
||||
int2vector *pkattnums_arg, int32 pknumatts_arg,
|
||||
int **pkattnums, int *pknumatts);
|
||||
static bool is_valid_dblink_option(const PQconninfoOption *options,
|
||||
const char *option, Oid context);
|
||||
const char *option, Oid context);
|
||||
static int applyRemoteGucs(PGconn *conn);
|
||||
static void restoreLocalGucs(int nestlevel);
|
||||
|
||||
|
@ -117,49 +117,49 @@ PG_FUNCTION_INFO_V1(file_fdw_validator);
|
||||
* FDW callback routines
|
||||
*/
|
||||
static void fileGetForeignRelSize(PlannerInfo *root,
|
||||
RelOptInfo *baserel,
|
||||
Oid foreigntableid);
|
||||
RelOptInfo *baserel,
|
||||
Oid foreigntableid);
|
||||
static void fileGetForeignPaths(PlannerInfo *root,
|
||||
RelOptInfo *baserel,
|
||||
Oid foreigntableid);
|
||||
RelOptInfo *baserel,
|
||||
Oid foreigntableid);
|
||||
static ForeignScan *fileGetForeignPlan(PlannerInfo *root,
|
||||
RelOptInfo *baserel,
|
||||
Oid foreigntableid,
|
||||
ForeignPath *best_path,
|
||||
List *tlist,
|
||||
List *scan_clauses,
|
||||
Plan *outer_plan);
|
||||
RelOptInfo *baserel,
|
||||
Oid foreigntableid,
|
||||
ForeignPath *best_path,
|
||||
List *tlist,
|
||||
List *scan_clauses,
|
||||
Plan *outer_plan);
|
||||
static void fileExplainForeignScan(ForeignScanState *node, ExplainState *es);
|
||||
static void fileBeginForeignScan(ForeignScanState *node, int eflags);
|
||||
static TupleTableSlot *fileIterateForeignScan(ForeignScanState *node);
|
||||
static void fileReScanForeignScan(ForeignScanState *node);
|
||||
static void fileEndForeignScan(ForeignScanState *node);
|
||||
static bool fileAnalyzeForeignTable(Relation relation,
|
||||
AcquireSampleRowsFunc *func,
|
||||
BlockNumber *totalpages);
|
||||
AcquireSampleRowsFunc *func,
|
||||
BlockNumber *totalpages);
|
||||
static bool fileIsForeignScanParallelSafe(PlannerInfo *root, RelOptInfo *rel,
|
||||
RangeTblEntry *rte);
|
||||
RangeTblEntry *rte);
|
||||
|
||||
/*
|
||||
* Helper functions
|
||||
*/
|
||||
static bool is_valid_option(const char *option, Oid context);
|
||||
static void fileGetOptions(Oid foreigntableid,
|
||||
char **filename,
|
||||
bool *is_program,
|
||||
List **other_options);
|
||||
char **filename,
|
||||
bool *is_program,
|
||||
List **other_options);
|
||||
static List *get_file_fdw_attribute_options(Oid relid);
|
||||
static bool check_selective_binary_conversion(RelOptInfo *baserel,
|
||||
Oid foreigntableid,
|
||||
List **columns);
|
||||
Oid foreigntableid,
|
||||
List **columns);
|
||||
static void estimate_size(PlannerInfo *root, RelOptInfo *baserel,
|
||||
FileFdwPlanState *fdw_private);
|
||||
FileFdwPlanState *fdw_private);
|
||||
static void estimate_costs(PlannerInfo *root, RelOptInfo *baserel,
|
||||
FileFdwPlanState *fdw_private,
|
||||
Cost *startup_cost, Cost *total_cost);
|
||||
static int file_acquire_sample_rows(Relation onerel, int elevel,
|
||||
HeapTuple *rows, int targrows,
|
||||
double *totalrows, double *totaldeadrows);
|
||||
FileFdwPlanState *fdw_private,
|
||||
Cost *startup_cost, Cost *total_cost);
|
||||
static int file_acquire_sample_rows(Relation onerel, int elevel,
|
||||
HeapTuple *rows, int targrows,
|
||||
double *totalrows, double *totaldeadrows);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -35,7 +35,7 @@ PG_FUNCTION_INFO_V1(_int_matchsel);
|
||||
|
||||
|
||||
static Selectivity int_query_opr_selec(ITEM *item, Datum *values, float4 *freqs,
|
||||
int nmncelems, float4 minfreq);
|
||||
int nmncelems, float4 minfreq);
|
||||
static int compare_val_int4(const void *a, const void *b);
|
||||
|
||||
/*
|
||||
|
@ -26,7 +26,7 @@ static PyObject *decimal_constructor;
|
||||
|
||||
static PyObject *PLyObject_FromJsonbContainer(JsonbContainer *jsonb);
|
||||
static JsonbValue *PLyObject_ToJsonbValue(PyObject *obj,
|
||||
JsonbParseState **jsonb_state, bool is_elem);
|
||||
JsonbParseState **jsonb_state, bool is_elem);
|
||||
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
typedef PyObject *(*PLyUnicode_FromStringAndSize_t)
|
||||
|
@ -50,7 +50,7 @@ getlexeme(char *start, char *end, int *len)
|
||||
}
|
||||
|
||||
bool
|
||||
compare_subnode(ltree_level *t, char *qn, int len, int (*cmpptr) (const char *, const char *, size_t), bool anyend)
|
||||
compare_subnode(ltree_level *t, char *qn, int len, int (*cmpptr) (const char *, const char *, size_t), bool anyend)
|
||||
{
|
||||
char *endt = t->name + t->len;
|
||||
char *endq = qn + len;
|
||||
|
@ -155,13 +155,13 @@ Datum ltree_textadd(PG_FUNCTION_ARGS);
|
||||
/* Util function */
|
||||
Datum ltree_in(PG_FUNCTION_ARGS);
|
||||
|
||||
bool ltree_execute(ITEM *curitem, void *checkval,
|
||||
bool calcnot, bool (*chkcond) (void *checkval, ITEM *val));
|
||||
bool ltree_execute(ITEM *curitem, void *checkval,
|
||||
bool calcnot, bool (*chkcond) (void *checkval, ITEM *val));
|
||||
|
||||
int ltree_compare(const ltree *a, const ltree *b);
|
||||
bool inner_isparent(const ltree *c, const ltree *p);
|
||||
bool compare_subnode(ltree_level *t, char *q, int len,
|
||||
int (*cmpptr) (const char *, const char *, size_t), bool anyend);
|
||||
bool compare_subnode(ltree_level *t, char *q, int len,
|
||||
int (*cmpptr) (const char *, const char *, size_t), bool anyend);
|
||||
ltree *lca_inner(ltree **a, int len);
|
||||
int ltree_strncasecmp(const char *a, const char *b, size_t s);
|
||||
|
||||
|
@ -41,7 +41,7 @@ typedef struct brin_column_state
|
||||
|
||||
|
||||
static Page verify_brin_page(bytea *raw_page, uint16 type,
|
||||
const char *strtype);
|
||||
const char *strtype);
|
||||
|
||||
Datum
|
||||
brin_page_type(PG_FUNCTION_ARGS)
|
||||
|
@ -33,7 +33,7 @@
|
||||
PG_MODULE_MAGIC;
|
||||
|
||||
static bytea *get_raw_page_internal(text *relname, ForkNumber forknum,
|
||||
BlockNumber blkno);
|
||||
BlockNumber blkno);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -300,45 +300,45 @@ static void pgss_shmem_shutdown(int code, Datum arg);
|
||||
static void pgss_post_parse_analyze(ParseState *pstate, Query *query);
|
||||
static void pgss_ExecutorStart(QueryDesc *queryDesc, int eflags);
|
||||
static void pgss_ExecutorRun(QueryDesc *queryDesc,
|
||||
ScanDirection direction,
|
||||
uint64 count, bool execute_once);
|
||||
ScanDirection direction,
|
||||
uint64 count, bool execute_once);
|
||||
static void pgss_ExecutorFinish(QueryDesc *queryDesc);
|
||||
static void pgss_ExecutorEnd(QueryDesc *queryDesc);
|
||||
static void pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
|
||||
ProcessUtilityContext context, ParamListInfo params,
|
||||
QueryEnvironment *queryEnv,
|
||||
DestReceiver *dest, char *completionTag);
|
||||
ProcessUtilityContext context, ParamListInfo params,
|
||||
QueryEnvironment *queryEnv,
|
||||
DestReceiver *dest, char *completionTag);
|
||||
static uint64 pgss_hash_string(const char *str, int len);
|
||||
static void pgss_store(const char *query, uint64 queryId,
|
||||
int query_location, int query_len,
|
||||
double total_time, uint64 rows,
|
||||
const BufferUsage *bufusage,
|
||||
pgssJumbleState *jstate);
|
||||
int query_location, int query_len,
|
||||
double total_time, uint64 rows,
|
||||
const BufferUsage *bufusage,
|
||||
pgssJumbleState *jstate);
|
||||
static void pg_stat_statements_internal(FunctionCallInfo fcinfo,
|
||||
pgssVersion api_version,
|
||||
bool showtext);
|
||||
pgssVersion api_version,
|
||||
bool showtext);
|
||||
static Size pgss_memsize(void);
|
||||
static pgssEntry *entry_alloc(pgssHashKey *key, Size query_offset, int query_len,
|
||||
int encoding, bool sticky);
|
||||
int encoding, bool sticky);
|
||||
static void entry_dealloc(void);
|
||||
static bool qtext_store(const char *query, int query_len,
|
||||
Size *query_offset, int *gc_count);
|
||||
Size *query_offset, int *gc_count);
|
||||
static char *qtext_load_file(Size *buffer_size);
|
||||
static char *qtext_fetch(Size query_offset, int query_len,
|
||||
char *buffer, Size buffer_size);
|
||||
char *buffer, Size buffer_size);
|
||||
static bool need_gc_qtexts(void);
|
||||
static void gc_qtexts(void);
|
||||
static void entry_reset(Oid userid, Oid dbid, uint64 queryid);
|
||||
static void AppendJumble(pgssJumbleState *jstate,
|
||||
const unsigned char *item, Size size);
|
||||
const unsigned char *item, Size size);
|
||||
static void JumbleQuery(pgssJumbleState *jstate, Query *query);
|
||||
static void JumbleRangeTable(pgssJumbleState *jstate, List *rtable);
|
||||
static void JumbleExpr(pgssJumbleState *jstate, Node *node);
|
||||
static void RecordConstLocation(pgssJumbleState *jstate, int location);
|
||||
static char *generate_normalized_query(pgssJumbleState *jstate, const char *query,
|
||||
int query_loc, int *query_len_p, int encoding);
|
||||
int query_loc, int *query_len_p, int encoding);
|
||||
static void fill_in_constant_lengths(pgssJumbleState *jstate, const char *query,
|
||||
int query_loc);
|
||||
int query_loc);
|
||||
static int comp_location(const void *a, const void *b);
|
||||
|
||||
|
||||
|
@ -134,7 +134,7 @@ extern float4 cnt_sml(TRGM *trg1, TRGM *trg2, bool inexact);
|
||||
extern bool trgm_contained_by(TRGM *trg1, TRGM *trg2);
|
||||
extern bool *trgm_presence_map(TRGM *query, TRGM *key);
|
||||
extern TRGM *createTrgmNFA(text *text_re, Oid collation,
|
||||
TrgmPackedGraph **graph, MemoryContext rcontext);
|
||||
TrgmPackedGraph **graph, MemoryContext rcontext);
|
||||
extern bool trigramsMatchGraph(TrgmPackedGraph *graph, bool *check);
|
||||
|
||||
#endif /* __TRGM_H__ */
|
||||
|
@ -478,9 +478,9 @@ typedef struct
|
||||
|
||||
/* prototypes for private functions */
|
||||
static TRGM *createTrgmNFAInternal(regex_t *regex, TrgmPackedGraph **graph,
|
||||
MemoryContext rcontext);
|
||||
MemoryContext rcontext);
|
||||
static void RE_compile(regex_t *regex, text *text_re,
|
||||
int cflags, Oid collation);
|
||||
int cflags, Oid collation);
|
||||
static void getColorInfo(regex_t *regex, TrgmNFA *trgmNFA);
|
||||
static bool convertPgWchar(pg_wchar c, trgm_mb_char *result);
|
||||
static void transformGraph(TrgmNFA *trgmNFA);
|
||||
@ -489,7 +489,7 @@ static void addKey(TrgmNFA *trgmNFA, TrgmState *state, TrgmStateKey *key);
|
||||
static void addKeyToQueue(TrgmNFA *trgmNFA, TrgmStateKey *key);
|
||||
static void addArcs(TrgmNFA *trgmNFA, TrgmState *state);
|
||||
static void addArc(TrgmNFA *trgmNFA, TrgmState *state, TrgmStateKey *key,
|
||||
TrgmColor co, TrgmStateKey *destKey);
|
||||
TrgmColor co, TrgmStateKey *destKey);
|
||||
static bool validArcLabel(TrgmStateKey *key, TrgmColor co);
|
||||
static TrgmState *getState(TrgmNFA *trgmNFA, TrgmStateKey *key);
|
||||
static bool prefixContains(TrgmPrefix *prefix1, TrgmPrefix *prefix2);
|
||||
|
@ -51,10 +51,10 @@ PG_FUNCTION_INFO_V1(pg_truncate_visibility_map);
|
||||
static TupleDesc pg_visibility_tupdesc(bool include_blkno, bool include_pd);
|
||||
static vbits *collect_visibility_data(Oid relid, bool include_pd);
|
||||
static corrupt_items *collect_corrupt_items(Oid relid, bool all_visible,
|
||||
bool all_frozen);
|
||||
bool all_frozen);
|
||||
static void record_corrupt_item(corrupt_items *items, ItemPointer tid);
|
||||
static bool tuple_all_visible(HeapTuple tup, TransactionId OldestXmin,
|
||||
Buffer buffer);
|
||||
Buffer buffer);
|
||||
static void check_relation_relkind(Relation rel);
|
||||
|
||||
/*
|
||||
|
@ -335,19 +335,19 @@ static int s_uvcmp(mp_int a, mp_usmall uv);
|
||||
/* Unsigned magnitude addition; assumes dc is big enough.
|
||||
Carry out is returned (no memory allocated). */
|
||||
static mp_digit s_uadd(mp_digit *da, mp_digit *db, mp_digit *dc, mp_size size_a,
|
||||
mp_size size_b);
|
||||
mp_size size_b);
|
||||
|
||||
/* Unsigned magnitude subtraction. Assumes dc is big enough. */
|
||||
static void s_usub(mp_digit *da, mp_digit *db, mp_digit *dc, mp_size size_a,
|
||||
mp_size size_b);
|
||||
mp_size size_b);
|
||||
|
||||
/* Unsigned recursive multiplication. Assumes dc is big enough. */
|
||||
static int s_kmul(mp_digit *da, mp_digit *db, mp_digit *dc, mp_size size_a,
|
||||
mp_size size_b);
|
||||
static int s_kmul(mp_digit *da, mp_digit *db, mp_digit *dc, mp_size size_a,
|
||||
mp_size size_b);
|
||||
|
||||
/* Unsigned magnitude multiplication. Assumes dc is big enough. */
|
||||
static void s_umul(mp_digit *da, mp_digit *db, mp_digit *dc, mp_size size_a,
|
||||
mp_size size_b);
|
||||
mp_size size_b);
|
||||
|
||||
/* Unsigned recursive squaring. Assumes dc is big enough. */
|
||||
static int s_ksqr(mp_digit *da, mp_digit *dc, mp_size size_a);
|
||||
|
@ -90,8 +90,8 @@ int mbuf_free(MBuf *mbuf);
|
||||
/*
|
||||
* Push filter
|
||||
*/
|
||||
int pushf_create(PushFilter **res, const PushFilterOps *ops, void *init_arg,
|
||||
PushFilter *next);
|
||||
int pushf_create(PushFilter **res, const PushFilterOps *ops, void *init_arg,
|
||||
PushFilter *next);
|
||||
int pushf_write(PushFilter *mp, const uint8 *data, int len);
|
||||
void pushf_free_all(PushFilter *mp);
|
||||
void pushf_free(PushFilter *mp);
|
||||
@ -102,11 +102,11 @@ int pushf_create_mbuf_writer(PushFilter **mp_p, MBuf *mbuf);
|
||||
/*
|
||||
* Pull filter
|
||||
*/
|
||||
int pullf_create(PullFilter **res, const PullFilterOps *ops,
|
||||
void *init_arg, PullFilter *src);
|
||||
int pullf_create(PullFilter **res, const PullFilterOps *ops,
|
||||
void *init_arg, PullFilter *src);
|
||||
int pullf_read(PullFilter *mp, int len, uint8 **data_p);
|
||||
int pullf_read_max(PullFilter *mp, int len,
|
||||
uint8 **data_p, uint8 *tmpbuf);
|
||||
int pullf_read_max(PullFilter *mp, int len,
|
||||
uint8 **data_p, uint8 *tmpbuf);
|
||||
void pullf_free(PullFilter *mp);
|
||||
int pullf_read_fixed(PullFilter *src, int len, uint8 *dst);
|
||||
|
||||
|
@ -811,8 +811,8 @@ parse_literal_data(PGP_Context *ctx, MBuf *dst, PullFilter *pkt)
|
||||
}
|
||||
|
||||
/* process_data_packets and parse_compressed_data call each other */
|
||||
static int process_data_packets(PGP_Context *ctx, MBuf *dst,
|
||||
PullFilter *src, int allow_compr, int need_mdc);
|
||||
static int process_data_packets(PGP_Context *ctx, MBuf *dst,
|
||||
PullFilter *src, int allow_compr, int need_mdc);
|
||||
|
||||
static int
|
||||
parse_compressed_data(PGP_Context *ctx, MBuf *dst, PullFilter *pkt)
|
||||
|
@ -261,8 +261,8 @@ int pgp_set_unicode_mode(PGP_Context *ctx, int mode);
|
||||
int pgp_get_unicode_mode(PGP_Context *ctx);
|
||||
|
||||
int pgp_set_symkey(PGP_Context *ctx, const uint8 *key, int klen);
|
||||
int pgp_set_pubkey(PGP_Context *ctx, MBuf *keypkt,
|
||||
const uint8 *key, int klen, int pubtype);
|
||||
int pgp_set_pubkey(PGP_Context *ctx, MBuf *keypkt,
|
||||
const uint8 *key, int klen, int pubtype);
|
||||
|
||||
int pgp_get_keyid(MBuf *pgp_data, char *dst);
|
||||
|
||||
@ -278,17 +278,17 @@ int pgp_s2k_read(PullFilter *src, PGP_S2K *s2k);
|
||||
int pgp_s2k_process(PGP_S2K *s2k, int cipher, const uint8 *key, int klen);
|
||||
|
||||
typedef struct PGP_CFB PGP_CFB;
|
||||
int pgp_cfb_create(PGP_CFB **ctx_p, int algo,
|
||||
const uint8 *key, int key_len, int recync, uint8 *iv);
|
||||
int pgp_cfb_create(PGP_CFB **ctx_p, int algo,
|
||||
const uint8 *key, int key_len, int recync, uint8 *iv);
|
||||
void pgp_cfb_free(PGP_CFB *ctx);
|
||||
int pgp_cfb_encrypt(PGP_CFB *ctx, const uint8 *data, int len, uint8 *dst);
|
||||
int pgp_cfb_decrypt(PGP_CFB *ctx, const uint8 *data, int len, uint8 *dst);
|
||||
|
||||
void pgp_armor_encode(const uint8 *src, unsigned len, StringInfo dst,
|
||||
int num_headers, char **keys, char **values);
|
||||
void pgp_armor_encode(const uint8 *src, unsigned len, StringInfo dst,
|
||||
int num_headers, char **keys, char **values);
|
||||
int pgp_armor_decode(const uint8 *src, int len, StringInfo dst);
|
||||
int pgp_extract_armor_headers(const uint8 *src, unsigned len,
|
||||
int *nheaders, char ***keys, char ***values);
|
||||
int pgp_extract_armor_headers(const uint8 *src, unsigned len,
|
||||
int *nheaders, char ***keys, char ***values);
|
||||
|
||||
int pgp_compress_filter(PushFilter **res, PGP_Context *ctx, PushFilter *dst);
|
||||
int pgp_decompress_filter(PullFilter **res, PGP_Context *ctx, PullFilter *src);
|
||||
@ -298,10 +298,10 @@ void pgp_key_free(PGP_PubKey *pk);
|
||||
int _pgp_read_public_key(PullFilter *pkt, PGP_PubKey **pk_p);
|
||||
|
||||
int pgp_parse_pubenc_sesskey(PGP_Context *ctx, PullFilter *pkt);
|
||||
int pgp_create_pkt_reader(PullFilter **pf_p, PullFilter *src, int len,
|
||||
int pkttype, PGP_Context *ctx);
|
||||
int pgp_parse_pkt_hdr(PullFilter *src, uint8 *tag, int *len_p,
|
||||
int allow_ctx);
|
||||
int pgp_create_pkt_reader(PullFilter **pf_p, PullFilter *src, int len,
|
||||
int pkttype, PGP_Context *ctx);
|
||||
int pgp_parse_pkt_hdr(PullFilter *src, uint8 *tag, int *len_p,
|
||||
int allow_ctx);
|
||||
|
||||
int pgp_skip_packet(PullFilter *pkt);
|
||||
int pgp_expect_packet_end(PullFilter *pkt);
|
||||
@ -317,10 +317,10 @@ int pgp_mpi_write(PushFilter *dst, PGP_MPI *n);
|
||||
int pgp_mpi_hash(PX_MD *md, PGP_MPI *n);
|
||||
unsigned pgp_mpi_cksum(unsigned cksum, PGP_MPI *n);
|
||||
|
||||
int pgp_elgamal_encrypt(PGP_PubKey *pk, PGP_MPI *m,
|
||||
PGP_MPI **c1, PGP_MPI **c2);
|
||||
int pgp_elgamal_decrypt(PGP_PubKey *pk, PGP_MPI *c1, PGP_MPI *c2,
|
||||
PGP_MPI **m);
|
||||
int pgp_elgamal_encrypt(PGP_PubKey *pk, PGP_MPI *m,
|
||||
PGP_MPI **c1, PGP_MPI **c2);
|
||||
int pgp_elgamal_decrypt(PGP_PubKey *pk, PGP_MPI *c1, PGP_MPI *c2,
|
||||
PGP_MPI **m);
|
||||
int pgp_rsa_encrypt(PGP_PubKey *pk, PGP_MPI *m, PGP_MPI **c);
|
||||
int pgp_rsa_decrypt(PGP_PubKey *pk, PGP_MPI *c, PGP_MPI **m);
|
||||
|
||||
|
@ -56,27 +56,27 @@ int px_gen_salt(const char *salt_type, char *dst, int rounds);
|
||||
*/
|
||||
|
||||
/* crypt-gensalt.c */
|
||||
char *_crypt_gensalt_traditional_rn(unsigned long count,
|
||||
const char *input, int size, char *output, int output_size);
|
||||
char *_crypt_gensalt_extended_rn(unsigned long count,
|
||||
const char *input, int size, char *output, int output_size);
|
||||
char *_crypt_gensalt_md5_rn(unsigned long count,
|
||||
const char *input, int size, char *output, int output_size);
|
||||
char *_crypt_gensalt_blowfish_rn(unsigned long count,
|
||||
const char *input, int size, char *output, int output_size);
|
||||
char *_crypt_gensalt_traditional_rn(unsigned long count,
|
||||
const char *input, int size, char *output, int output_size);
|
||||
char *_crypt_gensalt_extended_rn(unsigned long count,
|
||||
const char *input, int size, char *output, int output_size);
|
||||
char *_crypt_gensalt_md5_rn(unsigned long count,
|
||||
const char *input, int size, char *output, int output_size);
|
||||
char *_crypt_gensalt_blowfish_rn(unsigned long count,
|
||||
const char *input, int size, char *output, int output_size);
|
||||
|
||||
/* disable 'extended DES crypt' */
|
||||
/* #define DISABLE_XDES */
|
||||
|
||||
/* crypt-blowfish.c */
|
||||
char *_crypt_blowfish_rn(const char *key, const char *setting,
|
||||
char *output, int size);
|
||||
char *_crypt_blowfish_rn(const char *key, const char *setting,
|
||||
char *output, int size);
|
||||
|
||||
/* crypt-des.c */
|
||||
char *px_crypt_des(const char *key, const char *setting);
|
||||
|
||||
/* crypt-md5.c */
|
||||
char *px_crypt_md5(const char *pw, const char *salt,
|
||||
char *dst, unsigned dstlen);
|
||||
char *px_crypt_md5(const char *pw, const char *salt,
|
||||
char *dst, unsigned dstlen);
|
||||
|
||||
#endif /* _PX_CRYPT_H */
|
||||
|
@ -66,22 +66,22 @@ typedef void (*pgstat_page) (pgstattuple_type *, Relation, BlockNumber,
|
||||
BufferAccessStrategy);
|
||||
|
||||
static Datum build_pgstattuple_type(pgstattuple_type *stat,
|
||||
FunctionCallInfo fcinfo);
|
||||
FunctionCallInfo fcinfo);
|
||||
static Datum pgstat_relation(Relation rel, FunctionCallInfo fcinfo);
|
||||
static Datum pgstat_heap(Relation rel, FunctionCallInfo fcinfo);
|
||||
static void pgstat_btree_page(pgstattuple_type *stat,
|
||||
Relation rel, BlockNumber blkno,
|
||||
BufferAccessStrategy bstrategy);
|
||||
Relation rel, BlockNumber blkno,
|
||||
BufferAccessStrategy bstrategy);
|
||||
static void pgstat_hash_page(pgstattuple_type *stat,
|
||||
Relation rel, BlockNumber blkno,
|
||||
BufferAccessStrategy bstrategy);
|
||||
Relation rel, BlockNumber blkno,
|
||||
BufferAccessStrategy bstrategy);
|
||||
static void pgstat_gist_page(pgstattuple_type *stat,
|
||||
Relation rel, BlockNumber blkno,
|
||||
BufferAccessStrategy bstrategy);
|
||||
Relation rel, BlockNumber blkno,
|
||||
BufferAccessStrategy bstrategy);
|
||||
static Datum pgstat_index(Relation rel, BlockNumber start,
|
||||
pgstat_page pagefn, FunctionCallInfo fcinfo);
|
||||
pgstat_page pagefn, FunctionCallInfo fcinfo);
|
||||
static void pgstat_index_page(pgstattuple_type *stat, Page page,
|
||||
OffsetNumber minoff, OffsetNumber maxoff);
|
||||
OffsetNumber minoff, OffsetNumber maxoff);
|
||||
|
||||
/*
|
||||
* build_pgstattuple_type -- build a pgstattuple_type tuple
|
||||
|
@ -81,16 +81,16 @@ static void do_sql_command(PGconn *conn, const char *sql);
|
||||
static void begin_remote_xact(ConnCacheEntry *entry);
|
||||
static void pgfdw_xact_callback(XactEvent event, void *arg);
|
||||
static void pgfdw_subxact_callback(SubXactEvent event,
|
||||
SubTransactionId mySubid,
|
||||
SubTransactionId parentSubid,
|
||||
void *arg);
|
||||
SubTransactionId mySubid,
|
||||
SubTransactionId parentSubid,
|
||||
void *arg);
|
||||
static void pgfdw_inval_callback(Datum arg, int cacheid, uint32 hashvalue);
|
||||
static void pgfdw_reject_incomplete_xact_state_change(ConnCacheEntry *entry);
|
||||
static bool pgfdw_cancel_query(PGconn *conn);
|
||||
static bool pgfdw_exec_cleanup_query(PGconn *conn, const char *query,
|
||||
bool ignore_errors);
|
||||
bool ignore_errors);
|
||||
static bool pgfdw_get_cleanup_result(PGconn *conn, TimestampTz endtime,
|
||||
PGresult **result);
|
||||
PGresult **result);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -116,34 +116,34 @@ typedef struct deparse_expr_cxt
|
||||
* remote server.
|
||||
*/
|
||||
static bool foreign_expr_walker(Node *node,
|
||||
foreign_glob_cxt *glob_cxt,
|
||||
foreign_loc_cxt *outer_cxt);
|
||||
foreign_glob_cxt *glob_cxt,
|
||||
foreign_loc_cxt *outer_cxt);
|
||||
static char *deparse_type_name(Oid type_oid, int32 typemod);
|
||||
|
||||
/*
|
||||
* Functions to construct string representation of a node tree.
|
||||
*/
|
||||
static void deparseTargetList(StringInfo buf,
|
||||
RangeTblEntry *rte,
|
||||
Index rtindex,
|
||||
Relation rel,
|
||||
bool is_returning,
|
||||
Bitmapset *attrs_used,
|
||||
bool qualify_col,
|
||||
List **retrieved_attrs);
|
||||
RangeTblEntry *rte,
|
||||
Index rtindex,
|
||||
Relation rel,
|
||||
bool is_returning,
|
||||
Bitmapset *attrs_used,
|
||||
bool qualify_col,
|
||||
List **retrieved_attrs);
|
||||
static void deparseExplicitTargetList(List *tlist,
|
||||
bool is_returning,
|
||||
List **retrieved_attrs,
|
||||
deparse_expr_cxt *context);
|
||||
bool is_returning,
|
||||
List **retrieved_attrs,
|
||||
deparse_expr_cxt *context);
|
||||
static void deparseSubqueryTargetList(deparse_expr_cxt *context);
|
||||
static void deparseReturningList(StringInfo buf, RangeTblEntry *rte,
|
||||
Index rtindex, Relation rel,
|
||||
bool trig_after_row,
|
||||
List *withCheckOptionList,
|
||||
List *returningList,
|
||||
List **retrieved_attrs);
|
||||
Index rtindex, Relation rel,
|
||||
bool trig_after_row,
|
||||
List *withCheckOptionList,
|
||||
List *returningList,
|
||||
List **retrieved_attrs);
|
||||
static void deparseColumnRef(StringInfo buf, int varno, int varattno,
|
||||
RangeTblEntry *rte, bool qualify_col);
|
||||
RangeTblEntry *rte, bool qualify_col);
|
||||
static void deparseRelation(StringInfo buf, Relation rel);
|
||||
static void deparseExpr(Expr *expr, deparse_expr_cxt *context);
|
||||
static void deparseVar(Var *node, deparse_expr_cxt *context);
|
||||
@ -155,45 +155,45 @@ static void deparseOpExpr(OpExpr *node, deparse_expr_cxt *context);
|
||||
static void deparseOperatorName(StringInfo buf, Form_pg_operator opform);
|
||||
static void deparseDistinctExpr(DistinctExpr *node, deparse_expr_cxt *context);
|
||||
static void deparseScalarArrayOpExpr(ScalarArrayOpExpr *node,
|
||||
deparse_expr_cxt *context);
|
||||
deparse_expr_cxt *context);
|
||||
static void deparseRelabelType(RelabelType *node, deparse_expr_cxt *context);
|
||||
static void deparseBoolExpr(BoolExpr *node, deparse_expr_cxt *context);
|
||||
static void deparseNullTest(NullTest *node, deparse_expr_cxt *context);
|
||||
static void deparseArrayExpr(ArrayExpr *node, deparse_expr_cxt *context);
|
||||
static void printRemoteParam(int paramindex, Oid paramtype, int32 paramtypmod,
|
||||
deparse_expr_cxt *context);
|
||||
deparse_expr_cxt *context);
|
||||
static void printRemotePlaceholder(Oid paramtype, int32 paramtypmod,
|
||||
deparse_expr_cxt *context);
|
||||
deparse_expr_cxt *context);
|
||||
static void deparseSelectSql(List *tlist, bool is_subquery, List **retrieved_attrs,
|
||||
deparse_expr_cxt *context);
|
||||
deparse_expr_cxt *context);
|
||||
static void deparseLockingClause(deparse_expr_cxt *context);
|
||||
static void appendOrderByClause(List *pathkeys, bool has_final_sort,
|
||||
deparse_expr_cxt *context);
|
||||
deparse_expr_cxt *context);
|
||||
static void appendLimitClause(deparse_expr_cxt *context);
|
||||
static void appendConditions(List *exprs, deparse_expr_cxt *context);
|
||||
static void deparseFromExprForRel(StringInfo buf, PlannerInfo *root,
|
||||
RelOptInfo *foreignrel, bool use_alias,
|
||||
Index ignore_rel, List **ignore_conds,
|
||||
List **params_list);
|
||||
RelOptInfo *foreignrel, bool use_alias,
|
||||
Index ignore_rel, List **ignore_conds,
|
||||
List **params_list);
|
||||
static void deparseFromExpr(List *quals, deparse_expr_cxt *context);
|
||||
static void deparseRangeTblRef(StringInfo buf, PlannerInfo *root,
|
||||
RelOptInfo *foreignrel, bool make_subquery,
|
||||
Index ignore_rel, List **ignore_conds, List **params_list);
|
||||
RelOptInfo *foreignrel, bool make_subquery,
|
||||
Index ignore_rel, List **ignore_conds, List **params_list);
|
||||
static void deparseAggref(Aggref *node, deparse_expr_cxt *context);
|
||||
static void appendGroupByClause(List *tlist, deparse_expr_cxt *context);
|
||||
static void appendAggOrderBy(List *orderList, List *targetList,
|
||||
deparse_expr_cxt *context);
|
||||
deparse_expr_cxt *context);
|
||||
static void appendFunctionName(Oid funcid, deparse_expr_cxt *context);
|
||||
static Node *deparseSortGroupClause(Index ref, List *tlist, bool force_colno,
|
||||
deparse_expr_cxt *context);
|
||||
deparse_expr_cxt *context);
|
||||
|
||||
/*
|
||||
* Helper functions
|
||||
*/
|
||||
static bool is_subquery_var(Var *node, RelOptInfo *foreignrel,
|
||||
int *relno, int *colno);
|
||||
int *relno, int *colno);
|
||||
static void get_relation_column_alias_ids(Var *node, RelOptInfo *foreignrel,
|
||||
int *relno, int *colno);
|
||||
int *relno, int *colno);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -309,199 +309,199 @@ PG_FUNCTION_INFO_V1(postgres_fdw_handler);
|
||||
* FDW callback routines
|
||||
*/
|
||||
static void postgresGetForeignRelSize(PlannerInfo *root,
|
||||
RelOptInfo *baserel,
|
||||
Oid foreigntableid);
|
||||
RelOptInfo *baserel,
|
||||
Oid foreigntableid);
|
||||
static void postgresGetForeignPaths(PlannerInfo *root,
|
||||
RelOptInfo *baserel,
|
||||
Oid foreigntableid);
|
||||
RelOptInfo *baserel,
|
||||
Oid foreigntableid);
|
||||
static ForeignScan *postgresGetForeignPlan(PlannerInfo *root,
|
||||
RelOptInfo *foreignrel,
|
||||
Oid foreigntableid,
|
||||
ForeignPath *best_path,
|
||||
List *tlist,
|
||||
List *scan_clauses,
|
||||
Plan *outer_plan);
|
||||
RelOptInfo *foreignrel,
|
||||
Oid foreigntableid,
|
||||
ForeignPath *best_path,
|
||||
List *tlist,
|
||||
List *scan_clauses,
|
||||
Plan *outer_plan);
|
||||
static void postgresBeginForeignScan(ForeignScanState *node, int eflags);
|
||||
static TupleTableSlot *postgresIterateForeignScan(ForeignScanState *node);
|
||||
static void postgresReScanForeignScan(ForeignScanState *node);
|
||||
static void postgresEndForeignScan(ForeignScanState *node);
|
||||
static void postgresAddForeignUpdateTargets(Query *parsetree,
|
||||
RangeTblEntry *target_rte,
|
||||
Relation target_relation);
|
||||
RangeTblEntry *target_rte,
|
||||
Relation target_relation);
|
||||
static List *postgresPlanForeignModify(PlannerInfo *root,
|
||||
ModifyTable *plan,
|
||||
Index resultRelation,
|
||||
int subplan_index);
|
||||
ModifyTable *plan,
|
||||
Index resultRelation,
|
||||
int subplan_index);
|
||||
static void postgresBeginForeignModify(ModifyTableState *mtstate,
|
||||
ResultRelInfo *resultRelInfo,
|
||||
List *fdw_private,
|
||||
int subplan_index,
|
||||
int eflags);
|
||||
ResultRelInfo *resultRelInfo,
|
||||
List *fdw_private,
|
||||
int subplan_index,
|
||||
int eflags);
|
||||
static TupleTableSlot *postgresExecForeignInsert(EState *estate,
|
||||
ResultRelInfo *resultRelInfo,
|
||||
TupleTableSlot *slot,
|
||||
TupleTableSlot *planSlot);
|
||||
ResultRelInfo *resultRelInfo,
|
||||
TupleTableSlot *slot,
|
||||
TupleTableSlot *planSlot);
|
||||
static TupleTableSlot *postgresExecForeignUpdate(EState *estate,
|
||||
ResultRelInfo *resultRelInfo,
|
||||
TupleTableSlot *slot,
|
||||
TupleTableSlot *planSlot);
|
||||
ResultRelInfo *resultRelInfo,
|
||||
TupleTableSlot *slot,
|
||||
TupleTableSlot *planSlot);
|
||||
static TupleTableSlot *postgresExecForeignDelete(EState *estate,
|
||||
ResultRelInfo *resultRelInfo,
|
||||
TupleTableSlot *slot,
|
||||
TupleTableSlot *planSlot);
|
||||
ResultRelInfo *resultRelInfo,
|
||||
TupleTableSlot *slot,
|
||||
TupleTableSlot *planSlot);
|
||||
static void postgresEndForeignModify(EState *estate,
|
||||
ResultRelInfo *resultRelInfo);
|
||||
ResultRelInfo *resultRelInfo);
|
||||
static void postgresBeginForeignInsert(ModifyTableState *mtstate,
|
||||
ResultRelInfo *resultRelInfo);
|
||||
ResultRelInfo *resultRelInfo);
|
||||
static void postgresEndForeignInsert(EState *estate,
|
||||
ResultRelInfo *resultRelInfo);
|
||||
ResultRelInfo *resultRelInfo);
|
||||
static int postgresIsForeignRelUpdatable(Relation rel);
|
||||
static bool postgresPlanDirectModify(PlannerInfo *root,
|
||||
ModifyTable *plan,
|
||||
Index resultRelation,
|
||||
int subplan_index);
|
||||
ModifyTable *plan,
|
||||
Index resultRelation,
|
||||
int subplan_index);
|
||||
static void postgresBeginDirectModify(ForeignScanState *node, int eflags);
|
||||
static TupleTableSlot *postgresIterateDirectModify(ForeignScanState *node);
|
||||
static void postgresEndDirectModify(ForeignScanState *node);
|
||||
static void postgresExplainForeignScan(ForeignScanState *node,
|
||||
ExplainState *es);
|
||||
ExplainState *es);
|
||||
static void postgresExplainForeignModify(ModifyTableState *mtstate,
|
||||
ResultRelInfo *rinfo,
|
||||
List *fdw_private,
|
||||
int subplan_index,
|
||||
ExplainState *es);
|
||||
ResultRelInfo *rinfo,
|
||||
List *fdw_private,
|
||||
int subplan_index,
|
||||
ExplainState *es);
|
||||
static void postgresExplainDirectModify(ForeignScanState *node,
|
||||
ExplainState *es);
|
||||
ExplainState *es);
|
||||
static bool postgresAnalyzeForeignTable(Relation relation,
|
||||
AcquireSampleRowsFunc *func,
|
||||
BlockNumber *totalpages);
|
||||
AcquireSampleRowsFunc *func,
|
||||
BlockNumber *totalpages);
|
||||
static List *postgresImportForeignSchema(ImportForeignSchemaStmt *stmt,
|
||||
Oid serverOid);
|
||||
Oid serverOid);
|
||||
static void postgresGetForeignJoinPaths(PlannerInfo *root,
|
||||
RelOptInfo *joinrel,
|
||||
RelOptInfo *outerrel,
|
||||
RelOptInfo *innerrel,
|
||||
JoinType jointype,
|
||||
JoinPathExtraData *extra);
|
||||
RelOptInfo *joinrel,
|
||||
RelOptInfo *outerrel,
|
||||
RelOptInfo *innerrel,
|
||||
JoinType jointype,
|
||||
JoinPathExtraData *extra);
|
||||
static bool postgresRecheckForeignScan(ForeignScanState *node,
|
||||
TupleTableSlot *slot);
|
||||
TupleTableSlot *slot);
|
||||
static void postgresGetForeignUpperPaths(PlannerInfo *root,
|
||||
UpperRelationKind stage,
|
||||
RelOptInfo *input_rel,
|
||||
RelOptInfo *output_rel,
|
||||
void *extra);
|
||||
UpperRelationKind stage,
|
||||
RelOptInfo *input_rel,
|
||||
RelOptInfo *output_rel,
|
||||
void *extra);
|
||||
|
||||
/*
|
||||
* Helper functions
|
||||
*/
|
||||
static void estimate_path_cost_size(PlannerInfo *root,
|
||||
RelOptInfo *foreignrel,
|
||||
List *param_join_conds,
|
||||
List *pathkeys,
|
||||
PgFdwPathExtraData *fpextra,
|
||||
double *p_rows, int *p_width,
|
||||
Cost *p_startup_cost, Cost *p_total_cost);
|
||||
RelOptInfo *foreignrel,
|
||||
List *param_join_conds,
|
||||
List *pathkeys,
|
||||
PgFdwPathExtraData *fpextra,
|
||||
double *p_rows, int *p_width,
|
||||
Cost *p_startup_cost, Cost *p_total_cost);
|
||||
static void get_remote_estimate(const char *sql,
|
||||
PGconn *conn,
|
||||
double *rows,
|
||||
int *width,
|
||||
Cost *startup_cost,
|
||||
Cost *total_cost);
|
||||
PGconn *conn,
|
||||
double *rows,
|
||||
int *width,
|
||||
Cost *startup_cost,
|
||||
Cost *total_cost);
|
||||
static void adjust_foreign_grouping_path_cost(PlannerInfo *root,
|
||||
List *pathkeys,
|
||||
double retrieved_rows,
|
||||
double width,
|
||||
double limit_tuples,
|
||||
Cost *p_startup_cost,
|
||||
Cost *p_run_cost);
|
||||
List *pathkeys,
|
||||
double retrieved_rows,
|
||||
double width,
|
||||
double limit_tuples,
|
||||
Cost *p_startup_cost,
|
||||
Cost *p_run_cost);
|
||||
static bool ec_member_matches_foreign(PlannerInfo *root, RelOptInfo *rel,
|
||||
EquivalenceClass *ec, EquivalenceMember *em,
|
||||
void *arg);
|
||||
EquivalenceClass *ec, EquivalenceMember *em,
|
||||
void *arg);
|
||||
static void create_cursor(ForeignScanState *node);
|
||||
static void fetch_more_data(ForeignScanState *node);
|
||||
static void close_cursor(PGconn *conn, unsigned int cursor_number);
|
||||
static PgFdwModifyState *create_foreign_modify(EState *estate,
|
||||
RangeTblEntry *rte,
|
||||
ResultRelInfo *resultRelInfo,
|
||||
CmdType operation,
|
||||
Plan *subplan,
|
||||
char *query,
|
||||
List *target_attrs,
|
||||
bool has_returning,
|
||||
List *retrieved_attrs);
|
||||
RangeTblEntry *rte,
|
||||
ResultRelInfo *resultRelInfo,
|
||||
CmdType operation,
|
||||
Plan *subplan,
|
||||
char *query,
|
||||
List *target_attrs,
|
||||
bool has_returning,
|
||||
List *retrieved_attrs);
|
||||
static TupleTableSlot *execute_foreign_modify(EState *estate,
|
||||
ResultRelInfo *resultRelInfo,
|
||||
CmdType operation,
|
||||
TupleTableSlot *slot,
|
||||
TupleTableSlot *planSlot);
|
||||
ResultRelInfo *resultRelInfo,
|
||||
CmdType operation,
|
||||
TupleTableSlot *slot,
|
||||
TupleTableSlot *planSlot);
|
||||
static void prepare_foreign_modify(PgFdwModifyState *fmstate);
|
||||
static const char **convert_prep_stmt_params(PgFdwModifyState *fmstate,
|
||||
ItemPointer tupleid,
|
||||
TupleTableSlot *slot);
|
||||
ItemPointer tupleid,
|
||||
TupleTableSlot *slot);
|
||||
static void store_returning_result(PgFdwModifyState *fmstate,
|
||||
TupleTableSlot *slot, PGresult *res);
|
||||
TupleTableSlot *slot, PGresult *res);
|
||||
static void finish_foreign_modify(PgFdwModifyState *fmstate);
|
||||
static List *build_remote_returning(Index rtindex, Relation rel,
|
||||
List *returningList);
|
||||
List *returningList);
|
||||
static void rebuild_fdw_scan_tlist(ForeignScan *fscan, List *tlist);
|
||||
static void execute_dml_stmt(ForeignScanState *node);
|
||||
static TupleTableSlot *get_returning_data(ForeignScanState *node);
|
||||
static void init_returning_filter(PgFdwDirectModifyState *dmstate,
|
||||
List *fdw_scan_tlist,
|
||||
Index rtindex);
|
||||
List *fdw_scan_tlist,
|
||||
Index rtindex);
|
||||
static TupleTableSlot *apply_returning_filter(PgFdwDirectModifyState *dmstate,
|
||||
TupleTableSlot *slot,
|
||||
EState *estate);
|
||||
TupleTableSlot *slot,
|
||||
EState *estate);
|
||||
static void prepare_query_params(PlanState *node,
|
||||
List *fdw_exprs,
|
||||
int numParams,
|
||||
FmgrInfo **param_flinfo,
|
||||
List **param_exprs,
|
||||
const char ***param_values);
|
||||
List *fdw_exprs,
|
||||
int numParams,
|
||||
FmgrInfo **param_flinfo,
|
||||
List **param_exprs,
|
||||
const char ***param_values);
|
||||
static void process_query_params(ExprContext *econtext,
|
||||
FmgrInfo *param_flinfo,
|
||||
List *param_exprs,
|
||||
const char **param_values);
|
||||
static int postgresAcquireSampleRowsFunc(Relation relation, int elevel,
|
||||
HeapTuple *rows, int targrows,
|
||||
double *totalrows,
|
||||
double *totaldeadrows);
|
||||
FmgrInfo *param_flinfo,
|
||||
List *param_exprs,
|
||||
const char **param_values);
|
||||
static int postgresAcquireSampleRowsFunc(Relation relation, int elevel,
|
||||
HeapTuple *rows, int targrows,
|
||||
double *totalrows,
|
||||
double *totaldeadrows);
|
||||
static void analyze_row_processor(PGresult *res, int row,
|
||||
PgFdwAnalyzeState *astate);
|
||||
PgFdwAnalyzeState *astate);
|
||||
static HeapTuple make_tuple_from_result_row(PGresult *res,
|
||||
int row,
|
||||
Relation rel,
|
||||
AttInMetadata *attinmeta,
|
||||
List *retrieved_attrs,
|
||||
ForeignScanState *fsstate,
|
||||
MemoryContext temp_context);
|
||||
int row,
|
||||
Relation rel,
|
||||
AttInMetadata *attinmeta,
|
||||
List *retrieved_attrs,
|
||||
ForeignScanState *fsstate,
|
||||
MemoryContext temp_context);
|
||||
static void conversion_error_callback(void *arg);
|
||||
static bool foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel,
|
||||
JoinType jointype, RelOptInfo *outerrel, RelOptInfo *innerrel,
|
||||
JoinPathExtraData *extra);
|
||||
JoinType jointype, RelOptInfo *outerrel, RelOptInfo *innerrel,
|
||||
JoinPathExtraData *extra);
|
||||
static bool foreign_grouping_ok(PlannerInfo *root, RelOptInfo *grouped_rel,
|
||||
Node *havingQual);
|
||||
Node *havingQual);
|
||||
static List *get_useful_pathkeys_for_relation(PlannerInfo *root,
|
||||
RelOptInfo *rel);
|
||||
RelOptInfo *rel);
|
||||
static List *get_useful_ecs_for_relation(PlannerInfo *root, RelOptInfo *rel);
|
||||
static void add_paths_with_pathkeys_for_rel(PlannerInfo *root, RelOptInfo *rel,
|
||||
Path *epq_path);
|
||||
Path *epq_path);
|
||||
static void add_foreign_grouping_paths(PlannerInfo *root,
|
||||
RelOptInfo *input_rel,
|
||||
RelOptInfo *grouped_rel,
|
||||
GroupPathExtraData *extra);
|
||||
RelOptInfo *input_rel,
|
||||
RelOptInfo *grouped_rel,
|
||||
GroupPathExtraData *extra);
|
||||
static void add_foreign_ordered_paths(PlannerInfo *root,
|
||||
RelOptInfo *input_rel,
|
||||
RelOptInfo *ordered_rel);
|
||||
RelOptInfo *input_rel,
|
||||
RelOptInfo *ordered_rel);
|
||||
static void add_foreign_final_paths(PlannerInfo *root,
|
||||
RelOptInfo *input_rel,
|
||||
RelOptInfo *final_rel,
|
||||
FinalPathExtraData *extra);
|
||||
RelOptInfo *input_rel,
|
||||
RelOptInfo *final_rel,
|
||||
FinalPathExtraData *extra);
|
||||
static void apply_server_options(PgFdwRelationInfo *fpinfo);
|
||||
static void apply_table_options(PgFdwRelationInfo *fpinfo);
|
||||
static void merge_fdw_options(PgFdwRelationInfo *fpinfo,
|
||||
const PgFdwRelationInfo *fpinfo_o,
|
||||
const PgFdwRelationInfo *fpinfo_i);
|
||||
const PgFdwRelationInfo *fpinfo_o,
|
||||
const PgFdwRelationInfo *fpinfo_i);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -128,72 +128,72 @@ extern unsigned int GetPrepStmtNumber(PGconn *conn);
|
||||
extern PGresult *pgfdw_get_result(PGconn *conn, const char *query);
|
||||
extern PGresult *pgfdw_exec_query(PGconn *conn, const char *query);
|
||||
extern void pgfdw_report_error(int elevel, PGresult *res, PGconn *conn,
|
||||
bool clear, const char *sql);
|
||||
bool clear, const char *sql);
|
||||
|
||||
/* in option.c */
|
||||
extern int ExtractConnectionOptions(List *defelems,
|
||||
const char **keywords,
|
||||
const char **values);
|
||||
extern int ExtractConnectionOptions(List *defelems,
|
||||
const char **keywords,
|
||||
const char **values);
|
||||
extern List *ExtractExtensionList(const char *extensionsString,
|
||||
bool warnOnMissing);
|
||||
bool warnOnMissing);
|
||||
|
||||
/* in deparse.c */
|
||||
extern void classifyConditions(PlannerInfo *root,
|
||||
RelOptInfo *baserel,
|
||||
List *input_conds,
|
||||
List **remote_conds,
|
||||
List **local_conds);
|
||||
RelOptInfo *baserel,
|
||||
List *input_conds,
|
||||
List **remote_conds,
|
||||
List **local_conds);
|
||||
extern bool is_foreign_expr(PlannerInfo *root,
|
||||
RelOptInfo *baserel,
|
||||
Expr *expr);
|
||||
RelOptInfo *baserel,
|
||||
Expr *expr);
|
||||
extern bool is_foreign_param(PlannerInfo *root,
|
||||
RelOptInfo *baserel,
|
||||
Expr *expr);
|
||||
RelOptInfo *baserel,
|
||||
Expr *expr);
|
||||
extern void deparseInsertSql(StringInfo buf, RangeTblEntry *rte,
|
||||
Index rtindex, Relation rel,
|
||||
List *targetAttrs, bool doNothing,
|
||||
List *withCheckOptionList, List *returningList,
|
||||
List **retrieved_attrs);
|
||||
Index rtindex, Relation rel,
|
||||
List *targetAttrs, bool doNothing,
|
||||
List *withCheckOptionList, List *returningList,
|
||||
List **retrieved_attrs);
|
||||
extern void deparseUpdateSql(StringInfo buf, RangeTblEntry *rte,
|
||||
Index rtindex, Relation rel,
|
||||
List *targetAttrs,
|
||||
List *withCheckOptionList, List *returningList,
|
||||
List **retrieved_attrs);
|
||||
Index rtindex, Relation rel,
|
||||
List *targetAttrs,
|
||||
List *withCheckOptionList, List *returningList,
|
||||
List **retrieved_attrs);
|
||||
extern void deparseDirectUpdateSql(StringInfo buf, PlannerInfo *root,
|
||||
Index rtindex, Relation rel,
|
||||
RelOptInfo *foreignrel,
|
||||
List *targetlist,
|
||||
List *targetAttrs,
|
||||
List *remote_conds,
|
||||
List **params_list,
|
||||
List *returningList,
|
||||
List **retrieved_attrs);
|
||||
Index rtindex, Relation rel,
|
||||
RelOptInfo *foreignrel,
|
||||
List *targetlist,
|
||||
List *targetAttrs,
|
||||
List *remote_conds,
|
||||
List **params_list,
|
||||
List *returningList,
|
||||
List **retrieved_attrs);
|
||||
extern void deparseDeleteSql(StringInfo buf, RangeTblEntry *rte,
|
||||
Index rtindex, Relation rel,
|
||||
List *returningList,
|
||||
List **retrieved_attrs);
|
||||
Index rtindex, Relation rel,
|
||||
List *returningList,
|
||||
List **retrieved_attrs);
|
||||
extern void deparseDirectDeleteSql(StringInfo buf, PlannerInfo *root,
|
||||
Index rtindex, Relation rel,
|
||||
RelOptInfo *foreignrel,
|
||||
List *remote_conds,
|
||||
List **params_list,
|
||||
List *returningList,
|
||||
List **retrieved_attrs);
|
||||
Index rtindex, Relation rel,
|
||||
RelOptInfo *foreignrel,
|
||||
List *remote_conds,
|
||||
List **params_list,
|
||||
List *returningList,
|
||||
List **retrieved_attrs);
|
||||
extern void deparseAnalyzeSizeSql(StringInfo buf, Relation rel);
|
||||
extern void deparseAnalyzeSql(StringInfo buf, Relation rel,
|
||||
List **retrieved_attrs);
|
||||
List **retrieved_attrs);
|
||||
extern void deparseStringLiteral(StringInfo buf, const char *val);
|
||||
extern Expr *find_em_expr_for_rel(EquivalenceClass *ec, RelOptInfo *rel);
|
||||
extern Expr *find_em_expr_for_input_target(PlannerInfo *root,
|
||||
EquivalenceClass *ec,
|
||||
PathTarget *target);
|
||||
EquivalenceClass *ec,
|
||||
PathTarget *target);
|
||||
extern List *build_tlist_to_deparse(RelOptInfo *foreignrel);
|
||||
extern void deparseSelectStmtForRel(StringInfo buf, PlannerInfo *root,
|
||||
RelOptInfo *foreignrel, List *tlist,
|
||||
List *remote_conds, List *pathkeys,
|
||||
bool has_final_sort, bool has_limit,
|
||||
bool is_subquery,
|
||||
List **retrieved_attrs, List **params_list);
|
||||
RelOptInfo *foreignrel, List *tlist,
|
||||
List *remote_conds, List *pathkeys,
|
||||
bool has_final_sort, bool has_limit,
|
||||
bool is_subquery,
|
||||
List **retrieved_attrs, List **params_list);
|
||||
extern const char *get_jointype_name(JoinType jointype);
|
||||
|
||||
/* in shippable.c */
|
||||
|
@ -226,43 +226,43 @@ extern int sepgsql_set_mode(int new_mode);
|
||||
extern bool sepgsql_getenforce(void);
|
||||
|
||||
extern void sepgsql_audit_log(bool denied,
|
||||
const char *scontext,
|
||||
const char *tcontext,
|
||||
uint16 tclass,
|
||||
uint32 audited,
|
||||
const char *audit_name);
|
||||
const char *scontext,
|
||||
const char *tcontext,
|
||||
uint16 tclass,
|
||||
uint32 audited,
|
||||
const char *audit_name);
|
||||
|
||||
extern void sepgsql_compute_avd(const char *scontext,
|
||||
const char *tcontext,
|
||||
uint16 tclass,
|
||||
struct av_decision *avd);
|
||||
const char *tcontext,
|
||||
uint16 tclass,
|
||||
struct av_decision *avd);
|
||||
|
||||
extern char *sepgsql_compute_create(const char *scontext,
|
||||
const char *tcontext,
|
||||
uint16 tclass,
|
||||
const char *objname);
|
||||
const char *tcontext,
|
||||
uint16 tclass,
|
||||
const char *objname);
|
||||
|
||||
extern bool sepgsql_check_perms(const char *scontext,
|
||||
const char *tcontext,
|
||||
uint16 tclass,
|
||||
uint32 required,
|
||||
const char *audit_name,
|
||||
bool abort_on_violation);
|
||||
const char *tcontext,
|
||||
uint16 tclass,
|
||||
uint32 required,
|
||||
const char *audit_name,
|
||||
bool abort_on_violation);
|
||||
|
||||
/*
|
||||
* uavc.c
|
||||
*/
|
||||
#define SEPGSQL_AVC_NOAUDIT ((void *)(-1))
|
||||
extern bool sepgsql_avc_check_perms_label(const char *tcontext,
|
||||
uint16 tclass,
|
||||
uint32 required,
|
||||
const char *audit_name,
|
||||
bool abort_on_violation);
|
||||
uint16 tclass,
|
||||
uint32 required,
|
||||
const char *audit_name,
|
||||
bool abort_on_violation);
|
||||
extern bool sepgsql_avc_check_perms(const ObjectAddress *tobject,
|
||||
uint16 tclass,
|
||||
uint32 required,
|
||||
const char *audit_name,
|
||||
bool abort_on_violation);
|
||||
uint16 tclass,
|
||||
uint32 required,
|
||||
const char *audit_name,
|
||||
bool abort_on_violation);
|
||||
extern char *sepgsql_avc_trusted_proc(Oid functionId);
|
||||
extern void sepgsql_avc_init(void);
|
||||
|
||||
@ -274,7 +274,7 @@ extern void sepgsql_init_client_label(void);
|
||||
extern char *sepgsql_get_label(Oid relOid, Oid objOid, int32 subId);
|
||||
|
||||
extern void sepgsql_object_relabel(const ObjectAddress *object,
|
||||
const char *seclabel);
|
||||
const char *seclabel);
|
||||
|
||||
/*
|
||||
* dml.c
|
||||
@ -285,7 +285,7 @@ extern bool sepgsql_dml_privileges(List *rangeTabls, bool abort_on_violation);
|
||||
* database.c
|
||||
*/
|
||||
extern void sepgsql_database_post_create(Oid databaseId,
|
||||
const char *dtemplate);
|
||||
const char *dtemplate);
|
||||
extern void sepgsql_database_drop(Oid databaseId);
|
||||
extern void sepgsql_database_relabel(Oid databaseId, const char *seclabel);
|
||||
extern void sepgsql_database_setattr(Oid databaseId);
|
||||
@ -308,7 +308,7 @@ extern void sepgsql_schema_rename(Oid namespaceId);
|
||||
extern void sepgsql_attribute_post_create(Oid relOid, AttrNumber attnum);
|
||||
extern void sepgsql_attribute_drop(Oid relOid, AttrNumber attnum);
|
||||
extern void sepgsql_attribute_relabel(Oid relOid, AttrNumber attnum,
|
||||
const char *seclabel);
|
||||
const char *seclabel);
|
||||
extern void sepgsql_attribute_setattr(Oid relOid, AttrNumber attnum);
|
||||
extern void sepgsql_relation_post_create(Oid relOid);
|
||||
extern void sepgsql_relation_drop(Oid relOid);
|
||||
|
@ -48,41 +48,41 @@ PG_MODULE_MAGIC;
|
||||
|
||||
static HTAB *load_categories_hash(char *cats_sql, MemoryContext per_query_ctx);
|
||||
static Tuplestorestate *get_crosstab_tuplestore(char *sql,
|
||||
HTAB *crosstab_hash,
|
||||
TupleDesc tupdesc,
|
||||
MemoryContext per_query_ctx,
|
||||
bool randomAccess);
|
||||
HTAB *crosstab_hash,
|
||||
TupleDesc tupdesc,
|
||||
MemoryContext per_query_ctx,
|
||||
bool randomAccess);
|
||||
static void validateConnectbyTupleDesc(TupleDesc tupdesc, bool show_branch, bool show_serial);
|
||||
static bool compatCrosstabTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2);
|
||||
static void compatConnectbyTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2);
|
||||
static void get_normal_pair(float8 *x1, float8 *x2);
|
||||
static Tuplestorestate *connectby(char *relname,
|
||||
char *key_fld,
|
||||
char *parent_key_fld,
|
||||
char *orderby_fld,
|
||||
char *branch_delim,
|
||||
char *start_with,
|
||||
int max_depth,
|
||||
bool show_branch,
|
||||
bool show_serial,
|
||||
MemoryContext per_query_ctx,
|
||||
bool randomAccess,
|
||||
AttInMetadata *attinmeta);
|
||||
char *key_fld,
|
||||
char *parent_key_fld,
|
||||
char *orderby_fld,
|
||||
char *branch_delim,
|
||||
char *start_with,
|
||||
int max_depth,
|
||||
bool show_branch,
|
||||
bool show_serial,
|
||||
MemoryContext per_query_ctx,
|
||||
bool randomAccess,
|
||||
AttInMetadata *attinmeta);
|
||||
static void build_tuplestore_recursively(char *key_fld,
|
||||
char *parent_key_fld,
|
||||
char *relname,
|
||||
char *orderby_fld,
|
||||
char *branch_delim,
|
||||
char *start_with,
|
||||
char *branch,
|
||||
int level,
|
||||
int *serial,
|
||||
int max_depth,
|
||||
bool show_branch,
|
||||
bool show_serial,
|
||||
MemoryContext per_query_ctx,
|
||||
AttInMetadata *attinmeta,
|
||||
Tuplestorestate *tupstore);
|
||||
char *parent_key_fld,
|
||||
char *relname,
|
||||
char *orderby_fld,
|
||||
char *branch_delim,
|
||||
char *start_with,
|
||||
char *branch,
|
||||
int level,
|
||||
int *serial,
|
||||
int max_depth,
|
||||
bool show_branch,
|
||||
bool show_serial,
|
||||
MemoryContext per_query_ctx,
|
||||
AttInMetadata *attinmeta,
|
||||
Tuplestorestate *tupstore);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -39,29 +39,29 @@ typedef struct
|
||||
} TestDecodingData;
|
||||
|
||||
static void pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
|
||||
bool is_init);
|
||||
bool is_init);
|
||||
static void pg_decode_shutdown(LogicalDecodingContext *ctx);
|
||||
static void pg_decode_begin_txn(LogicalDecodingContext *ctx,
|
||||
ReorderBufferTXN *txn);
|
||||
ReorderBufferTXN *txn);
|
||||
static void pg_output_begin(LogicalDecodingContext *ctx,
|
||||
TestDecodingData *data,
|
||||
ReorderBufferTXN *txn,
|
||||
bool last_write);
|
||||
TestDecodingData *data,
|
||||
ReorderBufferTXN *txn,
|
||||
bool last_write);
|
||||
static void pg_decode_commit_txn(LogicalDecodingContext *ctx,
|
||||
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
|
||||
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
|
||||
static void pg_decode_change(LogicalDecodingContext *ctx,
|
||||
ReorderBufferTXN *txn, Relation rel,
|
||||
ReorderBufferChange *change);
|
||||
ReorderBufferTXN *txn, Relation rel,
|
||||
ReorderBufferChange *change);
|
||||
static void pg_decode_truncate(LogicalDecodingContext *ctx,
|
||||
ReorderBufferTXN *txn,
|
||||
int nrelations, Relation relations[],
|
||||
ReorderBufferChange *change);
|
||||
ReorderBufferTXN *txn,
|
||||
int nrelations, Relation relations[],
|
||||
ReorderBufferChange *change);
|
||||
static bool pg_decode_filter(LogicalDecodingContext *ctx,
|
||||
RepOriginId origin_id);
|
||||
RepOriginId origin_id);
|
||||
static void pg_decode_message(LogicalDecodingContext *ctx,
|
||||
ReorderBufferTXN *txn, XLogRecPtr message_lsn,
|
||||
bool transactional, const char *prefix,
|
||||
Size sz, const char *message);
|
||||
ReorderBufferTXN *txn, XLogRecPtr message_lsn,
|
||||
bool transactional, const char *prefix,
|
||||
Size sz, const char *message);
|
||||
|
||||
void
|
||||
_PG_init(void)
|
||||
|
@ -55,20 +55,20 @@ typedef struct
|
||||
} SystemRowsSamplerData;
|
||||
|
||||
static void system_rows_samplescangetsamplesize(PlannerInfo *root,
|
||||
RelOptInfo *baserel,
|
||||
List *paramexprs,
|
||||
BlockNumber *pages,
|
||||
double *tuples);
|
||||
RelOptInfo *baserel,
|
||||
List *paramexprs,
|
||||
BlockNumber *pages,
|
||||
double *tuples);
|
||||
static void system_rows_initsamplescan(SampleScanState *node,
|
||||
int eflags);
|
||||
int eflags);
|
||||
static void system_rows_beginsamplescan(SampleScanState *node,
|
||||
Datum *params,
|
||||
int nparams,
|
||||
uint32 seed);
|
||||
Datum *params,
|
||||
int nparams,
|
||||
uint32 seed);
|
||||
static BlockNumber system_rows_nextsampleblock(SampleScanState *node, BlockNumber nblocks);
|
||||
static OffsetNumber system_rows_nextsampletuple(SampleScanState *node,
|
||||
BlockNumber blockno,
|
||||
OffsetNumber maxoffset);
|
||||
BlockNumber blockno,
|
||||
OffsetNumber maxoffset);
|
||||
static uint32 random_relative_prime(uint32 n, SamplerRandomState randstate);
|
||||
|
||||
|
||||
|
@ -55,20 +55,20 @@ typedef struct
|
||||
} SystemTimeSamplerData;
|
||||
|
||||
static void system_time_samplescangetsamplesize(PlannerInfo *root,
|
||||
RelOptInfo *baserel,
|
||||
List *paramexprs,
|
||||
BlockNumber *pages,
|
||||
double *tuples);
|
||||
RelOptInfo *baserel,
|
||||
List *paramexprs,
|
||||
BlockNumber *pages,
|
||||
double *tuples);
|
||||
static void system_time_initsamplescan(SampleScanState *node,
|
||||
int eflags);
|
||||
int eflags);
|
||||
static void system_time_beginsamplescan(SampleScanState *node,
|
||||
Datum *params,
|
||||
int nparams,
|
||||
uint32 seed);
|
||||
Datum *params,
|
||||
int nparams,
|
||||
uint32 seed);
|
||||
static BlockNumber system_time_nextsampleblock(SampleScanState *node, BlockNumber nblocks);
|
||||
static OffsetNumber system_time_nextsampletuple(SampleScanState *node,
|
||||
BlockNumber blockno,
|
||||
OffsetNumber maxoffset);
|
||||
BlockNumber blockno,
|
||||
OffsetNumber maxoffset);
|
||||
static uint32 random_relative_prime(uint32 n, SamplerRandomState randstate);
|
||||
|
||||
|
||||
|
@ -41,16 +41,16 @@ typedef struct
|
||||
/* local declarations */
|
||||
|
||||
static xmlChar *pgxmlNodeSetToText(xmlNodeSetPtr nodeset,
|
||||
xmlChar *toptagname, xmlChar *septagname,
|
||||
xmlChar *plainsep);
|
||||
xmlChar *toptagname, xmlChar *septagname,
|
||||
xmlChar *plainsep);
|
||||
|
||||
static text *pgxml_result_to_text(xmlXPathObjectPtr res, xmlChar *toptag,
|
||||
xmlChar *septag, xmlChar *plainsep);
|
||||
xmlChar *septag, xmlChar *plainsep);
|
||||
|
||||
static xmlChar *pgxml_texttoxmlchar(text *textstring);
|
||||
|
||||
static xmlXPathObjectPtr pgxml_xpath(text *document, xmlChar *xpath,
|
||||
xpath_workspace *workspace);
|
||||
xpath_workspace *workspace);
|
||||
|
||||
static void cleanup_workspace(xpath_workspace *workspace);
|
||||
|
||||
|
Reference in New Issue
Block a user