diff options
Diffstat (limited to 'src/backend/utils/adt')
-rw-r--r-- | src/backend/utils/adt/formatting.c | 11 | ||||
-rw-r--r-- | src/backend/utils/adt/genfile.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/geo_ops.c | 36 | ||||
-rw-r--r-- | src/backend/utils/adt/json.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/jsonb.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/like.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/like_support.c | 6 | ||||
-rw-r--r-- | src/backend/utils/adt/numutils.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/regexp.c | 35 | ||||
-rw-r--r-- | src/backend/utils/adt/ri_triggers.c | 70 | ||||
-rw-r--r-- | src/backend/utils/adt/ruleutils.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/varchar.c | 16 | ||||
-rw-r--r-- | src/backend/utils/adt/varlena.c | 16 |
13 files changed, 108 insertions, 98 deletions
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index 69a691f18e7..3a6a878ffac 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -3023,6 +3023,7 @@ DCH_from_char(FormatNode *node, char *in, TmFromChar *out) int len, value; bool fx_mode = false; + /* number of extra skipped characters (more than given in format string) */ int extra_skip = 0; @@ -3049,8 +3050,8 @@ DCH_from_char(FormatNode *node, char *in, TmFromChar *out) /* * In non FX (fixed format) mode one format string space or * separator match to one space or separator in input string. - * Or match nothing if there is no space or separator in - * the current position of input string. + * Or match nothing if there is no space or separator in the + * current position of input string. */ extra_skip--; if (isspace((unsigned char) *s) || is_separator_char(s)) @@ -3176,11 +3177,13 @@ DCH_from_char(FormatNode *node, char *in, TmFromChar *out) n->key->name))); break; case DCH_TZH: + /* * Value of TZH might be negative. And the issue is that we * might swallow minus sign as the separator. So, if we have - * skipped more characters than specified in the format string, - * then we consider prepending last skipped minus to TZH. + * skipped more characters than specified in the format + * string, then we consider prepending last skipped minus to + * TZH. */ if (*s == '+' || *s == '-' || *s == ' ') { diff --git a/src/backend/utils/adt/genfile.c b/src/backend/utils/adt/genfile.c index a3c6adaf640..f5261065305 100644 --- a/src/backend/utils/adt/genfile.c +++ b/src/backend/utils/adt/genfile.c @@ -219,7 +219,7 @@ pg_read_file(PG_FUNCTION_ARGS) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), (errmsg("must be superuser to read files with adminpack 1.0"), - /* translator: %s is a SQL function name */ + /* translator: %s is a SQL function name */ errhint("Consider using %s, which is part of core, instead.", "pg_file_read()")))); diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c index 28e85e397e5..f2be6143105 100644 --- a/src/backend/utils/adt/geo_ops.c +++ b/src/backend/utils/adt/geo_ops.c @@ -88,7 +88,7 @@ static int point_inside(Point *p, int npts, Point *plist); static inline void line_construct(LINE *result, Point *pt, float8 m); static inline float8 line_sl(LINE *line); static inline float8 line_invsl(LINE *line); -static bool line_interpt_line(Point *result, LINE *l1, LINE *l2); +static bool line_interpt_line(Point *result, LINE *l1, LINE *l2); static bool line_contain_point(LINE *line, Point *point); static float8 line_closept_point(Point *result, LINE *line, Point *pt); @@ -96,10 +96,10 @@ static float8 line_closept_point(Point *result, LINE *line, Point *pt); static inline void statlseg_construct(LSEG *lseg, Point *pt1, Point *pt2); static inline float8 lseg_sl(LSEG *lseg); static inline float8 lseg_invsl(LSEG *lseg); -static bool lseg_interpt_line(Point *result, LSEG *lseg, LINE *line); -static bool lseg_interpt_lseg(Point *result, LSEG *l1, LSEG *l2); +static bool lseg_interpt_line(Point *result, LSEG *lseg, LINE *line); +static bool lseg_interpt_lseg(Point *result, LSEG *l1, LSEG *l2); static int lseg_crossing(float8 x, float8 y, float8 px, float8 py); -static bool lseg_contain_point(LSEG *lseg, Point *point); +static bool lseg_contain_point(LSEG *lseg, Point *point); static float8 lseg_closept_point(Point *result, LSEG *lseg, Point *pt); static float8 lseg_closept_line(Point *result, LSEG *lseg, LINE *line); static float8 lseg_closept_lseg(Point *result, LSEG *on_lseg, LSEG *to_lseg); @@ -692,9 +692,9 @@ static bool box_contain_box(BOX *contains_box, BOX *contained_box) { return FPge(contains_box->high.x, contained_box->high.x) && - FPle(contains_box->low.x, contained_box->low.x) && - FPge(contains_box->high.y, contained_box->high.y) && - FPle(contains_box->low.y, contained_box->low.y); + FPle(contains_box->low.x, contained_box->low.x) && + FPge(contains_box->high.y, contained_box->high.y) && + FPle(contains_box->low.y, contained_box->low.y); } @@ -2378,8 +2378,8 @@ dist_ppath(PG_FUNCTION_ARGS) Assert(path->npts > 0); /* - * The distance from a point to a path is the smallest distance - * from the point to any of its constituent segments. + * The distance from a point to a path is the smallest distance from the + * point to any of its constituent segments. */ for (i = 0; i < path->npts; i++) { @@ -2553,9 +2553,9 @@ lseg_interpt_line(Point *result, LSEG *lseg, LINE *line) LINE tmp; /* - * First, we promote the line segment to a line, because we know how - * to find the intersection point of two lines. If they don't have - * an intersection point, we are done. + * First, we promote the line segment to a line, because we know how to + * find the intersection point of two lines. If they don't have an + * intersection point, we are done. */ line_construct(&tmp, &lseg->p[0], lseg_sl(lseg)); if (!line_interpt_line(&interpt, &tmp, line)) @@ -2602,8 +2602,8 @@ line_closept_point(Point *result, LINE *line, Point *point) LINE tmp; /* - * We drop a perpendicular to find the intersection point. Ordinarily - * we should always find it, but that can fail in the presence of NaN + * We drop a perpendicular to find the intersection point. Ordinarily we + * should always find it, but that can fail in the presence of NaN * coordinates, and perhaps even from simple roundoff issues. */ line_construct(&tmp, point, line_invsl(line)); @@ -2693,8 +2693,8 @@ lseg_closept_lseg(Point *result, LSEG *on_lseg, LSEG *to_lseg) return 0.0; /* - * Then, we find the closest points from the endpoints of the second - * line segment, and keep the closest one. + * Then, we find the closest points from the endpoints of the second line + * segment, and keep the closest one. */ dist = lseg_closept_point(result, on_lseg, &to_lseg->p[0]); d = lseg_closept_point(&point, on_lseg, &to_lseg->p[1]); @@ -3063,7 +3063,7 @@ static bool box_contain_point(BOX *box, Point *point) { return box->high.x >= point->x && box->low.x <= point->x && - box->high.y >= point->y && box->low.y <= point-> y; + box->high.y >= point->y && box->low.y <= point->y; } Datum @@ -3150,7 +3150,7 @@ static bool box_contain_lseg(BOX *box, LSEG *lseg) { return box_contain_point(box, &lseg->p[0]) && - box_contain_point(box, &lseg->p[1]); + box_contain_point(box, &lseg->p[1]); } Datum diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c index bb4bac85f7d..a9784d067c7 100644 --- a/src/backend/utils/adt/json.c +++ b/src/backend/utils/adt/json.c @@ -207,7 +207,7 @@ IsValidJsonNumber(const char *str, int len) */ if (*str == '-') { - dummy_lex.input = unconstify(char *, str) + 1; + dummy_lex.input = unconstify(char *, str) +1; dummy_lex.input_length = len - 1; } else @@ -2192,7 +2192,7 @@ json_build_object(PG_FUNCTION_ARGS) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("argument list must have even number of elements"), - /* translator: %s is a SQL function name */ + /* translator: %s is a SQL function name */ errhint("The arguments of %s must consist of alternating keys and values.", "json_build_object()"))); diff --git a/src/backend/utils/adt/jsonb.c b/src/backend/utils/adt/jsonb.c index 036d771386f..c742172bd8c 100644 --- a/src/backend/utils/adt/jsonb.c +++ b/src/backend/utils/adt/jsonb.c @@ -1155,7 +1155,7 @@ jsonb_build_object(PG_FUNCTION_ARGS) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("argument list must have even number of elements"), - /* translator: %s is a SQL function name */ + /* translator: %s is a SQL function name */ errhint("The arguments of %s must consist of alternating keys and values.", "jsonb_build_object()"))); diff --git a/src/backend/utils/adt/like.c b/src/backend/utils/adt/like.c index 704e5720cf5..f4dfc504d6e 100644 --- a/src/backend/utils/adt/like.c +++ b/src/backend/utils/adt/like.c @@ -152,7 +152,7 @@ GenericMatchText(const char *s, int slen, const char *p, int plen, Oid collation { if (collation && !lc_ctype_is_c(collation) && collation != DEFAULT_COLLATION_OID) { - pg_locale_t locale = pg_newlocale_from_collation(collation); + pg_locale_t locale = pg_newlocale_from_collation(collation); if (locale && !locale->deterministic) ereport(ERROR, diff --git a/src/backend/utils/adt/like_support.c b/src/backend/utils/adt/like_support.c index 7528c80f7c3..e2583bc680a 100644 --- a/src/backend/utils/adt/like_support.c +++ b/src/backend/utils/adt/like_support.c @@ -262,9 +262,9 @@ match_pattern_prefix(Node *leftop, * optimized equality or prefix tests use bytewise comparisons, which is * not consistent with nondeterministic collations. The actual * pattern-matching implementation functions will later error out that - * pattern-matching is not supported with nondeterministic collations. - * (We could also error out here, but by doing it later we get more - * precise error messages.) (It should be possible to support at least + * pattern-matching is not supported with nondeterministic collations. (We + * could also error out here, but by doing it later we get more precise + * error messages.) (It should be possible to support at least * Pattern_Prefix_Exact, but no point as along as the actual * pattern-matching implementations don't support it.) * diff --git a/src/backend/utils/adt/numutils.c b/src/backend/utils/adt/numutils.c index c7df630c3c3..70138feb29e 100644 --- a/src/backend/utils/adt/numutils.c +++ b/src/backend/utils/adt/numutils.c @@ -182,7 +182,7 @@ invalid_syntax: errmsg("invalid input syntax for type %s: \"%s\"", "smallint", s))); - return 0; /* keep compiler quiet */ + return 0; /* keep compiler quiet */ } /* @@ -258,7 +258,7 @@ invalid_syntax: errmsg("invalid input syntax for type %s: \"%s\"", "integer", s))); - return 0; /* keep compiler quiet */ + return 0; /* keep compiler quiet */ } /* diff --git a/src/backend/utils/adt/regexp.c b/src/backend/utils/adt/regexp.c index c5be472bced..00a9a33eccc 100644 --- a/src/backend/utils/adt/regexp.c +++ b/src/backend/utils/adt/regexp.c @@ -1101,8 +1101,8 @@ setup_regexp_matches(text *orig_str, text *pattern, pg_re_flags *re_flags, /* enlarge output space if needed */ while (array_idx + matchctx->npatterns * 2 + 1 > array_len) { - array_len += array_len + 1; /* 2^n-1 => 2^(n+1)-1 */ - if (array_len > MaxAllocSize/sizeof(int)) + array_len += array_len + 1; /* 2^n-1 => 2^(n+1)-1 */ + if (array_len > MaxAllocSize / sizeof(int)) ereport(ERROR, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many regular expression matches"))); @@ -1117,8 +1117,9 @@ setup_regexp_matches(text *orig_str, text *pattern, pg_re_flags *re_flags, for (i = 1; i <= matchctx->npatterns; i++) { - int so = pmatch[i].rm_so; - int eo = pmatch[i].rm_eo; + int so = pmatch[i].rm_so; + int eo = pmatch[i].rm_eo; + matchctx->match_locs[array_idx++] = so; matchctx->match_locs[array_idx++] = eo; if (so >= 0 && eo >= 0 && (eo - so) > maxlen) @@ -1127,8 +1128,9 @@ setup_regexp_matches(text *orig_str, text *pattern, pg_re_flags *re_flags, } else { - int so = pmatch[0].rm_so; - int eo = pmatch[0].rm_eo; + int so = pmatch[0].rm_so; + int eo = pmatch[0].rm_eo; + matchctx->match_locs[array_idx++] = so; matchctx->match_locs[array_idx++] = eo; if (so >= 0 && eo >= 0 && (eo - so) > maxlen) @@ -1190,10 +1192,10 @@ setup_regexp_matches(text *orig_str, text *pattern, pg_re_flags *re_flags, * interest. * * Worst case: assume we need the maximum size (maxlen*eml), but take - * advantage of the fact that the original string length in bytes is an - * upper bound on the byte length of any fetched substring (and we know - * that len+1 is safe to allocate because the varlena header is longer - * than 1 byte). + * advantage of the fact that the original string length in bytes is + * an upper bound on the byte length of any fetched substring (and we + * know that len+1 is safe to allocate because the varlena header is + * longer than 1 byte). */ if (maxsiz > orig_len) conv_bufsiz = orig_len + 1; @@ -1248,9 +1250,10 @@ build_regexp_match_result(regexp_matches_ctx *matchctx) } else if (buf) { - int len = pg_wchar2mb_with_len(matchctx->wide_str + so, - buf, - eo - so); + int len = pg_wchar2mb_with_len(matchctx->wide_str + so, + buf, + eo - so); + Assert(len < bufsiz); elems[i] = PointerGetDatum(cstring_to_text_with_len(buf, len)); nulls[i] = false; @@ -1409,15 +1412,15 @@ build_regexp_split_result(regexp_matches_ctx *splitctx) if (buf) { - int bufsiz PG_USED_FOR_ASSERTS_ONLY = splitctx->conv_bufsiz; - int len; + int bufsiz PG_USED_FOR_ASSERTS_ONLY = splitctx->conv_bufsiz; + int len; endpos = splitctx->match_locs[splitctx->next_match * 2]; if (endpos < startpos) elog(ERROR, "invalid match starting position"); len = pg_wchar2mb_with_len(splitctx->wide_str + startpos, buf, - endpos-startpos); + endpos - startpos); Assert(len < bufsiz); return PointerGetDatum(cstring_to_text_with_len(buf, len)); } diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c index 095334b3363..b9e0f5c048d 100644 --- a/src/backend/utils/adt/ri_triggers.c +++ b/src/backend/utils/adt/ri_triggers.c @@ -635,10 +635,10 @@ ri_restrict(TriggerData *trigdata, bool is_no_action) oldslot = trigdata->tg_trigslot; /* - * If another PK row now exists providing the old key values, we - * should not do anything. However, this check should only be - * made in the NO ACTION case; in RESTRICT cases we don't wish to - * allow another row to be substituted. + * If another PK row now exists providing the old key values, we should + * not do anything. However, this check should only be made in the NO + * ACTION case; in RESTRICT cases we don't wish to allow another row to be + * substituted. */ if (is_no_action && ri_Check_Pk_Match(pk_rel, fk_rel, oldslot, riinfo)) @@ -651,8 +651,8 @@ ri_restrict(TriggerData *trigdata, bool is_no_action) elog(ERROR, "SPI_connect failed"); /* - * Fetch or prepare a saved plan for the restrict lookup (it's the - * same query for delete and update cases) + * Fetch or prepare a saved plan for the restrict lookup (it's the same + * query for delete and update cases) */ ri_BuildQueryKey(&qkey, riinfo, RI_PLAN_RESTRICT_CHECKREF); @@ -713,7 +713,7 @@ ri_restrict(TriggerData *trigdata, bool is_no_action) ri_PerformCheck(riinfo, &qkey, qplan, fk_rel, pk_rel, oldslot, NULL, - true, /* must detect new rows */ + true, /* must detect new rows */ SPI_OK_SELECT); if (SPI_finish() != SPI_OK_FINISH) @@ -813,13 +813,13 @@ RI_FKey_cascade_del(PG_FUNCTION_ARGS) } /* - * We have a plan now. Build up the arguments from the key values - * in the deleted PK tuple and delete the referencing rows + * We have a plan now. Build up the arguments from the key values in the + * deleted PK tuple and delete the referencing rows */ ri_PerformCheck(riinfo, &qkey, qplan, fk_rel, pk_rel, oldslot, NULL, - true, /* must detect new rows */ + true, /* must detect new rows */ SPI_OK_DELETE); if (SPI_finish() != SPI_OK_FINISH) @@ -940,7 +940,7 @@ RI_FKey_cascade_upd(PG_FUNCTION_ARGS) ri_PerformCheck(riinfo, &qkey, qplan, fk_rel, pk_rel, oldslot, newslot, - true, /* must detect new rows */ + true, /* must detect new rows */ SPI_OK_UPDATE); if (SPI_finish() != SPI_OK_FINISH) @@ -1119,7 +1119,7 @@ ri_set(TriggerData *trigdata, bool is_set_null) ri_PerformCheck(riinfo, &qkey, qplan, fk_rel, pk_rel, oldslot, NULL, - true, /* must detect new rows */ + true, /* must detect new rows */ SPI_OK_UPDATE); if (SPI_finish() != SPI_OK_FINISH) @@ -1132,18 +1132,17 @@ ri_set(TriggerData *trigdata, bool is_set_null) else { /* - * If we just deleted or updated the PK row whose key was equal to - * the FK columns' default values, and a referencing row exists in - * the FK table, we would have updated that row to the same values - * it already had --- and RI_FKey_fk_upd_check_required would - * hence believe no check is necessary. So we need to do another - * lookup now and in case a reference still exists, abort the - * operation. That is already implemented in the NO ACTION - * trigger, so just run it. (This recheck is only needed in the - * SET DEFAULT case, since CASCADE would remove such rows in case - * of a DELETE operation or would change the FK key values in case - * of an UPDATE, while SET NULL is certain to result in rows that - * satisfy the FK constraint.) + * If we just deleted or updated the PK row whose key was equal to the + * FK columns' default values, and a referencing row exists in the FK + * table, we would have updated that row to the same values it already + * had --- and RI_FKey_fk_upd_check_required would hence believe no + * check is necessary. So we need to do another lookup now and in + * case a reference still exists, abort the operation. That is + * already implemented in the NO ACTION trigger, so just run it. (This + * recheck is only needed in the SET DEFAULT case, since CASCADE would + * remove such rows in case of a DELETE operation or would change the + * FK key values in case of an UPDATE, while SET NULL is certain to + * result in rows that satisfy the FK constraint.) */ return ri_restrict(trigdata, true); } @@ -1170,8 +1169,8 @@ RI_FKey_pk_upd_check_required(Trigger *trigger, Relation pk_rel, riinfo = ri_FetchConstraintInfo(trigger, pk_rel, true); /* - * If any old key value is NULL, the row could not have been - * referenced by an FK row, so no check is needed. + * If any old key value is NULL, the row could not have been referenced by + * an FK row, so no check is needed. */ if (ri_NullCheck(RelationGetDescr(pk_rel), oldslot, riinfo, true) != RI_KEYS_NONE_NULL) return false; @@ -1213,14 +1212,17 @@ RI_FKey_fk_upd_check_required(Trigger *trigger, Relation fk_rel, */ if (ri_nullcheck == RI_KEYS_ALL_NULL) return false; + /* - * If some new key values are NULL, the behavior depends on the match type. + * If some new key values are NULL, the behavior depends on the match + * type. */ else if (ri_nullcheck == RI_KEYS_SOME_NULL) { switch (riinfo->confmatchtype) { case FKCONSTR_MATCH_SIMPLE: + /* * If any new key value is NULL, the row must satisfy the * constraint, so no check is needed. @@ -1228,12 +1230,14 @@ RI_FKey_fk_upd_check_required(Trigger *trigger, Relation fk_rel, return false; case FKCONSTR_MATCH_PARTIAL: + /* * Don't know, must run full check. */ break; case FKCONSTR_MATCH_FULL: + /* * If some new key values are NULL, the row fails the * constraint. We must not throw error here, because the row @@ -1251,12 +1255,12 @@ RI_FKey_fk_upd_check_required(Trigger *trigger, Relation fk_rel, */ /* - * If the original row was inserted by our own transaction, we - * must fire the trigger whether or not the keys are equal. This - * is because our UPDATE will invalidate the INSERT so that the - * INSERT RI trigger will not do anything; so we had better do the - * UPDATE check. (We could skip this if we knew the INSERT - * trigger already fired, but there is no easy way to know that.) + * If the original row was inserted by our own transaction, we must fire + * the trigger whether or not the keys are equal. This is because our + * UPDATE will invalidate the INSERT so that the INSERT RI trigger will + * not do anything; so we had better do the UPDATE check. (We could skip + * this if we knew the INSERT trigger already fired, but there is no easy + * way to know that.) */ xminDatum = slot_getsysattr(oldslot, MinTransactionIdAttributeNumber, &isnull); Assert(!isnull); diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 1e3bcb47b86..f911511158d 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -1566,7 +1566,7 @@ pg_get_statisticsobj_worker(Oid statextid, bool missing_ok) */ if (!ndistinct_enabled || !dependencies_enabled || !mcv_enabled) { - bool gotone = false; + bool gotone = false; appendStringInfoString(&buf, " ("); diff --git a/src/backend/utils/adt/varchar.c b/src/backend/utils/adt/varchar.c index 4003631d8f5..332dc860c4f 100644 --- a/src/backend/utils/adt/varchar.c +++ b/src/backend/utils/adt/varchar.c @@ -755,8 +755,8 @@ bpchareq(PG_FUNCTION_ARGS) pg_newlocale_from_collation(collid)->deterministic) { /* - * Since we only care about equality or not-equality, we can avoid all the - * expense of strcoll() here, and just do bitwise comparison. + * Since we only care about equality or not-equality, we can avoid all + * the expense of strcoll() here, and just do bitwise comparison. */ if (len1 != len2) result = false; @@ -793,8 +793,8 @@ bpcharne(PG_FUNCTION_ARGS) pg_newlocale_from_collation(collid)->deterministic) { /* - * Since we only care about equality or not-equality, we can avoid all the - * expense of strcoll() here, and just do bitwise comparison. + * Since we only care about equality or not-equality, we can avoid all + * the expense of strcoll() here, and just do bitwise comparison. */ if (len1 != len2) result = true; @@ -983,7 +983,7 @@ hashbpchar(PG_FUNCTION_ARGS) Oid collid = PG_GET_COLLATION(); char *keydata; int keylen; - pg_locale_t mylocale = 0; + pg_locale_t mylocale = 0; Datum result; if (!collid) @@ -1010,7 +1010,7 @@ hashbpchar(PG_FUNCTION_ARGS) int32_t ulen = -1; UChar *uchar = NULL; Size bsize; - uint8_t *buf; + uint8_t *buf; ulen = icu_to_uchar(&uchar, keydata, keylen); @@ -1043,7 +1043,7 @@ hashbpcharextended(PG_FUNCTION_ARGS) Oid collid = PG_GET_COLLATION(); char *keydata; int keylen; - pg_locale_t mylocale = 0; + pg_locale_t mylocale = 0; Datum result; if (!collid) @@ -1071,7 +1071,7 @@ hashbpcharextended(PG_FUNCTION_ARGS) int32_t ulen = -1; UChar *uchar = NULL; Size bsize; - uint8_t *buf; + uint8_t *buf; ulen = icu_to_uchar(&uchar, VARDATA_ANY(key), VARSIZE_ANY_EXHDR(key)); diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index f82ce92ce3d..e166effa5e5 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -1152,7 +1152,7 @@ text_position_setup(text *t1, text *t2, Oid collid, TextPositionState *state) { int len1 = VARSIZE_ANY_EXHDR(t1); int len2 = VARSIZE_ANY_EXHDR(t2); - pg_locale_t mylocale = 0; + pg_locale_t mylocale = 0; check_collation_set(collid); @@ -1723,11 +1723,11 @@ texteq(PG_FUNCTION_ARGS) len2; /* - * Since we only care about equality or not-equality, we can avoid all the - * expense of strcoll() here, and just do bitwise comparison. In fact, we - * don't even have to do a bitwise comparison if we can show the lengths - * of the strings are unequal; which might save us from having to detoast - * one or both values. + * Since we only care about equality or not-equality, we can avoid all + * the expense of strcoll() here, and just do bitwise comparison. In + * fact, we don't even have to do a bitwise comparison if we can show + * the lengths of the strings are unequal; which might save us from + * having to detoast one or both values. */ len1 = toast_raw_datum_size(arg1); len2 = toast_raw_datum_size(arg2); @@ -1873,7 +1873,7 @@ text_starts_with(PG_FUNCTION_ARGS) Datum arg1 = PG_GETARG_DATUM(0); Datum arg2 = PG_GETARG_DATUM(1); Oid collid = PG_GET_COLLATION(); - pg_locale_t mylocale = 0; + pg_locale_t mylocale = 0; bool result; Size len1, len2; @@ -5346,7 +5346,7 @@ text_concat_ws(PG_FUNCTION_ARGS) Datum text_left(PG_FUNCTION_ARGS) { - int n = PG_GETARG_INT32(1); + int n = PG_GETARG_INT32(1); if (n < 0) { |