mirror of
https://github.com/postgres/postgres.git
synced 2025-04-25 21:42:33 +03:00
Remove tabs after spaces in C comments
This was not changed in HEAD, but will be done later as part of a pgindent run. Future pgindent runs will also do this. Report by Tom Lane Backpatch through all supported branches, but not HEAD
This commit is contained in:
parent
e0070a6858
commit
2616a5d300
@ -93,7 +93,7 @@ gbt_intv_dist(const void *a, const void *b)
|
||||
|
||||
/*
|
||||
* INTERVALSIZE should be the actual size-on-disk of an Interval, as shown
|
||||
* in pg_type. This might be less than sizeof(Interval) if the compiler
|
||||
* in pg_type. This might be less than sizeof(Interval) if the compiler
|
||||
* insists on adding alignment padding at the end of the struct.
|
||||
*/
|
||||
#define INTERVALSIZE 16
|
||||
|
@ -564,7 +564,7 @@ g_cube_picksplit(PG_FUNCTION_ARGS)
|
||||
rt_cube_size(datum_r, &size_r);
|
||||
|
||||
/*
|
||||
* Now split up the regions between the two seeds. An important property
|
||||
* Now split up the regions between the two seeds. An important property
|
||||
* of this split algorithm is that the split vector v has the indices of
|
||||
* items to be split in order in its left and right vectors. We exploit
|
||||
* this property by doing a merge in the code that actually splits the
|
||||
@ -580,7 +580,7 @@ g_cube_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
/*
|
||||
* If we've already decided where to place this item, just put it on
|
||||
* the right list. Otherwise, we need to figure out which page needs
|
||||
* the right list. Otherwise, we need to figure out which page needs
|
||||
* the least enlargement in order to store the item.
|
||||
*/
|
||||
|
||||
|
@ -1987,7 +1987,7 @@ get_tuple_of_interest(Relation rel, int *pkattnums, int pknumatts, char **src_pk
|
||||
* Build sql statement to look up tuple of interest, ie, the one matching
|
||||
* src_pkattvals. We used to use "SELECT *" here, but it's simpler to
|
||||
* generate a result tuple that matches the table's physical structure,
|
||||
* with NULLs for any dropped columns. Otherwise we have to deal with two
|
||||
* with NULLs for any dropped columns. Otherwise we have to deal with two
|
||||
* different tupdescs and everything's very confusing.
|
||||
*/
|
||||
appendStringInfoString(&buf, "SELECT ");
|
||||
@ -2213,7 +2213,7 @@ dblink_security_check(PGconn *conn, remoteConn *rconn)
|
||||
}
|
||||
|
||||
/*
|
||||
* For non-superusers, insist that the connstr specify a password. This
|
||||
* For non-superusers, insist that the connstr specify a password. This
|
||||
* prevents a password from being picked up from .pgpass, a service file,
|
||||
* the environment, etc. We don't want the postgres user's passwords
|
||||
* to be accessible to non-superusers.
|
||||
|
@ -91,7 +91,7 @@ geo_distance_internal(Point *pt1, Point *pt2)
|
||||
* distance between the points in miles on earth's surface
|
||||
*
|
||||
* If float8 is passed-by-value, the oldstyle version-0 calling convention
|
||||
* is unportable, so we use version-1. However, if it's passed-by-reference,
|
||||
* is unportable, so we use version-1. However, if it's passed-by-reference,
|
||||
* continue to use oldstyle. This is just because we'd like earthdistance
|
||||
* to serve as a canary for any unintentional breakage of version-0 functions
|
||||
* with float8 results.
|
||||
|
@ -518,7 +518,7 @@ estimate_costs(PlannerInfo *root, RelOptInfo *baserel,
|
||||
|
||||
/*
|
||||
* Now estimate the number of rows returned by the scan after applying the
|
||||
* baserestrictinfo quals. This is pretty bogus too, since the planner
|
||||
* baserestrictinfo quals. This is pretty bogus too, since the planner
|
||||
* will have no stats about the relation, but it's better than nothing.
|
||||
*/
|
||||
nrows = ntuples *
|
||||
@ -534,7 +534,7 @@ estimate_costs(PlannerInfo *root, RelOptInfo *baserel,
|
||||
baserel->rows = nrows;
|
||||
|
||||
/*
|
||||
* Now estimate costs. We estimate costs almost the same way as
|
||||
* Now estimate costs. We estimate costs almost the same way as
|
||||
* cost_seqscan(), thus assuming that I/O costs are equivalent to a
|
||||
* regular table file of the same size. However, we take per-tuple CPU
|
||||
* costs as 10x of a seqscan, to account for the cost of parsing records.
|
||||
|
@ -50,7 +50,7 @@ static int levenshtein_internal(text *s, text *t,
|
||||
* array.
|
||||
*
|
||||
* If max_d >= 0, we only need to provide an accurate answer when that answer
|
||||
* is less than or equal to the bound. From any cell in the matrix, there is
|
||||
* is less than or equal to the bound. From any cell in the matrix, there is
|
||||
* theoretical "minimum residual distance" from that cell to the last column
|
||||
* of the final row. This minimum residual distance is zero when the
|
||||
* untransformed portions of the strings are of equal length (because we might
|
||||
@ -141,7 +141,7 @@ levenshtein_internal(text *s, text *t,
|
||||
stop_column = m + 1;
|
||||
|
||||
/*
|
||||
* If max_d >= 0, determine whether the bound is impossibly tight. If so,
|
||||
* If max_d >= 0, determine whether the bound is impossibly tight. If so,
|
||||
* return max_d + 1 immediately. Otherwise, determine whether it's tight
|
||||
* enough to limit the computation we must perform. If so, figure out
|
||||
* initial stop column.
|
||||
@ -168,7 +168,7 @@ levenshtein_internal(text *s, text *t,
|
||||
* need to fill in. If the string is growing, the theoretical
|
||||
* minimum distance already incorporates the cost of deleting the
|
||||
* number of characters necessary to make the two strings equal in
|
||||
* length. Each additional deletion forces another insertion, so
|
||||
* length. Each additional deletion forces another insertion, so
|
||||
* the best-case total cost increases by ins_c + del_c. If the
|
||||
* string is shrinking, the minimum theoretical cost assumes no
|
||||
* excess deletions; that is, we're starting no futher right than
|
||||
@ -246,7 +246,7 @@ levenshtein_internal(text *s, text *t,
|
||||
/*
|
||||
* The main loop fills in curr, but curr[0] needs a special case: to
|
||||
* transform the first 0 characters of s into the first j characters
|
||||
* of t, we must perform j insertions. However, if start_column > 0,
|
||||
* of t, we must perform j insertions. However, if start_column > 0,
|
||||
* this special case does not apply.
|
||||
*/
|
||||
if (start_column == 0)
|
||||
|
@ -12,7 +12,7 @@
|
||||
* HEntry: there is one of these for each key _and_ value in an hstore
|
||||
*
|
||||
* the position offset points to the _end_ so that we can get the length
|
||||
* by subtraction from the previous entry. the ISFIRST flag lets us tell
|
||||
* by subtraction from the previous entry. the ISFIRST flag lets us tell
|
||||
* whether there is a previous entry.
|
||||
*/
|
||||
typedef struct
|
||||
|
@ -13,7 +13,7 @@
|
||||
/*
|
||||
* When using a GIN index for hstore, we choose to index both keys and values.
|
||||
* The storage format is "text" values, with K, V, or N prepended to the string
|
||||
* to indicate key, value, or null values. (As of 9.1 it might be better to
|
||||
* to indicate key, value, or null values. (As of 9.1 it might be better to
|
||||
* store null values as nulls, but we'll keep it this way for on-disk
|
||||
* compatibility.)
|
||||
*/
|
||||
@ -168,7 +168,7 @@ gin_consistent_hstore(PG_FUNCTION_ARGS)
|
||||
{
|
||||
/*
|
||||
* Index doesn't have information about correspondence of keys and
|
||||
* values, so we need recheck. However, if not all the keys are
|
||||
* values, so we need recheck. However, if not all the keys are
|
||||
* present, we can fail at once.
|
||||
*/
|
||||
*recheck = true;
|
||||
|
@ -355,7 +355,7 @@ gin_bool_consistent(QUERYTYPE *query, bool *check)
|
||||
return FALSE;
|
||||
|
||||
/*
|
||||
* Set up data for checkcondition_gin. This must agree with the query
|
||||
* Set up data for checkcondition_gin. This must agree with the query
|
||||
* extraction code in ginint4_queryextract.
|
||||
*/
|
||||
gcv.first = items;
|
||||
|
@ -482,7 +482,7 @@ g_int_picksplit(PG_FUNCTION_ARGS)
|
||||
qsort((void *) costvector, maxoff, sizeof(SPLITCOST), comparecost);
|
||||
|
||||
/*
|
||||
* Now split up the regions between the two seeds. An important property
|
||||
* Now split up the regions between the two seeds. An important property
|
||||
* of this split algorithm is that the split vector v has the indices of
|
||||
* items to be split in order in its left and right vectors. We exploit
|
||||
* this property by doing a merge in the code that actually splits the
|
||||
@ -500,7 +500,7 @@ g_int_picksplit(PG_FUNCTION_ARGS)
|
||||
|
||||
/*
|
||||
* If we've already decided where to place this item, just put it on
|
||||
* the right list. Otherwise, we need to figure out which page needs
|
||||
* the right list. Otherwise, we need to figure out which page needs
|
||||
* the least enlargement in order to store the item.
|
||||
*/
|
||||
|
||||
|
@ -184,7 +184,7 @@ rt__int_size(ArrayType *a, float *size)
|
||||
*size = (float) ARRNELEMS(a);
|
||||
}
|
||||
|
||||
/* Sort the given data (len >= 2). Return true if any duplicates found */
|
||||
/* Sort the given data (len >= 2). Return true if any duplicates found */
|
||||
bool
|
||||
isort(int4 *a, int len)
|
||||
{
|
||||
@ -196,7 +196,7 @@ isort(int4 *a, int len)
|
||||
bool r = FALSE;
|
||||
|
||||
/*
|
||||
* We use a simple insertion sort. While this is O(N^2) in the worst
|
||||
* We use a simple insertion sort. While this is O(N^2) in the worst
|
||||
* case, it's quite fast if the input is already sorted or nearly so.
|
||||
* Also, for not-too-large inputs it's faster than more complex methods
|
||||
* anyhow.
|
||||
|
@ -612,7 +612,7 @@ ltreeparentsel(PG_FUNCTION_ARGS)
|
||||
/*
|
||||
* If the histogram is large enough, see what fraction of it the
|
||||
* constant is "<@" to, and assume that's representative of the
|
||||
* non-MCV population. Otherwise use the default selectivity for the
|
||||
* non-MCV population. Otherwise use the default selectivity for the
|
||||
* non-MCV population.
|
||||
*/
|
||||
selec = histogram_selectivity(&vardata, &contproc,
|
||||
|
@ -430,7 +430,7 @@ sql_exec(PGconn *conn, const char *todo, bool quiet)
|
||||
}
|
||||
|
||||
/*
|
||||
* Dump all databases. There are no system objects to worry about.
|
||||
* Dump all databases. There are no system objects to worry about.
|
||||
*/
|
||||
void
|
||||
sql_exec_dumpalldbs(PGconn *conn, struct options * opts)
|
||||
|
@ -102,7 +102,7 @@ CleanupPriorWALFiles(void)
|
||||
{
|
||||
/*
|
||||
* We ignore the timeline part of the XLOG segment identifiers in
|
||||
* deciding whether a segment is still needed. This ensures that
|
||||
* deciding whether a segment is still needed. This ensures that
|
||||
* we won't prematurely remove a segment from a parent timeline.
|
||||
* We could probably be a little more proactive about removing
|
||||
* segments of non-parent timelines, but that would be a whole lot
|
||||
|
@ -948,7 +948,7 @@ pgss_memsize(void)
|
||||
* caller must hold an exclusive lock on pgss->lock
|
||||
*
|
||||
* Note: despite needing exclusive lock, it's not an error for the target
|
||||
* entry to already exist. This is because pgss_store releases and
|
||||
* entry to already exist. This is because pgss_store releases and
|
||||
* reacquires lock after failing to find a match; so someone else could
|
||||
* have made the entry while we waited to get exclusive lock.
|
||||
*/
|
||||
|
@ -201,7 +201,7 @@ gtrgm_consistent(PG_FUNCTION_ARGS)
|
||||
|
||||
/*
|
||||
* Store both the strategy number and extracted trigrams in cache, because
|
||||
* trigram extraction is relatively CPU-expensive. We must include
|
||||
* trigram extraction is relatively CPU-expensive. We must include
|
||||
* strategy number because trigram extraction depends on strategy.
|
||||
*/
|
||||
if (cache == NULL || strategy != *((StrategyNumber *) cache) ||
|
||||
|
@ -25,7 +25,7 @@
|
||||
* pg_control data. pg_resetxlog cannot be run while the server is running
|
||||
* so we use pg_controldata; pg_controldata doesn't provide all the fields
|
||||
* we need to actually perform the upgrade, but it provides enough for
|
||||
* check mode. We do not implement pg_resetxlog -n because it is hard to
|
||||
* check mode. We do not implement pg_resetxlog -n because it is hard to
|
||||
* return valid xid data for a running server.
|
||||
*/
|
||||
void
|
||||
|
@ -33,7 +33,7 @@ generate_old_dump(void)
|
||||
* split_old_dump
|
||||
*
|
||||
* This function splits pg_dumpall output into global values and
|
||||
* database creation, and per-db schemas. This allows us to create
|
||||
* database creation, and per-db schemas. This allows us to create
|
||||
* the support functions between restoring these two parts of the
|
||||
* dump. We split on the first "\connect " after a CREATE ROLE
|
||||
* username match; this is where the per-db restore starts.
|
||||
|
@ -147,7 +147,7 @@ win32_check_directory_write_permissions(void)
|
||||
*
|
||||
* This function validates the given cluster directory - we search for a
|
||||
* small set of subdirectories that we expect to find in a valid $PGDATA
|
||||
* directory. If any of the subdirectories are missing (or secured against
|
||||
* directory. If any of the subdirectories are missing (or secured against
|
||||
* us) we display an error message and exit()
|
||||
*
|
||||
*/
|
||||
@ -187,7 +187,7 @@ check_data_dir(const char *pg_data)
|
||||
* check_bin_dir()
|
||||
*
|
||||
* This function searches for the executables that we expect to find
|
||||
* in the binaries directory. If we find that a required executable
|
||||
* in the binaries directory. If we find that a required executable
|
||||
* is missing (or secured against us), we display an error message and
|
||||
* exit().
|
||||
*/
|
||||
|
@ -28,11 +28,11 @@ static pageCnvCtx *loadConverterPlugin(
|
||||
* the PageLayoutVersion of the new cluster. If the versions differ, this
|
||||
* function loads a converter plugin and returns a pointer to a pageCnvCtx
|
||||
* object (in *result) that knows how to convert pages from the old format
|
||||
* to the new format. If the versions are identical, this function just
|
||||
* to the new format. If the versions are identical, this function just
|
||||
* returns a NULL pageCnvCtx pointer to indicate that page-by-page conversion
|
||||
* is not required.
|
||||
*
|
||||
* If successful this function sets *result and returns NULL. If an error
|
||||
* If successful this function sets *result and returns NULL. If an error
|
||||
* occurs, this function returns an error message in the form of an null-terminated
|
||||
* string.
|
||||
*/
|
||||
@ -122,7 +122,7 @@ getPageVersion(uint16 *version, const char *pathName)
|
||||
* This function loads a page-converter plugin library and grabs a
|
||||
* pointer to each of the (interesting) functions provided by that
|
||||
* plugin. The name of the plugin library is derived from the given
|
||||
* newPageVersion and oldPageVersion. If a plugin is found, this
|
||||
* newPageVersion and oldPageVersion. If a plugin is found, this
|
||||
* function returns a pointer to a pageCnvCtx object (which will contain
|
||||
* a collection of plugin function pointers). If the required plugin
|
||||
* is not found, this function returns NULL.
|
||||
|
@ -18,7 +18,7 @@
|
||||
* FYI, while pg_class.oid and pg_class.relfilenode are intially the same
|
||||
* in a cluster, but they can diverge due to CLUSTER, REINDEX, or VACUUM
|
||||
* FULL. The new cluster will have matching pg_class.oid and
|
||||
* pg_class.relfilenode values and be based on the old oid value. This can
|
||||
* pg_class.relfilenode values and be based on the old oid value. This can
|
||||
* cause the old and new pg_class.relfilenode values to differ. In summary,
|
||||
* old and new pg_class.oid and new pg_class.relfilenode will have the
|
||||
* same value, and old pg_class.relfilenode might differ.
|
||||
|
@ -79,7 +79,7 @@ transfer_all_new_dbs(DbInfoArr *old_db_arr,
|
||||
/*
|
||||
* get_pg_database_relfilenode()
|
||||
*
|
||||
* Retrieves the relfilenode for a few system-catalog tables. We need these
|
||||
* Retrieves the relfilenode for a few system-catalog tables. We need these
|
||||
* relfilenodes later in the upgrade process.
|
||||
*/
|
||||
void
|
||||
|
@ -266,7 +266,7 @@ pg_putenv(const char *var, const char *val)
|
||||
|
||||
/*
|
||||
* Do not free envstr because it becomes part of the environment on
|
||||
* some operating systems. See port/unsetenv.c::unsetenv.
|
||||
* some operating systems. See port/unsetenv.c::unsetenv.
|
||||
*/
|
||||
#else
|
||||
SetEnvironmentVariableA(var, val);
|
||||
|
@ -29,7 +29,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -9,7 +9,7 @@
|
||||
* entirely in crypt_blowfish.c.
|
||||
*
|
||||
* Put bcrypt generator also here as crypt-blowfish.c
|
||||
* may not be compiled always. -- marko
|
||||
* may not be compiled always. -- marko
|
||||
*/
|
||||
|
||||
#include "postgres.h"
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
@ -53,7 +53,7 @@
|
||||
|
||||
/*
|
||||
* There is some confusion about whether and how to carry forward
|
||||
* the state of the pools. Seems like original Fortuna does not
|
||||
* the state of the pools. Seems like original Fortuna does not
|
||||
* do it, resetting hash after each request. I guess expecting
|
||||
* feeding to happen more often that requesting. This is absolutely
|
||||
* unsuitable for pgcrypto, as nothing asynchronous happens here.
|
||||
@ -77,7 +77,7 @@
|
||||
* How many pools.
|
||||
*
|
||||
* Original Fortuna uses 32 pools, that means 32'th pool is
|
||||
* used not earlier than in 13th year. This is a waste in
|
||||
* used not earlier than in 13th year. This is a waste in
|
||||
* pgcrypto, as we have very low-frequancy seeding. Here
|
||||
* is preferable to have all entropy usable in reasonable time.
|
||||
*
|
||||
@ -296,7 +296,7 @@ reseed(FState *st)
|
||||
}
|
||||
|
||||
/*
|
||||
* Pick a random pool. This uses key bytes as random source.
|
||||
* Pick a random pool. This uses key bytes as random source.
|
||||
*/
|
||||
static unsigned
|
||||
get_rand_pool(FState *st)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -21,7 +21,7 @@
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
@ -211,7 +211,7 @@ static int s_vcmp(mp_int a, int v);
|
||||
static mp_digit s_uadd(mp_digit *da, mp_digit *db, mp_digit *dc,
|
||||
mp_size size_a, mp_size size_b);
|
||||
|
||||
/* Unsigned magnitude subtraction. Assumes dc is big enough. */
|
||||
/* 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);
|
||||
|
||||
@ -2275,7 +2275,7 @@ mp_error_string(mp_result res)
|
||||
/* }}} */
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
/* Private functions for internal use. These make assumptions. */
|
||||
/* Private functions for internal use. These make assumptions. */
|
||||
|
||||
/* {{{ s_alloc(num) */
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -19,7 +19,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -20,7 +20,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
@ -90,7 +90,7 @@ pgp_cfb_free(PGP_CFB *ctx)
|
||||
}
|
||||
|
||||
/*
|
||||
* Data processing for normal CFB. (PGP_PKT_SYMENCRYPTED_DATA_MDC)
|
||||
* Data processing for normal CFB. (PGP_PKT_SYMENCRYPTED_DATA_MDC)
|
||||
*/
|
||||
static int
|
||||
mix_encrypt_normal(PGP_CFB *ctx, const uint8 *data, int len, uint8 *dst)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
@ -147,7 +147,7 @@ bn_to_mpi(mpz_t *bn)
|
||||
*
|
||||
* Until I research it further, I just mimic gpg behaviour.
|
||||
* It has a special mapping table, for values <= 5120,
|
||||
* above that it uses 'arbitrary high number'. Following
|
||||
* above that it uses 'arbitrary high number'. Following
|
||||
* algorihm hovers 10-70 bits above gpg values. And for
|
||||
* larger p, it uses gpg's algorihm.
|
||||
*
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
@ -82,7 +82,7 @@ bn_to_mpi(BIGNUM *bn)
|
||||
*
|
||||
* Until I research it further, I just mimic gpg behaviour.
|
||||
* It has a special mapping table, for values <= 5120,
|
||||
* above that it uses 'arbitrary high number'. Following
|
||||
* above that it uses 'arbitrary high number'. Following
|
||||
* algorihm hovers 10-70 bits above gpg values. And for
|
||||
* larger p, it uses gpg's algorihm.
|
||||
*
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
@ -93,7 +93,7 @@ add_block_entropy(PX_MD *md, text *data)
|
||||
}
|
||||
|
||||
/*
|
||||
* Mix user data into RNG. It is for user own interests to have
|
||||
* Mix user data into RNG. It is for user own interests to have
|
||||
* RNG state shuffled.
|
||||
*/
|
||||
static void
|
||||
@ -310,7 +310,7 @@ set_arg(PGP_Context *ctx, char *key, char *val,
|
||||
}
|
||||
|
||||
/*
|
||||
* Find next word. Handle ',' and '=' as words. Skip whitespace.
|
||||
* Find next word. Handle ',' and '=' as words. Skip whitespace.
|
||||
* Put word info into res_p, res_len.
|
||||
* Returns ptr to next word.
|
||||
*/
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -7,12 +7,12 @@
|
||||
/* RIJNDAEL by Joan Daemen and Vincent Rijmen */
|
||||
/* */
|
||||
/* which is a candidate algorithm in the Advanced Encryption Standard */
|
||||
/* programme of the US National Institute of Standards and Technology. */
|
||||
/* programme of the US National Institute of Standards and Technology. */
|
||||
/* */
|
||||
/* Copyright in this implementation is held by Dr B R Gladman but I */
|
||||
/* hereby give permission for its free direct or derivative use subject */
|
||||
/* to acknowledgment of its origin and compliance with any conditions */
|
||||
/* that the originators of the algorithm place on its exploitation. */
|
||||
/* that the originators of the algorithm place on its exploitation. */
|
||||
/* */
|
||||
/* Dr Brian Gladman (gladman@seven77.demon.co.uk) 14th January 1999 */
|
||||
|
||||
@ -188,7 +188,7 @@ gen_tabs(void)
|
||||
/* rijndael specification is in big endian format with */
|
||||
/* bit 0 as the most significant bit. In the remainder */
|
||||
/* of the specification the bits are numbered from the */
|
||||
/* least significant end of a byte. */
|
||||
/* least significant end of a byte. */
|
||||
|
||||
for (i = 0; i < 256; ++i)
|
||||
{
|
||||
|
@ -8,12 +8,12 @@
|
||||
/* RIJNDAEL by Joan Daemen and Vincent Rijmen */
|
||||
/* */
|
||||
/* which is a candidate algorithm in the Advanced Encryption Standard */
|
||||
/* programme of the US National Institute of Standards and Technology. */
|
||||
/* programme of the US National Institute of Standards and Technology. */
|
||||
/* */
|
||||
/* Copyright in this implementation is held by Dr B R Gladman but I */
|
||||
/* hereby give permission for its free direct or derivative use subject */
|
||||
/* to acknowledgment of its origin and compliance with any conditions */
|
||||
/* that the originators of the algorithm place on its exploitation. */
|
||||
/* that the originators of the algorithm place on its exploitation. */
|
||||
/* */
|
||||
/* Dr Brian Gladman (gladman@seven77.demon.co.uk) 14th January 1999 */
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -20,7 +20,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -22,7 +22,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -23,7 +23,7 @@
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
|
@ -299,7 +299,7 @@ pgstat_heap(Relation rel, FunctionCallInfo fcinfo)
|
||||
|
||||
/*
|
||||
* To avoid physically reading the table twice, try to do the
|
||||
* free-space scan in parallel with the heap scan. However,
|
||||
* free-space scan in parallel with the heap scan. However,
|
||||
* heap_getnext may find no tuples on a given page, so we cannot
|
||||
* simply examine the pages returned by the heap scan.
|
||||
*/
|
||||
|
@ -47,17 +47,17 @@ static EPlan *find_plan(char *ident, EPlan **eplan, int *nplans);
|
||||
|
||||
/*
|
||||
* timetravel () --
|
||||
* 1. IF an update affects tuple with stop_date eq INFINITY
|
||||
* 1. IF an update affects tuple with stop_date eq INFINITY
|
||||
* then form (and return) new tuple with start_date eq current date
|
||||
* and stop_date eq INFINITY [ and update_user eq current user ]
|
||||
* and all other column values as in new tuple, and insert tuple
|
||||
* with old data and stop_date eq current date
|
||||
* ELSE - skip updation of tuple.
|
||||
* 2. IF an delete affects tuple with stop_date eq INFINITY
|
||||
* 2. IF an delete affects tuple with stop_date eq INFINITY
|
||||
* then insert the same tuple with stop_date eq current date
|
||||
* [ and delete_user eq current user ]
|
||||
* ELSE - skip deletion of tuple.
|
||||
* 3. On INSERT, if start_date is NULL then current date will be
|
||||
* 3. On INSERT, if start_date is NULL then current date will be
|
||||
* inserted, if stop_date is NULL then INFINITY will be inserted.
|
||||
* [ and insert_user eq current user, update_user and delete_user
|
||||
* eq NULL ]
|
||||
|
@ -132,7 +132,7 @@ ssl_client_serial(PG_FUNCTION_ARGS)
|
||||
* current database encoding if possible. Any invalid characters are
|
||||
* replaced by question marks.
|
||||
*
|
||||
* Parameter: str - OpenSSL ASN1_STRING structure. Memory managment
|
||||
* Parameter: str - OpenSSL ASN1_STRING structure. Memory managment
|
||||
* of this structure is responsibility of caller.
|
||||
*
|
||||
* Returns Datum, which can be directly returned from a C language SQL
|
||||
|
@ -21,7 +21,7 @@
|
||||
* tuptoaster.c.
|
||||
*
|
||||
* This change will break any code that assumes it needn't detoast values
|
||||
* that have been put into a tuple but never sent to disk. Hopefully there
|
||||
* that have been put into a tuple but never sent to disk. Hopefully there
|
||||
* are few such places.
|
||||
*
|
||||
* Varlenas still have alignment 'i' (or 'd') in pg_type/pg_attribute, since
|
||||
@ -388,7 +388,7 @@ nocachegetattr(HeapTuple tuple,
|
||||
|
||||
/*
|
||||
* Otherwise, check for non-fixed-length attrs up to and including
|
||||
* target. If there aren't any, it's safe to cheaply initialize the
|
||||
* target. If there aren't any, it's safe to cheaply initialize the
|
||||
* cached offsets for these attrs.
|
||||
*/
|
||||
if (HeapTupleHasVarWidth(tuple))
|
||||
@ -455,7 +455,7 @@ nocachegetattr(HeapTuple tuple,
|
||||
*
|
||||
* Note - This loop is a little tricky. For each non-null attribute,
|
||||
* we have to first account for alignment padding before the attr,
|
||||
* then advance over the attr based on its length. Nulls have no
|
||||
* then advance over the attr based on its length. Nulls have no
|
||||
* storage and no alignment padding either. We can use/set
|
||||
* attcacheoff until we reach either a null or a var-width attribute.
|
||||
*/
|
||||
@ -550,7 +550,7 @@ heap_getsysattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
|
||||
|
||||
/*
|
||||
* cmin and cmax are now both aliases for the same field, which
|
||||
* can in fact also be a combo command id. XXX perhaps we should
|
||||
* can in fact also be a combo command id. XXX perhaps we should
|
||||
* return the "real" cmin or cmax if possible, that is if we are
|
||||
* inside the originating transaction?
|
||||
*/
|
||||
@ -710,7 +710,7 @@ heap_form_tuple(TupleDesc tupleDescriptor,
|
||||
len += data_len;
|
||||
|
||||
/*
|
||||
* Allocate and zero the space needed. Note that the tuple body and
|
||||
* Allocate and zero the space needed. Note that the tuple body and
|
||||
* HeapTupleData management structure are allocated in one chunk.
|
||||
*/
|
||||
tuple = (HeapTuple) palloc0(HEAPTUPLESIZE + len);
|
||||
|
@ -71,7 +71,7 @@ index_form_tuple(TupleDesc tupleDescriptor,
|
||||
|
||||
/*
|
||||
* If value is stored EXTERNAL, must fetch it so we are not depending
|
||||
* on outside storage. This should be improved someday.
|
||||
* on outside storage. This should be improved someday.
|
||||
*/
|
||||
if (VARATT_IS_EXTERNAL(DatumGetPointer(values[i])))
|
||||
{
|
||||
@ -281,7 +281,7 @@ nocache_index_getattr(IndexTuple tup,
|
||||
|
||||
/*
|
||||
* Otherwise, check for non-fixed-length attrs up to and including
|
||||
* target. If there aren't any, it's safe to cheaply initialize the
|
||||
* target. If there aren't any, it's safe to cheaply initialize the
|
||||
* cached offsets for these attrs.
|
||||
*/
|
||||
if (IndexTupleHasVarwidths(tup))
|
||||
@ -348,7 +348,7 @@ nocache_index_getattr(IndexTuple tup,
|
||||
*
|
||||
* Note - This loop is a little tricky. For each non-null attribute,
|
||||
* we have to first account for alignment padding before the attr,
|
||||
* then advance over the attr based on its length. Nulls have no
|
||||
* then advance over the attr based on its length. Nulls have no
|
||||
* storage and no alignment padding either. We can use/set
|
||||
* attcacheoff until we reach either a null or a var-width attribute.
|
||||
*/
|
||||
|
@ -166,7 +166,7 @@ printtup_startup(DestReceiver *self, int operation, TupleDesc typeinfo)
|
||||
* or some similar function; it does not contain a full set of fields.
|
||||
* The targetlist will be NIL when executing a utility function that does
|
||||
* not have a plan. If the targetlist isn't NIL then it is a Query node's
|
||||
* targetlist; it is up to us to ignore resjunk columns in it. The formats[]
|
||||
* targetlist; it is up to us to ignore resjunk columns in it. The formats[]
|
||||
* array pointer might be NULL (if we are doing Describe on a prepared stmt);
|
||||
* send zeroes for the format codes in that case.
|
||||
*/
|
||||
|
@ -466,7 +466,7 @@ add_real_reloption(bits32 kinds, char *name, char *desc, double default_val,
|
||||
* Add a new string reloption
|
||||
*
|
||||
* "validator" is an optional function pointer that can be used to test the
|
||||
* validity of the values. It must elog(ERROR) when the argument string is
|
||||
* validity of the values. It must elog(ERROR) when the argument string is
|
||||
* not acceptable for the variable. Note that the default value must pass
|
||||
* the validation.
|
||||
*/
|
||||
@ -533,7 +533,7 @@ add_string_reloption(bits32 kinds, char *name, char *desc, char *default_val,
|
||||
* Note that this is not responsible for determining whether the options
|
||||
* are valid, but it does check that namespaces for all the options given are
|
||||
* listed in validnsps. The NULL namespace is always valid and needs not be
|
||||
* explicitely listed. Passing a NULL pointer means that only the NULL
|
||||
* explicitely listed. Passing a NULL pointer means that only the NULL
|
||||
* namespace is valid.
|
||||
*
|
||||
* Both oldOptions and the result are text arrays (or NULL for "default"),
|
||||
@ -809,7 +809,7 @@ extractRelOptions(HeapTuple tuple, TupleDesc tupdesc, Oid amoptions)
|
||||
* is returned.
|
||||
*
|
||||
* Note: values of type int, bool and real are allocated as part of the
|
||||
* returned array. Values of type string are allocated separately and must
|
||||
* returned array. Values of type string are allocated separately and must
|
||||
* be freed by the caller.
|
||||
*/
|
||||
relopt_value *
|
||||
|
@ -5,7 +5,7 @@
|
||||
*
|
||||
* These functions provide conversion between rowtypes that are logically
|
||||
* equivalent but might have columns in a different order or different sets
|
||||
* of dropped columns. There is some overlap of functionality with the
|
||||
* of dropped columns. There is some overlap of functionality with the
|
||||
* executor's "junkfilter" routines, but these functions work on bare
|
||||
* HeapTuples rather than TupleTableSlots.
|
||||
*
|
||||
|
@ -533,7 +533,7 @@ TupleDescInitEntryCollation(TupleDesc desc,
|
||||
* Given a relation schema (list of ColumnDef nodes), build a TupleDesc.
|
||||
*
|
||||
* Note: the default assumption is no OIDs; caller may modify the returned
|
||||
* TupleDesc if it wants OIDs. Also, tdtypeid will need to be filled in
|
||||
* TupleDesc if it wants OIDs. Also, tdtypeid will need to be filled in
|
||||
* later on.
|
||||
*/
|
||||
TupleDesc
|
||||
|
@ -197,7 +197,7 @@ ginarrayconsistent(PG_FUNCTION_ARGS)
|
||||
|
||||
/*
|
||||
* Must have all elements in check[] true; no discrimination
|
||||
* against nulls here. This is because array_contain_compare and
|
||||
* against nulls here. This is because array_contain_compare and
|
||||
* array_eq handle nulls differently ...
|
||||
*/
|
||||
res = true;
|
||||
|
@ -187,7 +187,7 @@ ginInsertBAEntry(BuildAccumulator *accum,
|
||||
* Since the entries are being inserted into a balanced binary tree, you
|
||||
* might think that the order of insertion wouldn't be critical, but it turns
|
||||
* out that inserting the entries in sorted order results in a lot of
|
||||
* rebalancing operations and is slow. To prevent this, we attempt to insert
|
||||
* rebalancing operations and is slow. To prevent this, we attempt to insert
|
||||
* the nodes in an order that will produce a nearly-balanced tree if the input
|
||||
* is in fact sorted.
|
||||
*
|
||||
|
@ -164,7 +164,7 @@ GinShortenTuple(IndexTuple itup, uint32 nipd)
|
||||
* Form a non-leaf entry tuple by copying the key data from the given tuple,
|
||||
* which can be either a leaf or non-leaf entry tuple.
|
||||
*
|
||||
* Any posting list in the source tuple is not copied. The specified child
|
||||
* Any posting list in the source tuple is not copied. The specified child
|
||||
* block number is inserted into t_tid.
|
||||
*/
|
||||
static IndexTuple
|
||||
|
@ -444,7 +444,7 @@ ginHeapTupleFastInsert(GinState *ginstate, GinTupleCollector *collector)
|
||||
* Create temporary index tuples for a single indexable item (one index column
|
||||
* for the heap tuple specified by ht_ctid), and append them to the array
|
||||
* in *collector. They will subsequently be written out using
|
||||
* ginHeapTupleFastInsert. Note that to guarantee consistent state, all
|
||||
* ginHeapTupleFastInsert. Note that to guarantee consistent state, all
|
||||
* temp tuples for a given heap tuple must be written in one call to
|
||||
* ginHeapTupleFastInsert.
|
||||
*/
|
||||
@ -713,7 +713,7 @@ processPendingPage(BuildAccumulator *accum, KeyArray *ka,
|
||||
*
|
||||
* This can be called concurrently by multiple backends, so it must cope.
|
||||
* On first glance it looks completely not concurrent-safe and not crash-safe
|
||||
* either. The reason it's okay is that multiple insertion of the same entry
|
||||
* either. The reason it's okay is that multiple insertion of the same entry
|
||||
* is detected and treated as a no-op by gininsert.c. If we crash after
|
||||
* posting entries to the main index and before removing them from the
|
||||
* pending list, it's okay because when we redo the posting later on, nothing
|
||||
@ -767,7 +767,7 @@ ginInsertCleanup(GinState *ginstate,
|
||||
LockBuffer(metabuffer, GIN_UNLOCK);
|
||||
|
||||
/*
|
||||
* Initialize. All temporary space will be in opCtx
|
||||
* Initialize. All temporary space will be in opCtx
|
||||
*/
|
||||
opCtx = AllocSetContextCreate(CurrentMemoryContext,
|
||||
"GIN insert cleanup temporary context",
|
||||
@ -861,7 +861,7 @@ ginInsertCleanup(GinState *ginstate,
|
||||
|
||||
/*
|
||||
* While we left the page unlocked, more stuff might have gotten
|
||||
* added to it. If so, process those entries immediately. There
|
||||
* added to it. If so, process those entries immediately. There
|
||||
* shouldn't be very many, so we don't worry about the fact that
|
||||
* we're doing this with exclusive lock. Insertion algorithm
|
||||
* gurantees that inserted row(s) will not continue on next page.
|
||||
|
@ -166,7 +166,7 @@ scanPostingTree(Relation index, GinScanEntry scanEntry,
|
||||
|
||||
/*
|
||||
* Collects TIDs into scanEntry->matchBitmap for all heap tuples that
|
||||
* match the search entry. This supports three different match modes:
|
||||
* match the search entry. This supports three different match modes:
|
||||
*
|
||||
* 1. Partial-match support: scan from current point until the
|
||||
* comparePartialFn says we're done.
|
||||
@ -262,7 +262,7 @@ collectMatchBitmap(GinBtreeData *btree, GinBtreeStack *stack,
|
||||
/*
|
||||
* In ALL mode, we are not interested in null items, so we can
|
||||
* stop if we get to a null-item placeholder (which will be the
|
||||
* last entry for a given attnum). We do want to include NULL_KEY
|
||||
* last entry for a given attnum). We do want to include NULL_KEY
|
||||
* and EMPTY_ITEM entries, though.
|
||||
*/
|
||||
if (icategory == GIN_CAT_NULL_ITEM)
|
||||
@ -960,14 +960,14 @@ scanGetItem(IndexScanDesc scan, ItemPointer advancePast,
|
||||
* that exact TID, or a lossy reference to the same page.
|
||||
*
|
||||
* This logic works only if a keyGetItem stream can never contain both
|
||||
* exact and lossy pointers for the same page. Else we could have a
|
||||
* exact and lossy pointers for the same page. Else we could have a
|
||||
* case like
|
||||
*
|
||||
* stream 1 stream 2
|
||||
* ... ...
|
||||
* ... ...
|
||||
* 42/6 42/7
|
||||
* 50/1 42/0xffff
|
||||
* ... ...
|
||||
* ... ...
|
||||
*
|
||||
* We would conclude that 42/6 is not a match and advance stream 1,
|
||||
* thus never detecting the match to the lossy pointer in stream 2.
|
||||
@ -996,7 +996,7 @@ scanGetItem(IndexScanDesc scan, ItemPointer advancePast,
|
||||
break;
|
||||
|
||||
/*
|
||||
* No hit. Update myAdvancePast to this TID, so that on the next pass
|
||||
* No hit. Update myAdvancePast to this TID, so that on the next pass
|
||||
* we'll move to the next possible entry.
|
||||
*/
|
||||
myAdvancePast = *item;
|
||||
@ -1512,10 +1512,10 @@ gingetbitmap(PG_FUNCTION_ARGS)
|
||||
|
||||
/*
|
||||
* First, scan the pending list and collect any matching entries into the
|
||||
* bitmap. After we scan a pending item, some other backend could post it
|
||||
* bitmap. After we scan a pending item, some other backend could post it
|
||||
* into the main index, and so we might visit it a second time during the
|
||||
* main scan. This is okay because we'll just re-set the same bit in the
|
||||
* bitmap. (The possibility of duplicate visits is a major reason why GIN
|
||||
* bitmap. (The possibility of duplicate visits is a major reason why GIN
|
||||
* can't support the amgettuple API, however.) Note that it would not do
|
||||
* to scan the main index before the pending list, since concurrent
|
||||
* cleanup could then make us miss entries entirely.
|
||||
|
@ -97,7 +97,7 @@ createPostingTree(Relation index, ItemPointerData *items, uint32 nitems)
|
||||
* Adds array of item pointers to tuple's posting list, or
|
||||
* creates posting tree and tuple pointing to tree in case
|
||||
* of not enough space. Max size of tuple is defined in
|
||||
* GinFormTuple(). Returns a new, modified index tuple.
|
||||
* GinFormTuple(). Returns a new, modified index tuple.
|
||||
* items[] must be in sorted order with no duplicates.
|
||||
*/
|
||||
static IndexTuple
|
||||
|
@ -388,7 +388,7 @@ ginNewScanKey(IndexScanDesc scan)
|
||||
/*
|
||||
* If the index is version 0, it may be missing null and placeholder
|
||||
* entries, which would render searches for nulls and full-index scans
|
||||
* unreliable. Throw an error if so.
|
||||
* unreliable. Throw an error if so.
|
||||
*/
|
||||
if (hasNullQuery && !so->isVoidRes)
|
||||
{
|
||||
|
@ -438,7 +438,7 @@ ginExtractEntries(GinState *ginstate, OffsetNumber attnum,
|
||||
* If there's more than one key, sort and unique-ify.
|
||||
*
|
||||
* XXX Using qsort here is notationally painful, and the overhead is
|
||||
* pretty bad too. For small numbers of keys it'd likely be better to use
|
||||
* pretty bad too. For small numbers of keys it'd likely be better to use
|
||||
* a simple insertion sort.
|
||||
*/
|
||||
if (*nentries > 1)
|
||||
|
@ -692,7 +692,7 @@ ginRedoDeleteListPages(XLogRecPtr lsn, XLogRecord *record)
|
||||
|
||||
/*
|
||||
* In normal operation, shiftList() takes exclusive lock on all the
|
||||
* pages-to-be-deleted simultaneously. During replay, however, it should
|
||||
* pages-to-be-deleted simultaneously. During replay, however, it should
|
||||
* be all right to lock them one at a time. This is dependent on the fact
|
||||
* that we are deleting pages from the head of the list, and that readers
|
||||
* share-lock the next page before releasing the one they are on. So we
|
||||
|
@ -216,7 +216,7 @@ gistbuildCallback(Relation index,
|
||||
/*
|
||||
* Since we already have the index relation locked, we call gistdoinsert
|
||||
* directly. Normal access method calls dispatch through gistinsert,
|
||||
* which locks the relation for write. This is the right thing to do if
|
||||
* which locks the relation for write. This is the right thing to do if
|
||||
* you're inserting single tups, but not when you're initializing the
|
||||
* whole index at once.
|
||||
*
|
||||
@ -1495,7 +1495,7 @@ initGISTstate(GISTSTATE *giststate, Relation index)
|
||||
/*
|
||||
* If the index column has a specified collation, we should honor that
|
||||
* while doing comparisons. However, we may have a collatable storage
|
||||
* type for a noncollatable indexed data type. If there's no index
|
||||
* type for a noncollatable indexed data type. If there's no index
|
||||
* collation then specify default collation in case the support
|
||||
* functions need collation. This is harmless if the support
|
||||
* functions don't care about collation, so we just do it
|
||||
|
@ -32,7 +32,7 @@
|
||||
*
|
||||
* On success return for a heap tuple, *recheck_p is set to indicate
|
||||
* whether recheck is needed. We recheck if any of the consistent() functions
|
||||
* request it. recheck is not interesting when examining a non-leaf entry,
|
||||
* request it. recheck is not interesting when examining a non-leaf entry,
|
||||
* since we must visit the lower index page if there's any doubt.
|
||||
*
|
||||
* If we are doing an ordered scan, so->distances[] is filled with distance
|
||||
@ -63,7 +63,7 @@ gistindex_keytest(IndexScanDesc scan,
|
||||
|
||||
/*
|
||||
* If it's a leftover invalid tuple from pre-9.1, treat it as a match with
|
||||
* minimum possible distances. This means we'll always follow it to the
|
||||
* minimum possible distances. This means we'll always follow it to the
|
||||
* referenced page.
|
||||
*/
|
||||
if (GistTupleIsInvalid(tuple))
|
||||
@ -225,7 +225,7 @@ gistindex_keytest(IndexScanDesc scan,
|
||||
* ntids: if not NULL, gistgetbitmap's output tuple counter
|
||||
*
|
||||
* If tbm/ntids aren't NULL, we are doing an amgetbitmap scan, and heap
|
||||
* tuples should be reported directly into the bitmap. If they are NULL,
|
||||
* tuples should be reported directly into the bitmap. If they are NULL,
|
||||
* we're doing a plain or ordered indexscan. For a plain indexscan, heap
|
||||
* tuple TIDs are returned into so->pageData[]. For an ordered indexscan,
|
||||
* heap tuple TIDs are pushed into individual search queue items.
|
||||
|
@ -58,7 +58,7 @@ GISTSearchTreeItemCombiner(RBNode *existing, const RBNode *newrb, void *arg)
|
||||
/*
|
||||
* If new item is heap tuple, it goes to front of chain; otherwise insert
|
||||
* it before the first index-page item, so that index pages are visited in
|
||||
* LIFO order, ensuring depth-first search of index pages. See comments
|
||||
* LIFO order, ensuring depth-first search of index pages. See comments
|
||||
* in gist_private.h.
|
||||
*/
|
||||
if (GISTSearchItemIsHeap(*newitem))
|
||||
|
@ -71,7 +71,7 @@ gistunionsubkeyvec(GISTSTATE *giststate, IndexTuple *itvec,
|
||||
* Recompute unions of left- and right-side subkeys after a page split,
|
||||
* ignoring any tuples that are marked in spl->spl_dontcare[].
|
||||
*
|
||||
* Note: we always recompute union keys for all index columns. In some cases
|
||||
* Note: we always recompute union keys for all index columns. In some cases
|
||||
* this might represent duplicate work for the leftmost column(s), but it's
|
||||
* not safe to assume that "zero penalty to move a tuple" means "the union
|
||||
* key doesn't change at all". Penalty functions aren't 100% accurate.
|
||||
@ -160,7 +160,7 @@ findDontCares(Relation r, GISTSTATE *giststate, GISTENTRY *valvec,
|
||||
|
||||
/*
|
||||
* Remove tuples that are marked don't-cares from the tuple index array a[]
|
||||
* of length *len. This is applied separately to the spl_left and spl_right
|
||||
* of length *len. This is applied separately to the spl_left and spl_right
|
||||
* arrays.
|
||||
*/
|
||||
static void
|
||||
@ -193,7 +193,7 @@ removeDontCares(OffsetNumber *a, int *len, const bool *dontcare)
|
||||
/*
|
||||
* Place a single don't-care tuple into either the left or right side of the
|
||||
* split, according to which has least penalty for merging the tuple into
|
||||
* the previously-computed union keys. We need consider only columns starting
|
||||
* the previously-computed union keys. We need consider only columns starting
|
||||
* at attno.
|
||||
*/
|
||||
static void
|
||||
@ -291,7 +291,7 @@ supportSecondarySplit(Relation r, GISTSTATE *giststate, int attno,
|
||||
|
||||
/*
|
||||
* There is only one previously defined union, so we just choose swap
|
||||
* or not by lowest penalty for that side. We can only get here if a
|
||||
* or not by lowest penalty for that side. We can only get here if a
|
||||
* secondary split happened to have all NULLs in its column in the
|
||||
* tuples that the outer recursion level had assigned to one side.
|
||||
* (Note that the null checks in gistSplitByKey don't prevent the
|
||||
@ -427,7 +427,7 @@ gistUserPicksplit(Relation r, GistEntryVector *entryvec, int attno, GistSplitVec
|
||||
sv->spl_rdatum = v->spl_rattr[attno];
|
||||
|
||||
/*
|
||||
* Let the opclass-specific PickSplit method do its thing. Note that at
|
||||
* Let the opclass-specific PickSplit method do its thing. Note that at
|
||||
* this point we know there are no null keys in the entryvec.
|
||||
*/
|
||||
FunctionCall2Coll(&giststate->picksplitFn[attno],
|
||||
|
@ -432,7 +432,7 @@ gistchoose(Relation r, Page p, IndexTuple it, /* it has compressed entry */
|
||||
{
|
||||
/*
|
||||
* New best penalty for column. Tentatively select this tuple
|
||||
* as the target, and record the best penalty. Then reset the
|
||||
* as the target, and record the best penalty. Then reset the
|
||||
* next column's penalty to "unknown" (and indirectly, the
|
||||
* same for all the ones to its right). This will force us to
|
||||
* adopt this tuple's penalty values as the best for all the
|
||||
@ -448,7 +448,7 @@ gistchoose(Relation r, Page p, IndexTuple it, /* it has compressed entry */
|
||||
{
|
||||
/*
|
||||
* The current tuple is exactly as good for this column as the
|
||||
* best tuple seen so far. The next iteration of this loop
|
||||
* best tuple seen so far. The next iteration of this loop
|
||||
* will compare the next column.
|
||||
*/
|
||||
}
|
||||
@ -623,7 +623,7 @@ gistcheckpage(Relation rel, Buffer buf)
|
||||
/*
|
||||
* ReadBuffer verifies that every newly-read page passes
|
||||
* PageHeaderIsValid, which means it either contains a reasonably sane
|
||||
* page header or is all-zero. We have to defend against the all-zero
|
||||
* page header or is all-zero. We have to defend against the all-zero
|
||||
* case, however.
|
||||
*/
|
||||
if (PageIsNew(page))
|
||||
|
@ -53,7 +53,7 @@ gistvacuumcleanup(PG_FUNCTION_ARGS)
|
||||
stats->estimated_count = info->estimated_count;
|
||||
|
||||
/*
|
||||
* XXX the above is wrong if index is partial. Would it be OK to just
|
||||
* XXX the above is wrong if index is partial. Would it be OK to just
|
||||
* return NULL, or is there work we must do below?
|
||||
*/
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ hashbuild(PG_FUNCTION_ARGS)
|
||||
* (assuming their hash codes are pretty random) there will be no locality
|
||||
* of access to the index, and if the index is bigger than available RAM
|
||||
* then we'll thrash horribly. To prevent that scenario, we can sort the
|
||||
* tuples by (expected) bucket number. However, such a sort is useless
|
||||
* tuples by (expected) bucket number. However, such a sort is useless
|
||||
* overhead when the index does fit in RAM. We choose to sort if the
|
||||
* initial index size exceeds NBuffers.
|
||||
*
|
||||
@ -246,7 +246,7 @@ hashgettuple(PG_FUNCTION_ARGS)
|
||||
/*
|
||||
* An insertion into the current index page could have happened while
|
||||
* we didn't have read lock on it. Re-find our position by looking
|
||||
* for the TID we previously returned. (Because we hold share lock on
|
||||
* for the TID we previously returned. (Because we hold share lock on
|
||||
* the bucket, no deletions or splits could have occurred; therefore
|
||||
* we can expect that the TID still exists in the current index page,
|
||||
* at an offset >= where we were.)
|
||||
@ -524,7 +524,7 @@ hashbulkdelete(PG_FUNCTION_ARGS)
|
||||
/*
|
||||
* Read the metapage to fetch original bucket and tuple counts. Also, we
|
||||
* keep a copy of the last-seen metapage so that we can use its
|
||||
* hashm_spares[] values to compute bucket page addresses. This is a bit
|
||||
* hashm_spares[] values to compute bucket page addresses. This is a bit
|
||||
* hokey but perfectly safe, since the interesting entries in the spares
|
||||
* array cannot change under us; and it beats rereading the metapage for
|
||||
* each bucket.
|
||||
@ -655,7 +655,7 @@ loop_top:
|
||||
{
|
||||
/*
|
||||
* Otherwise, our count is untrustworthy since we may have
|
||||
* double-scanned tuples in split buckets. Proceed by dead-reckoning.
|
||||
* double-scanned tuples in split buckets. Proceed by dead-reckoning.
|
||||
* (Note: we still return estimated_count = false, because using this
|
||||
* count is better than not updating reltuples at all.)
|
||||
*/
|
||||
|
@ -11,7 +11,7 @@
|
||||
* src/backend/access/hash/hashfunc.c
|
||||
*
|
||||
* NOTES
|
||||
* These functions are stored in pg_amproc. For each operator class
|
||||
* These functions are stored in pg_amproc. For each operator class
|
||||
* defined for hash indexes, they compute the hash value of the argument.
|
||||
*
|
||||
* Additional hash functions appear in /utils/adt/ files for various
|
||||
@ -158,7 +158,7 @@ hashtext(PG_FUNCTION_ARGS)
|
||||
/*
|
||||
* Note: this is currently identical in behavior to hashvarlena, but keep
|
||||
* it as a separate function in case we someday want to do something
|
||||
* different in non-C locales. (See also hashbpchar, if so.)
|
||||
* different in non-C locales. (See also hashbpchar, if so.)
|
||||
*/
|
||||
result = hash_any((unsigned char *) VARDATA_ANY(key),
|
||||
VARSIZE_ANY_EXHDR(key));
|
||||
@ -236,7 +236,7 @@ hashvarlena(PG_FUNCTION_ARGS)
|
||||
*
|
||||
* This allows some parallelism. Read-after-writes are good at doubling
|
||||
* the number of bits affected, so the goal of mixing pulls in the opposite
|
||||
* direction from the goal of parallelism. I did what I could. Rotates
|
||||
* direction from the goal of parallelism. I did what I could. Rotates
|
||||
* seem to cost as much as shifts on every machine I could lay my hands on,
|
||||
* and rotates are much kinder to the top and bottom bits, so I used rotates.
|
||||
*----------
|
||||
@ -270,7 +270,7 @@ hashvarlena(PG_FUNCTION_ARGS)
|
||||
* substantial performance increase since final() does not need to
|
||||
* do well in reverse, but is does need to affect all output bits.
|
||||
* mix(), on the other hand, does not need to affect all output
|
||||
* bits (affecting 32 bits is enough). The original hash function had
|
||||
* bits (affecting 32 bits is enough). The original hash function had
|
||||
* a single mixing operation that had to satisfy both sets of requirements
|
||||
* and was slower as a result.
|
||||
*----------
|
||||
@ -291,7 +291,7 @@ hashvarlena(PG_FUNCTION_ARGS)
|
||||
* k : the key (the unaligned variable-length array of bytes)
|
||||
* len : the length of the key, counting by bytes
|
||||
*
|
||||
* Returns a uint32 value. Every bit of the key affects every bit of
|
||||
* Returns a uint32 value. Every bit of the key affects every bit of
|
||||
* the return value. Every 1-bit and 2-bit delta achieves avalanche.
|
||||
* About 6*len+35 instructions. The best hash table sizes are powers
|
||||
* of 2. There is no need to do mod a prime (mod is sooo slow!).
|
||||
|
@ -81,7 +81,7 @@ blkno_to_bitno(HashMetaPage metap, BlockNumber ovflblkno)
|
||||
*
|
||||
* Add an overflow page to the bucket whose last page is pointed to by 'buf'.
|
||||
*
|
||||
* On entry, the caller must hold a pin but no lock on 'buf'. The pin is
|
||||
* On entry, the caller must hold a pin but no lock on 'buf'. The pin is
|
||||
* dropped before exiting (we assume the caller is not interested in 'buf'
|
||||
* anymore). The returned overflow page will be pinned and write-locked;
|
||||
* it is guaranteed to be empty.
|
||||
@ -90,12 +90,12 @@ blkno_to_bitno(HashMetaPage metap, BlockNumber ovflblkno)
|
||||
* That buffer is returned in the same state.
|
||||
*
|
||||
* The caller must hold at least share lock on the bucket, to ensure that
|
||||
* no one else tries to compact the bucket meanwhile. This guarantees that
|
||||
* no one else tries to compact the bucket meanwhile. This guarantees that
|
||||
* 'buf' won't stop being part of the bucket while it's unlocked.
|
||||
*
|
||||
* NB: since this could be executed concurrently by multiple processes,
|
||||
* one should not assume that the returned overflow page will be the
|
||||
* immediate successor of the originally passed 'buf'. Additional overflow
|
||||
* immediate successor of the originally passed 'buf'. Additional overflow
|
||||
* pages might have been added to the bucket chain in between.
|
||||
*/
|
||||
Buffer
|
||||
@ -158,7 +158,7 @@ _hash_addovflpage(Relation rel, Buffer metabuf, Buffer buf)
|
||||
/*
|
||||
* _hash_getovflpage()
|
||||
*
|
||||
* Find an available overflow page and return it. The returned buffer
|
||||
* Find an available overflow page and return it. The returned buffer
|
||||
* is pinned and write-locked, and has had _hash_pageinit() applied,
|
||||
* but it is caller's responsibility to fill the special space.
|
||||
*
|
||||
@ -254,7 +254,7 @@ _hash_getovflpage(Relation rel, Buffer metabuf)
|
||||
* We create the new bitmap page with all pages marked "in use".
|
||||
* Actually two pages in the new bitmap's range will exist
|
||||
* immediately: the bitmap page itself, and the following page which
|
||||
* is the one we return to the caller. Both of these are correctly
|
||||
* is the one we return to the caller. Both of these are correctly
|
||||
* marked "in use". Subsequent pages do not exist yet, but it is
|
||||
* convenient to pre-mark them as "in use" too.
|
||||
*/
|
||||
@ -285,7 +285,7 @@ _hash_getovflpage(Relation rel, Buffer metabuf)
|
||||
metap->hashm_spares[splitnum]++;
|
||||
|
||||
/*
|
||||
* Adjust hashm_firstfree to avoid redundant searches. But don't risk
|
||||
* Adjust hashm_firstfree to avoid redundant searches. But don't risk
|
||||
* changing it if someone moved it while we were searching bitmap pages.
|
||||
*/
|
||||
if (metap->hashm_firstfree == orig_firstfree)
|
||||
@ -314,7 +314,7 @@ found:
|
||||
blkno = bitno_to_blkno(metap, bit);
|
||||
|
||||
/*
|
||||
* Adjust hashm_firstfree to avoid redundant searches. But don't risk
|
||||
* Adjust hashm_firstfree to avoid redundant searches. But don't risk
|
||||
* changing it if someone moved it while we were searching bitmap pages.
|
||||
*/
|
||||
if (metap->hashm_firstfree == orig_firstfree)
|
||||
@ -495,7 +495,7 @@ _hash_freeovflpage(Relation rel, Buffer ovflbuf,
|
||||
/*
|
||||
* _hash_initbitmap()
|
||||
*
|
||||
* Initialize a new bitmap page. The metapage has a write-lock upon
|
||||
* Initialize a new bitmap page. The metapage has a write-lock upon
|
||||
* entering the function, and must be written by caller after return.
|
||||
*
|
||||
* 'blkno' is the block number of the new bitmap page.
|
||||
|
@ -52,7 +52,7 @@ static void _hash_splitbucket(Relation rel, Buffer metabuf,
|
||||
* of the locking rules). However, we can skip taking lmgr locks when the
|
||||
* index is local to the current backend (ie, either temp or new in the
|
||||
* current transaction). No one else can see it, so there's no reason to
|
||||
* take locks. We still take buffer-level locks, but not lmgr locks.
|
||||
* take locks. We still take buffer-level locks, but not lmgr locks.
|
||||
*/
|
||||
#define USELOCKING(rel) (!RELATION_IS_LOCAL(rel))
|
||||
|
||||
@ -139,7 +139,7 @@ _hash_getbuf(Relation rel, BlockNumber blkno, int access, int flags)
|
||||
*
|
||||
* This must be used only to fetch pages that are known to be before
|
||||
* the index's filesystem EOF, but are to be filled from scratch.
|
||||
* _hash_pageinit() is applied automatically. Otherwise it has
|
||||
* _hash_pageinit() is applied automatically. Otherwise it has
|
||||
* effects similar to _hash_getbuf() with access = HASH_WRITE.
|
||||
*
|
||||
* When this routine returns, a write lock is set on the
|
||||
@ -347,7 +347,7 @@ _hash_metapinit(Relation rel, double num_tuples, ForkNumber forkNum)
|
||||
/*
|
||||
* Determine the target fill factor (in tuples per bucket) for this index.
|
||||
* The idea is to make the fill factor correspond to pages about as full
|
||||
* as the user-settable fillfactor parameter says. We can compute it
|
||||
* as the user-settable fillfactor parameter says. We can compute it
|
||||
* exactly since the index datatype (i.e. uint32 hash key) is fixed-width.
|
||||
*/
|
||||
data_width = sizeof(uint32);
|
||||
@ -380,7 +380,7 @@ _hash_metapinit(Relation rel, double num_tuples, ForkNumber forkNum)
|
||||
/*
|
||||
* We initialize the metapage, the first N bucket pages, and the first
|
||||
* bitmap page in sequence, using _hash_getnewbuf to cause smgrextend()
|
||||
* calls to occur. This ensures that the smgr level has the right idea of
|
||||
* calls to occur. This ensures that the smgr level has the right idea of
|
||||
* the physical index length.
|
||||
*/
|
||||
metabuf = _hash_getnewbuf(rel, HASH_METAPAGE, forkNum);
|
||||
@ -516,9 +516,9 @@ _hash_expandtable(Relation rel, Buffer metabuf)
|
||||
* Note: deadlock should be impossible here. Our own backend could only be
|
||||
* holding bucket sharelocks due to stopped indexscans; those will not
|
||||
* block other holders of the page-zero lock, who are only interested in
|
||||
* acquiring bucket sharelocks themselves. Exclusive bucket locks are
|
||||
* acquiring bucket sharelocks themselves. Exclusive bucket locks are
|
||||
* only taken here and in hashbulkdelete, and neither of these operations
|
||||
* needs any additional locks to complete. (If, due to some flaw in this
|
||||
* needs any additional locks to complete. (If, due to some flaw in this
|
||||
* reasoning, we manage to deadlock anyway, it's okay to error out; the
|
||||
* index will be left in a consistent state.)
|
||||
*/
|
||||
@ -560,7 +560,7 @@ _hash_expandtable(Relation rel, Buffer metabuf)
|
||||
|
||||
/*
|
||||
* Determine which bucket is to be split, and attempt to lock the old
|
||||
* bucket. If we can't get the lock, give up.
|
||||
* bucket. If we can't get the lock, give up.
|
||||
*
|
||||
* The lock protects us against other backends, but not against our own
|
||||
* backend. Must check for active scans separately.
|
||||
@ -618,7 +618,7 @@ _hash_expandtable(Relation rel, Buffer metabuf)
|
||||
}
|
||||
|
||||
/*
|
||||
* Okay to proceed with split. Update the metapage bucket mapping info.
|
||||
* Okay to proceed with split. Update the metapage bucket mapping info.
|
||||
*
|
||||
* Since we are scribbling on the metapage data right in the shared
|
||||
* buffer, any failure in this next little bit leaves us with a big
|
||||
@ -656,7 +656,7 @@ _hash_expandtable(Relation rel, Buffer metabuf)
|
||||
* Copy bucket mapping info now; this saves re-accessing the meta page
|
||||
* inside _hash_splitbucket's inner loop. Note that once we drop the
|
||||
* split lock, other splits could begin, so these values might be out of
|
||||
* date before _hash_splitbucket finishes. That's okay, since all it
|
||||
* date before _hash_splitbucket finishes. That's okay, since all it
|
||||
* needs is to tell which of these two buckets to map hashkeys into.
|
||||
*/
|
||||
maxbucket = metap->hashm_maxbucket;
|
||||
@ -897,7 +897,7 @@ _hash_splitbucket(Relation rel,
|
||||
|
||||
/*
|
||||
* We're at the end of the old bucket chain, so we're done partitioning
|
||||
* the tuples. Before quitting, call _hash_squeezebucket to ensure the
|
||||
* the tuples. Before quitting, call _hash_squeezebucket to ensure the
|
||||
* tuples remaining in the old bucket (including the overflow pages) are
|
||||
* packed as tightly as possible. The new bucket is already tight.
|
||||
*/
|
||||
|
@ -251,7 +251,7 @@ _hash_first(IndexScanDesc scan, ScanDirection dir)
|
||||
* _hash_step() -- step to the next valid item in a scan in the bucket.
|
||||
*
|
||||
* If no valid record exists in the requested direction, return
|
||||
* false. Else, return true and set the hashso_curpos for the
|
||||
* false. Else, return true and set the hashso_curpos for the
|
||||
* scan to the right thing.
|
||||
*
|
||||
* 'bufP' points to the current buffer, which is pinned and read-locked.
|
||||
|
@ -8,7 +8,7 @@
|
||||
* thrashing. We use tuplesort.c to sort the given index tuples into order.
|
||||
*
|
||||
* Note: if the number of rows in the table has been underestimated,
|
||||
* bucket splits may occur during the index build. In that case we'd
|
||||
* bucket splits may occur during the index build. In that case we'd
|
||||
* be inserting into two or more buckets for each possible masked-off
|
||||
* hash code value. That's no big problem though, since we'll still have
|
||||
* plenty of locality of access.
|
||||
@ -52,7 +52,7 @@ _h_spoolinit(Relation index, uint32 num_buckets)
|
||||
hspool->index = index;
|
||||
|
||||
/*
|
||||
* Determine the bitmask for hash code values. Since there are currently
|
||||
* Determine the bitmask for hash code values. Since there are currently
|
||||
* num_buckets buckets in the index, the appropriate mask can be computed
|
||||
* as follows.
|
||||
*
|
||||
|
@ -161,7 +161,7 @@ _hash_checkpage(Relation rel, Buffer buf, int flags)
|
||||
/*
|
||||
* ReadBuffer verifies that every newly-read page passes
|
||||
* PageHeaderIsValid, which means it either contains a reasonably sane
|
||||
* page header or is all-zero. We have to defend against the all-zero
|
||||
* page header or is all-zero. We have to defend against the all-zero
|
||||
* case, however.
|
||||
*/
|
||||
if (PageIsNew(page))
|
||||
@ -281,7 +281,7 @@ _hash_form_tuple(Relation index, Datum *values, bool *isnull)
|
||||
*
|
||||
* Returns the offset of the first index entry having hashkey >= hash_value,
|
||||
* or the page's max offset plus one if hash_value is greater than all
|
||||
* existing hash keys in the page. This is the appropriate place to start
|
||||
* existing hash keys in the page. This is the appropriate place to start
|
||||
* a search, or to insert a new item.
|
||||
*/
|
||||
OffsetNumber
|
||||
|
@ -108,7 +108,7 @@ initscan(HeapScanDesc scan, ScanKey key, bool is_rescan)
|
||||
* while the scan is in progress will be invisible to my snapshot anyway.
|
||||
* (That is not true when using a non-MVCC snapshot. However, we couldn't
|
||||
* guarantee to return tuples added after scan start anyway, since they
|
||||
* might go into pages we already scanned. To guarantee consistent
|
||||
* might go into pages we already scanned. To guarantee consistent
|
||||
* results for a non-MVCC snapshot, the caller must hold some higher-level
|
||||
* lock that ensures the interesting tuple(s) won't change.)
|
||||
*/
|
||||
@ -116,7 +116,7 @@ initscan(HeapScanDesc scan, ScanKey key, bool is_rescan)
|
||||
|
||||
/*
|
||||
* If the table is large relative to NBuffers, use a bulk-read access
|
||||
* strategy and enable synchronized scanning (see syncscan.c). Although
|
||||
* strategy and enable synchronized scanning (see syncscan.c). Although
|
||||
* the thresholds for these features could be different, we make them the
|
||||
* same so that there are only two behaviors to tune rather than four.
|
||||
* (However, some callers need to be able to disable one or both of these
|
||||
@ -245,7 +245,7 @@ heapgetpage(HeapScanDesc scan, BlockNumber page)
|
||||
|
||||
/*
|
||||
* We must hold share lock on the buffer content while examining tuple
|
||||
* visibility. Afterwards, however, the tuples we have found to be
|
||||
* visibility. Afterwards, however, the tuples we have found to be
|
||||
* visible are guaranteed good as long as we hold the buffer pin.
|
||||
*/
|
||||
LockBuffer(buffer, BUFFER_LOCK_SHARE);
|
||||
@ -1675,7 +1675,7 @@ heap_hot_search(ItemPointer tid, Relation relation, Snapshot snapshot,
|
||||
* possibly uncommitted version.
|
||||
*
|
||||
* *tid is both an input and an output parameter: it is updated to
|
||||
* show the latest version of the row. Note that it will not be changed
|
||||
* show the latest version of the row. Note that it will not be changed
|
||||
* if no version of the row passes the snapshot test.
|
||||
*/
|
||||
void
|
||||
@ -1794,7 +1794,7 @@ heap_get_latest_tid(Relation relation,
|
||||
*
|
||||
* This is called after we have waited for the XMAX transaction to terminate.
|
||||
* If the transaction aborted, we guarantee the XMAX_INVALID hint bit will
|
||||
* be set on exit. If the transaction committed, we set the XMAX_COMMITTED
|
||||
* be set on exit. If the transaction committed, we set the XMAX_COMMITTED
|
||||
* hint bit if possible --- but beware that that may not yet be possible,
|
||||
* if the transaction committed asynchronously. Hence callers should look
|
||||
* only at XMAX_INVALID.
|
||||
@ -1867,7 +1867,7 @@ FreeBulkInsertState(BulkInsertState bistate)
|
||||
* The return value is the OID assigned to the tuple (either here or by the
|
||||
* caller), or InvalidOid if no OID. The header fields of *tup are updated
|
||||
* to match the stored tuple; in particular tup->t_self receives the actual
|
||||
* TID where the tuple was stored. But note that any toasting of fields
|
||||
* TID where the tuple was stored. But note that any toasting of fields
|
||||
* within the tuple data is NOT reflected into *tup.
|
||||
*/
|
||||
Oid
|
||||
@ -1888,7 +1888,7 @@ heap_insert(Relation relation, HeapTuple tup, CommandId cid,
|
||||
|
||||
/*
|
||||
* If the object id of this tuple has already been assigned, trust the
|
||||
* caller. There are a couple of ways this can happen. At initial db
|
||||
* caller. There are a couple of ways this can happen. At initial db
|
||||
* creation, the backend program sets oids for tuples. When we define
|
||||
* an index, we set the oid. Finally, in the future, we may allow
|
||||
* users to set their own object ids in order to support a persistent
|
||||
@ -2186,10 +2186,10 @@ l1:
|
||||
/*
|
||||
* You might think the multixact is necessarily done here, but not
|
||||
* so: it could have surviving members, namely our own xact or
|
||||
* other subxacts of this backend. It is legal for us to delete
|
||||
* other subxacts of this backend. It is legal for us to delete
|
||||
* the tuple in either case, however (the latter case is
|
||||
* essentially a situation of upgrading our former shared lock to
|
||||
* exclusive). We don't bother changing the on-disk hint bits
|
||||
* exclusive). We don't bother changing the on-disk hint bits
|
||||
* since we are about to overwrite the xmax altogether.
|
||||
*/
|
||||
}
|
||||
@ -2259,7 +2259,7 @@ l1:
|
||||
/*
|
||||
* If this transaction commits, the tuple will become DEAD sooner or
|
||||
* later. Set flag that this page is a candidate for pruning once our xid
|
||||
* falls below the OldestXmin horizon. If the transaction finally aborts,
|
||||
* falls below the OldestXmin horizon. If the transaction finally aborts,
|
||||
* the subsequent page pruning will be a no-op and the hint will be
|
||||
* cleared.
|
||||
*/
|
||||
@ -2360,7 +2360,7 @@ l1:
|
||||
*
|
||||
* This routine may be used to delete a tuple when concurrent updates of
|
||||
* the target tuple are not expected (for example, because we have a lock
|
||||
* on the relation associated with the tuple). Any failure is reported
|
||||
* on the relation associated with the tuple). Any failure is reported
|
||||
* via ereport().
|
||||
*/
|
||||
void
|
||||
@ -2456,7 +2456,7 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
|
||||
/*
|
||||
* Fetch the list of attributes to be checked for HOT update. This is
|
||||
* wasted effort if we fail to update or have to put the new tuple on a
|
||||
* different page. But we must compute the list before obtaining buffer
|
||||
* different page. But we must compute the list before obtaining buffer
|
||||
* lock --- in the worst case, if we are doing an update on one of the
|
||||
* relevant system catalogs, we could deadlock if we try to fetch the list
|
||||
* later. In any case, the relcache caches the data so this is usually
|
||||
@ -2544,10 +2544,10 @@ l2:
|
||||
/*
|
||||
* You might think the multixact is necessarily done here, but not
|
||||
* so: it could have surviving members, namely our own xact or
|
||||
* other subxacts of this backend. It is legal for us to update
|
||||
* other subxacts of this backend. It is legal for us to update
|
||||
* the tuple in either case, however (the latter case is
|
||||
* essentially a situation of upgrading our former shared lock to
|
||||
* exclusive). We don't bother changing the on-disk hint bits
|
||||
* exclusive). We don't bother changing the on-disk hint bits
|
||||
* since we are about to overwrite the xmax altogether.
|
||||
*/
|
||||
}
|
||||
@ -2643,7 +2643,7 @@ l2:
|
||||
* If the toaster needs to be activated, OR if the new tuple will not fit
|
||||
* on the same page as the old, then we need to release the content lock
|
||||
* (but not the pin!) on the old tuple's buffer while we are off doing
|
||||
* TOAST and/or table-file-extension work. We must mark the old tuple to
|
||||
* TOAST and/or table-file-extension work. We must mark the old tuple to
|
||||
* show that it's already being updated, else other processes may try to
|
||||
* update it themselves.
|
||||
*
|
||||
@ -2708,7 +2708,7 @@ l2:
|
||||
* there's more free now than before.
|
||||
*
|
||||
* What's more, if we need to get a new page, we will need to acquire
|
||||
* buffer locks on both old and new pages. To avoid deadlock against
|
||||
* buffer locks on both old and new pages. To avoid deadlock against
|
||||
* some other backend trying to get the same two locks in the other
|
||||
* order, we must be consistent about the order we get the locks in.
|
||||
* We use the rule "lock the lower-numbered page of the relation
|
||||
@ -2766,7 +2766,7 @@ l2:
|
||||
|
||||
/*
|
||||
* At this point newbuf and buffer are both pinned and locked, and newbuf
|
||||
* has enough space for the new tuple. If they are the same buffer, only
|
||||
* has enough space for the new tuple. If they are the same buffer, only
|
||||
* one pin is held.
|
||||
*/
|
||||
|
||||
@ -2774,7 +2774,7 @@ l2:
|
||||
{
|
||||
/*
|
||||
* Since the new tuple is going into the same page, we might be able
|
||||
* to do a HOT update. Check if any of the index columns have been
|
||||
* to do a HOT update. Check if any of the index columns have been
|
||||
* changed. If not, then HOT update is possible.
|
||||
*/
|
||||
if (HeapSatisfiesHOTUpdate(relation, hot_attrs, &oldtup, heaptup))
|
||||
@ -2792,13 +2792,13 @@ l2:
|
||||
/*
|
||||
* If this transaction commits, the old tuple will become DEAD sooner or
|
||||
* later. Set flag that this page is a candidate for pruning once our xid
|
||||
* falls below the OldestXmin horizon. If the transaction finally aborts,
|
||||
* falls below the OldestXmin horizon. If the transaction finally aborts,
|
||||
* the subsequent page pruning will be a no-op and the hint will be
|
||||
* cleared.
|
||||
*
|
||||
* XXX Should we set hint on newbuf as well? If the transaction aborts,
|
||||
* there would be a prunable tuple in the newbuf; but for now we choose
|
||||
* not to optimize for aborts. Note that heap_xlog_update must be kept in
|
||||
* not to optimize for aborts. Note that heap_xlog_update must be kept in
|
||||
* sync if this decision changes.
|
||||
*/
|
||||
PageSetPrunable(page, xid);
|
||||
@ -2962,7 +2962,7 @@ heap_tuple_attr_equals(TupleDesc tupdesc, int attrnum,
|
||||
|
||||
/*
|
||||
* Extract the corresponding values. XXX this is pretty inefficient if
|
||||
* there are many indexed columns. Should HeapSatisfiesHOTUpdate do a
|
||||
* there are many indexed columns. Should HeapSatisfiesHOTUpdate do a
|
||||
* single heap_deform_tuple call on each tuple, instead? But that doesn't
|
||||
* work for system columns ...
|
||||
*/
|
||||
@ -2985,7 +2985,7 @@ heap_tuple_attr_equals(TupleDesc tupdesc, int attrnum,
|
||||
/*
|
||||
* We do simple binary comparison of the two datums. This may be overly
|
||||
* strict because there can be multiple binary representations for the
|
||||
* same logical value. But we should be OK as long as there are no false
|
||||
* same logical value. But we should be OK as long as there are no false
|
||||
* positives. Using a type-specific equality operator is messy because
|
||||
* there could be multiple notions of equality in different operator
|
||||
* classes; furthermore, we cannot safely invoke user-defined functions
|
||||
@ -3041,7 +3041,7 @@ HeapSatisfiesHOTUpdate(Relation relation, Bitmapset *hot_attrs,
|
||||
*
|
||||
* This routine may be used to update a tuple when concurrent updates of
|
||||
* the target tuple are not expected (for example, because we have a lock
|
||||
* on the relation associated with the tuple). Any failure is reported
|
||||
* on the relation associated with the tuple). Any failure is reported
|
||||
* via ereport().
|
||||
*/
|
||||
void
|
||||
@ -3123,7 +3123,7 @@ simple_heap_update(Relation relation, ItemPointer otid, HeapTuple tup)
|
||||
* waiter gets the tuple, potentially leading to indefinite starvation of
|
||||
* some waiters. The possibility of share-locking makes the problem much
|
||||
* worse --- a steady stream of share-lockers can easily block an exclusive
|
||||
* locker forever. To provide more reliable semantics about who gets a
|
||||
* locker forever. To provide more reliable semantics about who gets a
|
||||
* tuple-level lock first, we use the standard lock manager. The protocol
|
||||
* for waiting for a tuple-level lock is really
|
||||
* LockTuple()
|
||||
@ -3131,7 +3131,7 @@ simple_heap_update(Relation relation, ItemPointer otid, HeapTuple tup)
|
||||
* mark tuple as locked by me
|
||||
* UnlockTuple()
|
||||
* When there are multiple waiters, arbitration of who is to get the lock next
|
||||
* is provided by LockTuple(). However, at most one tuple-level lock will
|
||||
* is provided by LockTuple(). However, at most one tuple-level lock will
|
||||
* be held or awaited per backend at any time, so we don't risk overflow
|
||||
* of the lock table. Note that incoming share-lockers are required to
|
||||
* do LockTuple as well, if there is any conflict, to ensure that they don't
|
||||
@ -3273,7 +3273,7 @@ l3:
|
||||
/*
|
||||
* You might think the multixact is necessarily done here, but not
|
||||
* so: it could have surviving members, namely our own xact or
|
||||
* other subxacts of this backend. It is legal for us to lock the
|
||||
* other subxacts of this backend. It is legal for us to lock the
|
||||
* tuple in either case, however. We don't bother changing the
|
||||
* on-disk hint bits since we are about to overwrite the xmax
|
||||
* altogether.
|
||||
@ -3431,7 +3431,7 @@ l3:
|
||||
/*
|
||||
* Can get here iff HeapTupleSatisfiesUpdate saw the old xmax
|
||||
* as running, but it finished before
|
||||
* TransactionIdIsInProgress() got to run. Treat it like
|
||||
* TransactionIdIsInProgress() got to run. Treat it like
|
||||
* there's no locker in the tuple.
|
||||
*/
|
||||
}
|
||||
@ -3467,8 +3467,8 @@ l3:
|
||||
MarkBufferDirty(*buffer);
|
||||
|
||||
/*
|
||||
* XLOG stuff. You might think that we don't need an XLOG record because
|
||||
* there is no state change worth restoring after a crash. You would be
|
||||
* XLOG stuff. You might think that we don't need an XLOG record because
|
||||
* there is no state change worth restoring after a crash. You would be
|
||||
* wrong however: we have just written either a TransactionId or a
|
||||
* MultiXactId that may never have been seen on disk before, and we need
|
||||
* to make sure that there are XLOG entries covering those ID numbers.
|
||||
@ -3530,7 +3530,7 @@ l3:
|
||||
* heap_inplace_update - update a tuple "in place" (ie, overwrite it)
|
||||
*
|
||||
* Overwriting violates both MVCC and transactional safety, so the uses
|
||||
* of this function in Postgres are extremely limited. Nonetheless we
|
||||
* of this function in Postgres are extremely limited. Nonetheless we
|
||||
* find some places to use it.
|
||||
*
|
||||
* The tuple cannot change size, and therefore it's reasonable to assume
|
||||
@ -3684,7 +3684,7 @@ heap_freeze_tuple(HeapTupleHeader tuple, TransactionId cutoff_xid,
|
||||
/*
|
||||
* When we release shared lock, it's possible for someone else to change
|
||||
* xmax before we get the lock back, so repeat the check after acquiring
|
||||
* exclusive lock. (We don't need this pushup for xmin, because only
|
||||
* exclusive lock. (We don't need this pushup for xmin, because only
|
||||
* VACUUM could be interested in changing an existing tuple's xmin, and
|
||||
* there's only one VACUUM allowed on a table at a time.)
|
||||
*/
|
||||
@ -3829,7 +3829,7 @@ heap_restrpos(HeapScanDesc scan)
|
||||
else
|
||||
{
|
||||
/*
|
||||
* If we reached end of scan, rs_inited will now be false. We must
|
||||
* If we reached end of scan, rs_inited will now be false. We must
|
||||
* reset it to true to keep heapgettup from doing the wrong thing.
|
||||
*/
|
||||
scan->rs_inited = true;
|
||||
@ -4013,7 +4013,7 @@ log_heap_clean(Relation reln, Buffer buffer,
|
||||
}
|
||||
|
||||
/*
|
||||
* Perform XLogInsert for a heap-freeze operation. Caller must already
|
||||
* Perform XLogInsert for a heap-freeze operation. Caller must already
|
||||
* have modified the buffer and marked it dirty.
|
||||
*/
|
||||
XLogRecPtr
|
||||
@ -4056,7 +4056,7 @@ log_heap_freeze(Relation reln, Buffer buffer,
|
||||
}
|
||||
|
||||
/*
|
||||
* Perform XLogInsert for a heap-update operation. Caller must already
|
||||
* Perform XLogInsert for a heap-update operation. Caller must already
|
||||
* have modified the buffer(s) and marked them dirty.
|
||||
*/
|
||||
static XLogRecPtr
|
||||
@ -4135,7 +4135,7 @@ log_heap_update(Relation reln, Buffer oldbuf, ItemPointerData from,
|
||||
* for writing the page to disk after calling this routine.
|
||||
*
|
||||
* Note: all current callers build pages in private memory and write them
|
||||
* directly to smgr, rather than using bufmgr. Therefore there is no need
|
||||
* directly to smgr, rather than using bufmgr. Therefore there is no need
|
||||
* to pass a buffer ID to XLogInsert, nor to perform MarkBufferDirty within
|
||||
* the critical section.
|
||||
*
|
||||
@ -4617,7 +4617,7 @@ heap_xlog_update(XLogRecPtr lsn, XLogRecord *record, bool hot_update)
|
||||
/*
|
||||
* In normal operation, it is important to lock the two pages in
|
||||
* page-number order, to avoid possible deadlocks against other update
|
||||
* operations going the other way. However, during WAL replay there can
|
||||
* operations going the other way. However, during WAL replay there can
|
||||
* be no other update happening, so we don't need to worry about that. But
|
||||
* we *do* need to worry that we don't expose an inconsistent state to Hot
|
||||
* Standby queries --- so the original page can't be unlocked before we've
|
||||
|
@ -117,7 +117,7 @@ ReadBufferBI(Relation relation, BlockNumber targetBlock,
|
||||
* NOTE: it is unlikely, but not quite impossible, for otherBuffer to be the
|
||||
* same buffer we select for insertion of the new tuple (this could only
|
||||
* happen if space is freed in that page after heap_update finds there's not
|
||||
* enough there). In that case, the page will be pinned and locked only once.
|
||||
* enough there). In that case, the page will be pinned and locked only once.
|
||||
*
|
||||
* We normally use FSM to help us find free space. However,
|
||||
* if HEAP_INSERT_SKIP_FSM is specified, we just append a new empty page to
|
||||
@ -134,7 +134,7 @@ ReadBufferBI(Relation relation, BlockNumber targetBlock,
|
||||
* for additional constraints needed for safe usage of this behavior.)
|
||||
*
|
||||
* The caller can also provide a BulkInsertState object to optimize many
|
||||
* insertions into the same relation. This keeps a pin on the current
|
||||
* insertions into the same relation. This keeps a pin on the current
|
||||
* insertion target page (to save pin/unpin cycles) and also passes a
|
||||
* BULKWRITE buffer selection strategy object to the buffer manager.
|
||||
* Passing NULL for bistate selects the default behavior.
|
||||
@ -187,7 +187,7 @@ RelationGetBufferForTuple(Relation relation, Size len,
|
||||
|
||||
/*
|
||||
* We first try to put the tuple on the same page we last inserted a tuple
|
||||
* on, as cached in the BulkInsertState or relcache entry. If that
|
||||
* on, as cached in the BulkInsertState or relcache entry. If that
|
||||
* doesn't work, we ask the Free Space Map to locate a suitable page.
|
||||
* Since the FSM's info might be out of date, we have to be prepared to
|
||||
* loop around and retry multiple times. (To insure this isn't an infinite
|
||||
@ -219,7 +219,7 @@ RelationGetBufferForTuple(Relation relation, Size len,
|
||||
|
||||
/*
|
||||
* If the FSM knows nothing of the rel, try the last page before we
|
||||
* give up and extend. This avoids one-tuple-per-page syndrome during
|
||||
* give up and extend. This avoids one-tuple-per-page syndrome during
|
||||
* bootstrapping or in a recently-started system.
|
||||
*/
|
||||
if (targetBlock == InvalidBlockNumber)
|
||||
@ -280,7 +280,7 @@ RelationGetBufferForTuple(Relation relation, Size len,
|
||||
|
||||
/*
|
||||
* Not enough space, so we must give up our page locks and pin (if
|
||||
* any) and prepare to look elsewhere. We don't care which order we
|
||||
* any) and prepare to look elsewhere. We don't care which order we
|
||||
* unlock the two buffers in, so this can be slightly simpler than the
|
||||
* code above.
|
||||
*/
|
||||
@ -322,7 +322,7 @@ RelationGetBufferForTuple(Relation relation, Size len,
|
||||
|
||||
/*
|
||||
* XXX This does an lseek - rather expensive - but at the moment it is the
|
||||
* only way to accurately determine how many blocks are in a relation. Is
|
||||
* only way to accurately determine how many blocks are in a relation. Is
|
||||
* it worth keeping an accurate file length in shared memory someplace,
|
||||
* rather than relying on the kernel to do it for us?
|
||||
*/
|
||||
@ -342,7 +342,7 @@ RelationGetBufferForTuple(Relation relation, Size len,
|
||||
|
||||
/*
|
||||
* Release the file-extension lock; it's now OK for someone else to extend
|
||||
* the relation some more. Note that we cannot release this lock before
|
||||
* the relation some more. Note that we cannot release this lock before
|
||||
* we have buffer lock on the new page, or we risk a race condition
|
||||
* against vacuumlazy.c --- see comments therein.
|
||||
*/
|
||||
|
@ -100,7 +100,7 @@ heap_page_prune_opt(Relation relation, Buffer buffer, TransactionId OldestXmin)
|
||||
* Checking free space here is questionable since we aren't holding any
|
||||
* lock on the buffer; in the worst case we could get a bogus answer. It's
|
||||
* unlikely to be *seriously* wrong, though, since reading either pd_lower
|
||||
* or pd_upper is probably atomic. Avoiding taking a lock seems more
|
||||
* or pd_upper is probably atomic. Avoiding taking a lock seems more
|
||||
* important than sometimes getting a wrong answer in what is after all
|
||||
* just a heuristic estimate.
|
||||
*/
|
||||
@ -319,8 +319,8 @@ heap_page_prune(Relation relation, Buffer buffer, TransactionId OldestXmin,
|
||||
* OldestXmin is the cutoff XID used to identify dead tuples.
|
||||
*
|
||||
* We don't actually change the page here, except perhaps for hint-bit updates
|
||||
* caused by HeapTupleSatisfiesVacuum. We just add entries to the arrays in
|
||||
* prstate showing the changes to be made. Items to be redirected are added
|
||||
* caused by HeapTupleSatisfiesVacuum. We just add entries to the arrays in
|
||||
* prstate showing the changes to be made. Items to be redirected are added
|
||||
* to the redirected[] array (two entries per redirection); items to be set to
|
||||
* LP_DEAD state are added to nowdead[]; and items to be set to LP_UNUSED
|
||||
* state are added to nowunused[].
|
||||
@ -362,7 +362,7 @@ heap_prune_chain(Relation relation, Buffer buffer, OffsetNumber rootoffnum,
|
||||
* We need this primarily to handle aborted HOT updates, that is,
|
||||
* XMIN_INVALID heap-only tuples. Those might not be linked to by
|
||||
* any chain, since the parent tuple might be re-updated before
|
||||
* any pruning occurs. So we have to be able to reap them
|
||||
* any pruning occurs. So we have to be able to reap them
|
||||
* separately from chain-pruning. (Note that
|
||||
* HeapTupleHeaderIsHotUpdated will never return true for an
|
||||
* XMIN_INVALID tuple, so this code will work even when there were
|
||||
@ -549,7 +549,7 @@ heap_prune_chain(Relation relation, Buffer buffer, OffsetNumber rootoffnum,
|
||||
|
||||
/*
|
||||
* If the root entry had been a normal tuple, we are deleting it, so
|
||||
* count it in the result. But changing a redirect (even to DEAD
|
||||
* count it in the result. But changing a redirect (even to DEAD
|
||||
* state) doesn't count.
|
||||
*/
|
||||
if (ItemIdIsNormal(rootlp))
|
||||
@ -638,7 +638,7 @@ heap_prune_record_unused(PruneState *prstate, OffsetNumber offnum)
|
||||
* buffer, and is inside a critical section.
|
||||
*
|
||||
* This is split out because it is also used by heap_xlog_clean()
|
||||
* to replay the WAL record when needed after a crash. Note that the
|
||||
* to replay the WAL record when needed after a crash. Note that the
|
||||
* arguments are identical to those of log_heap_clean().
|
||||
*/
|
||||
void
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user