bool g_cube_internal_consistent(NDBOX *key, NDBOX *query, StrategyNumber strategy);
/*
-** Auxiliary funxtions
+** Auxiliary functions
*/
static double distance_1D(double a1, double a2, double b1, double b2);
static bool cube_is_point_internal(NDBOX *cube);
#define GETSIGN(x) ( (BITVECP)( (char*)x+GTHDRSIZE ) )
-/*
- * types for functions
- */
-typedef ArrayType *(*formarray) (ArrayType *, ArrayType *);
-typedef void (*formfloat) (ArrayType *, float *);
-
/*
* useful functions
*/
state.str = tmp;
}
- /* set user friendly-operand view */
+ /* set user-friendly operand view */
memcpy((void *) GETOPERAND(query), (void *) state.op, state.sumlen);
pfree(state.op);
}
/* -------------------------------------------------
- * GetHashPageStatis()
+ * GetHashPageStats()
*
* Collect statistics of single hash page
* -------------------------------------------------
* Convert 'fetched_data' into the a Datum of the original datatype.
*/
- /* fill *retval from fetch_data. */
+ /* fill *retval from fetched_data. */
gistentryinit(*retval, PointerGetDatum(converted_datum),
entry->rel, entry->page, entry->offset, FALSE);
* The posting list can be accessed with GinGetPosting(itup)
-* If GinITupIsCompressed(itup), the posting list is stored in compressed
+* If GinItupIsCompressed(itup), the posting list is stored in compressed
format. Otherwise it is just an array of ItemPointers. New tuples are always
stored in compressed format, uncompressed items can be present if the
database was migrated from 9.3 or earlier version.
/*
* As pending list pages can have a high churn rate, it is desirable to
- * recycle them immediately to the FreeSpace Map when ordinary backends
+ * recycle them immediately to the FreeSpaceMap when ordinary backends
* clean the list.
*/
if (fsm_vac && fill_fsm)
pages. The caller must then call gistplacetopage() on the parent page to
insert the downlink tuples. The parent page that holds the downlink to
the child might have migrated as a result of concurrent splits of the
-parent, gistfindCorrectParent() is used to find the parent page.
+parent, gistFindCorrectParent() is used to find the parent page.
Splitting the root page works slightly differently. At root split,
gistplacetopage() allocates the new child pages and replaces the old root
/*
* Leaf page. Insert the new key. We've already updated all the
* parents on the way down, but we might have to split the page if
- * it doesn't fit. gistinserthere() will take care of that.
+ * it doesn't fit. gistinserttuple() will take care of that.
*/
/*
insertion on the parent level (which might itself be a page split, requiring
an additional insertion above that, etc).
-For a root split, the followon WAL entry is a "new root" entry rather than
+For a root split, the follow-on WAL entry is a "new root" entry rather than
an "insertion" entry, but details are otherwise much the same.
Because splitting involves multiple atomic actions, it's possible that the
{
MemoryContext oldCtx;
- /*
- * clear traversal context before proceeding to the next scan; this must
- * not happen before the freeScanStack above, else we get double-free
- * crashes.
- */
MemoryContextReset(so->traversalCxt);
oldCtx = MemoryContextSwitchTo(so->traversalCxt);
* NB: this is a low-level routine and is NOT the preferred entry point
* for most uses; functions in transam.c are the intended callers.
*
- * XXX Think about issuing FADVISE_WILLNEED on pages that we will need,
+ * XXX Think about issuing POSIX_FADV_WILLNEED on pages that we will need,
* but aren't yet in cache, as well as hinting pages not to fall out of
* cache yet.
*/
namestrcpy(&attrtypes[attnum]->attname, name);
elog(DEBUG4, "column %s %s", NameStr(attrtypes[attnum]->attname), type);
- attrtypes[attnum]->attnum = attnum + 1; /* fillatt */
+ attrtypes[attnum]->attnum = attnum + 1;
typeoid = gettype(type);
/*
* get_ts_dict_oid - find a TS dictionary by possibly qualified name
*
- * If not found, returns InvalidOid if failOK, else throws error
+ * If not found, returns InvalidOid if missing_ok, else throws error
*/
Oid
get_ts_dict_oid(List *names, bool missing_ok)
* This function handles only one grouping set (already set in
* aggstate->current_set).
*
- * The finalfunction will be run, and the result delivered, in the
+ * The finalfn will be run, and the result delivered, in the
* output-tuple context; caller's CurrentMemoryContext does not matter.
*
* The finalfn uses the state as set in the transno. This also might be
* fix_upper_expr() to the Result node's tlist. This would fail if the
* Vars generated by generate_setop_tlist() were not exactly equal()
* to the corresponding tlist entries of the subplan. However, since
- * the subplan was generated by generate_union_plan() or
- * generate_nonunion_plan(), and hence its tlist was generated by
+ * the subplan was generated by generate_union_paths() or
+ * generate_nonunion_paths(), and hence its tlist was generated by
* generate_append_tlist(), this will work. We just tell
* generate_setop_tlist() to use varno 0.
*/
static bool check_agg_arguments_walker(Node *node,
check_agg_arguments_context *context);
static void check_ungrouped_columns(Node *node, ParseState *pstate, Query *qry,
- List *groupClauses, List *groupClauseVars,
+ List *groupClauses, List *groupClauseCommonVars,
bool have_non_var_grouping,
List **func_grouped_rels);
static bool check_ungrouped_columns_walker(Node *node,
* a ConvertRowtypeExpr to map back to the rowtype expected by the expression.
* (Therefore, to_rowtype had better be a child rowtype of the rowtype of the
* RTE we're changing references to.) Callers that don't provide to_rowtype
- * should report an error if *found_row_type is true; we don't do that here
+ * should report an error if *found_whole_row is true; we don't do that here
* because we don't know exactly what wording for the error message would
* be most appropriate. The caller will be aware of the context.
*
static void UnpinBuffer(BufferDesc *buf, bool fixOwner);
static void BufferSync(int flags);
static uint32 WaitBufHdrUnlocked(BufferDesc *buf);
-static int SyncOneBuffer(int buf_id, bool skip_recently_used, WritebackContext *flush_context);
+static int SyncOneBuffer(int buf_id, bool skip_recently_used,
+ WritebackContext *wb_context);
static void WaitIO(BufferDesc *buf);
static bool StartBufferIO(BufferDesc *buf, bool forInput);
static void TerminateBufferIO(BufferDesc *buf, bool clear_dirty,
* BUF_REUSABLE: buffer is available for replacement, ie, it has
* pin count 0 and usage count 0.
*
- * (BUF_WRITTEN could be set in error if FlushBuffers finds the buffer clean
+ * (BUF_WRITTEN could be set in error if FlushBuffer finds the buffer clean
* after locking it, but we don't care all that much.)
*
* Note: caller must have done ResourceOwnerEnlargeBuffers.
/*
* Relative seek considers only the signed offset, ignoring
- * fileno. Note that large offsets (> 1 gig) risk overflow in this
+ * fileno. Note that large offsets (> 1 GB) risk overflow in this
* add, unless we have 64-bit off_t.
*/
newFile = file->curFile;
/*
* set_max_safe_fds
- * Determine number of filedescriptors that fd.c is allowed to use
+ * Determine number of file descriptors that fd.c is allowed to use
*/
void
set_max_safe_fds(void)
}
/*
- * GetRecordedFreePage - return the amount of free space on a particular page,
+ * GetRecordedFreeSpace - return the amount of free space on a particular page,
* according to the FSM.
*/
Size
/*
* Which category does a page need to have, to accommodate x bytes of data?
- * While fsm_size_to_avail_cat() rounds down, this needs to round up.
+ * While fsm_space_avail_to_cat() rounds down, this needs to round up.
*/
static uint8
fsm_space_needed_to_cat(Size needed)
/*
* To make the fast-path lock mechanism work, we must have some way of
- * preventing the use of the fast-path when a conflicting lock might be
- * present. We partition* the locktag space into FAST_PATH_HASH_BUCKETS
- * partitions, and maintain an integer count of the number of "strong" lockers
+ * preventing the use of the fast-path when a conflicting lock might be present.
+ * We partition* the locktag space into FAST_PATH_STRONG_LOCK_HASH_PARTITIONS,
+ * and maintain an integer count of the number of "strong" lockers
* in each partition. When any "strong" lockers are present (which is
* hopefully not very often), the fast-path mechanism can't be used, and we
* must fall back to the slower method of pushing matching locks directly
}
/*
- * FastPathGetLockEntry
+ * FastPathGetRelationLockEntry
* Return the PROCLOCK for a lock originally taken via the fast-path,
* transferring it to the primary lock table if necessary.
*
* the lock, then we needn't examine the individual relation IDs
* at all; none of them can be relevant.
*
- * See FastPathTransferLocks() for discussion of why we do this
- * test after acquiring the lock.
+ * See FastPathTransferRelationLocks() for discussion of why we do
+ * this test after acquiring the lock.
*/
if (proc->databaseId != locktag->locktag_field1)
{
*
* If this value is changing, we don't care that much whether we get the
* old or new value -- it is just used to determine how far
- * GlobalSerializableXmin must advance before this transaction can be
- * fully cleaned up. The worst that could happen is we wait for one more
+ * SxactGlobalXmin must advance before this transaction can be fully
+ * cleaned up. The worst that could happen is we wait for one more
* transaction to complete before freeing some RAM; correctness of visible
* behavior is not affected.
*/
*
* If a dangerous structure is found, the pivot (the near conflict) is
* marked for death, because rolling back another transaction might mean
- * that we flail without ever making progress. This transaction is
+ * that we fail without ever making progress. This transaction is
* committing writes, so letting it commit ensures progress. If we
* canceled the far conflict, it might immediately fail again on retry.
*/
#define ALL_UPPER 2 /* NAME */
#define ALL_LOWER 3 /* name */
-#define FULL_SIZ 0
-
#define MAX_MONTH_LEN 9
#define MAX_MON_LEN 3
#define MAX_DAY_LEN 9
/*
* static char *
- * inet_cidr_ntop_ipv6(src, bits, fakebits, dst, size)
+ * inet_cidr_ntop_ipv6(src, bits, dst, size)
* convert IPv6 network number from network to presentation format.
* generates CIDR style result always. Picks the shortest representation
* unless the IP is really IPv4.
/* ----------
- * get_ruledef - Do it all and return a text
+ * pg_get_ruledef - Do it all and return a text
* that could be used as a statement
* to recreate the rule
* ----------
/* ----------
- * get_viewdef - Mainly the same thing, but we
+ * pg_get_viewdef - Mainly the same thing, but we
* only return the SELECT part of a view
* ----------
*/
}
/* ----------
- * get_triggerdef - Get the definition of a trigger
+ * pg_get_triggerdef - Get the definition of a trigger
* ----------
*/
Datum
}
/* ----------
- * get_indexdef - Get the definition of an index
+ * pg_get_indexdef - Get the definition of an index
*
* In the extended version, there is a colno argument as well as pretty bool.
* if colno == 0, we want a complete index definition.
/* ----------
- * get_expr - Decompile an expression tree
+ * pg_get_expr - Decompile an expression tree
*
* Input: an expression tree in nodeToString form, and a relation OID
*
/* ----------
- * get_userbyid - Get a user name by roleid and
+ * pg_get_userbyid - Get a user name by roleid and
* fallback to 'unknown (OID=n)'
* ----------
*/
/*
* Deparse a Var which references OUTER_VAR, INNER_VAR, or INDEX_VAR. This
- * routine is actually a callback for get_special_varno, which handles finding
- * the correct TargetEntry. We get the expression contained in that
+ * routine is actually a callback for resolve_special_varno, which handles
+ * finding the correct TargetEntry. We get the expression contained in that
* TargetEntry and just need to deparse it, a job we can throw back on
* get_rule_expr.
*/
}
/*
- * get_one_range_partition_bound_string
+ * get_range_partbound_string
* A C string representation of one range partition bound
*/
char *
/*
* Any other process that has freed a segment has incremented
- * free_segment_counter while holding an LWLock, and that must precede any
- * backend creating a new segment in the same slot while holding an
+ * freed_segment_counter while holding an LWLock, and that must precede
+ * any backend creating a new segment in the same slot while holding an
* LWLock, and that must precede the creation of any dsa_pointer pointing
* into the new segment which might reach us here, and the caller must
* have sent the dsa_pointer to this process using appropriate memory
/*
* Find all the inheritance information, excluding implicit inheritance
- * via partitioning. We handle that case using getPartitions(), because
- * we want more information about partitions than just the parent-child
- * relationship.
+ * via partitioning.
*/
appendPQExpBufferStr(query, "SELECT inhrelid, inhparent FROM pg_inherits");
ExtensionInfo *ext; /* owning extension */
} ExtensionMemberId;
-/* global decls */
-extern bool force_quotes; /* double-quotes for identifiers flag */
-
/* placeholders for comment starting and ending delimiters */
extern char g_comment_start[10];
extern char g_comment_end[10];
{
/*
* It would make more sense to freeze after loading the schema, but that
- * would cause us to lose the frozenids restored by the load. We use
+ * would cause us to lose the frozenxids restored by the load. We use
* --analyze so autovacuum doesn't update statistics later
*/
prep_status("Analyzing all rows in the new cluster");
extern void gistdoinsert(Relation r,
IndexTuple itup,
Size freespace,
- GISTSTATE *GISTstate,
+ GISTSTATE *giststate,
Relation heapRel,
bool is_build);
const char *recovername, off_t expectedSize,
bool cleanupEnabled);
extern void ExecuteRecoveryCommand(const char *command, const char *commandName,
- bool failOnerror);
+ bool failOnSignal);
extern void KeepFileRestoredFromArchive(const char *path, const char *xlogfname);
extern void XLogArchiveNotify(const char *xlog);
extern void XLogArchiveNotifySeg(XLogSegNo segno);
(OidIsValid(userid) ? GetUserNameFromId(userid, false) : "public")
-/*
- * Generic option types for validation.
- * NB! These are treated as flags, so use only powers of two here.
- */
-typedef enum
-{
- ServerOpt = 1, /* options applicable to SERVER */
- UserMappingOpt = 2, /* options for USER MAPPING */
- FdwOpt = 4 /* options for FOREIGN DATA WRAPPER */
-} GenericOptionFlags;
-
typedef struct ForeignDataWrapper
{
Oid fdwid; /* FDW Oid */
extern int MaxLivePostmasterChildren(void);
-extern int GetNumShmemAttachedBgworkers(void);
extern bool PostmasterMarkPIDForWorkerNotify(int);
#ifdef EXEC_BACKEND
/*-------------------------------------------------------------------------
*
- * fsm_internal.h
+ * fsm_internals.h
* internal functions for free space map
*
*
*
* Eligibility for cleanup of committed transactions is generally determined
* by comparing the transaction's finishedBefore field to
- * SerializableGlobalXmin.
+ * SxactGlobalXmin.
*/
typedef struct SERIALIZABLEXACT
{
/* and fill the temp-string wit '0's up to there. */
dotpos = getRightMostDot(fmt);
- /* start to parse the formatstring */
+ /* start to parse the format-string */
temp[0] = '\0';
k = value.digits - 1; /* position in the value_string */
for (i = fmt_len - 1, j = 0; i >= 0; i--, j++)
ghst
#endif
{"gilt", TZ, 43200}, /* Gilbert Islands Time */
- {"gmt", TZ, 0}, /* Greenwish Mean Time */
+ {"gmt", TZ, 0}, /* Greenwich Mean Time */
{"gst", TZ, 36000}, /* Guam Std Time, USSR Zone 9 */
{"gyt", TZ, -14400}, /* Guyana Time */
{"h", UNITS, DTK_HOUR}, /* "hour" */
/*
* Wrapper around gethostbyname() or gethostbyname_r() to mimic
* POSIX gethostbyname_r() behaviour, if it is not available or required.
- * This function is called _only_ by our getaddinfo() portability function.
+ * This function is called _only_ by our getaddrinfo() portability function.
*/
#ifndef HAVE_GETADDRINFO
int
# header file). IPC::Run's result function always returns exit code >> 8,
# assuming the Unix convention, which will always return 0 on Windows as
# long as the process was not terminated by an exception. To work around
- # that, use $h->full_result on Windows instead.
+ # that, use $h->full_results on Windows instead.
my $result =
($Config{osname} eq "MSWin32")
? ($h->full_results)[0]