mirror of
https://github.com/postgres/postgres.git
synced 2025-08-31 17:02:12 +03:00
Pgindent run before 9.1 beta2.
This commit is contained in:
@@ -4049,10 +4049,11 @@ EncodeInterval(struct pg_tm * tm, fsec_t fsec, int style, char *str)
|
||||
/* Compatible with postgresql < 8.4 when DateStyle = 'iso' */
|
||||
case INTSTYLE_POSTGRES:
|
||||
cp = AddPostgresIntPart(cp, year, "year", &is_zero, &is_before);
|
||||
|
||||
/*
|
||||
* Ideally we should spell out "month" like we do for "year"
|
||||
* and "day". However, for backward compatibility, we can't
|
||||
* easily fix this. bjm 2011-05-24
|
||||
* Ideally we should spell out "month" like we do for "year" and
|
||||
* "day". However, for backward compatibility, we can't easily
|
||||
* fix this. bjm 2011-05-24
|
||||
*/
|
||||
cp = AddPostgresIntPart(cp, mon, "mon", &is_zero, &is_before);
|
||||
cp = AddPostgresIntPart(cp, mday, "day", &is_zero, &is_before);
|
||||
|
@@ -564,9 +564,9 @@ strftime_win32(char *dst, size_t dstlen, const wchar_t *format, const struct tm
|
||||
dst[len] = '\0';
|
||||
if (encoding != PG_UTF8)
|
||||
{
|
||||
char *convstr =
|
||||
(char *) pg_do_encoding_conversion((unsigned char *) dst,
|
||||
len, PG_UTF8, encoding);
|
||||
char *convstr =
|
||||
(char *) pg_do_encoding_conversion((unsigned char *) dst,
|
||||
len, PG_UTF8, encoding);
|
||||
|
||||
if (dst != convstr)
|
||||
{
|
||||
@@ -1099,19 +1099,19 @@ wchar2char(char *to, const wchar_t *from, size_t tolen, pg_locale_t locale)
|
||||
#ifdef HAVE_WCSTOMBS_L
|
||||
/* Use wcstombs_l for nondefault locales */
|
||||
result = wcstombs_l(to, from, tolen, locale);
|
||||
#else /* !HAVE_WCSTOMBS_L */
|
||||
#else /* !HAVE_WCSTOMBS_L */
|
||||
/* We have to temporarily set the locale as current ... ugh */
|
||||
locale_t save_locale = uselocale(locale);
|
||||
|
||||
result = wcstombs(to, from, tolen);
|
||||
|
||||
uselocale(save_locale);
|
||||
#endif /* HAVE_WCSTOMBS_L */
|
||||
#else /* !HAVE_LOCALE_T */
|
||||
#endif /* HAVE_WCSTOMBS_L */
|
||||
#else /* !HAVE_LOCALE_T */
|
||||
/* Can't have locale != 0 without HAVE_LOCALE_T */
|
||||
elog(ERROR, "wcstombs_l is not available");
|
||||
result = 0; /* keep compiler quiet */
|
||||
#endif /* HAVE_LOCALE_T */
|
||||
#endif /* HAVE_LOCALE_T */
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -1174,19 +1174,19 @@ char2wchar(wchar_t *to, size_t tolen, const char *from, size_t fromlen,
|
||||
#ifdef HAVE_WCSTOMBS_L
|
||||
/* Use mbstowcs_l for nondefault locales */
|
||||
result = mbstowcs_l(to, str, tolen, locale);
|
||||
#else /* !HAVE_WCSTOMBS_L */
|
||||
#else /* !HAVE_WCSTOMBS_L */
|
||||
/* We have to temporarily set the locale as current ... ugh */
|
||||
locale_t save_locale = uselocale(locale);
|
||||
|
||||
result = mbstowcs(to, str, tolen);
|
||||
|
||||
uselocale(save_locale);
|
||||
#endif /* HAVE_WCSTOMBS_L */
|
||||
#else /* !HAVE_LOCALE_T */
|
||||
#endif /* HAVE_WCSTOMBS_L */
|
||||
#else /* !HAVE_LOCALE_T */
|
||||
/* Can't have locale != 0 without HAVE_LOCALE_T */
|
||||
elog(ERROR, "mbstowcs_l is not available");
|
||||
result = 0; /* keep compiler quiet */
|
||||
#endif /* HAVE_LOCALE_T */
|
||||
result = 0; /* keep compiler quiet */
|
||||
#endif /* HAVE_LOCALE_T */
|
||||
}
|
||||
|
||||
pfree(str);
|
||||
@@ -1213,4 +1213,4 @@ char2wchar(wchar_t *to, size_t tolen, const char *from, size_t fromlen,
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif /* USE_WIDE_UPPER_LOWER */
|
||||
#endif /* USE_WIDE_UPPER_LOWER */
|
||||
|
@@ -83,7 +83,7 @@
|
||||
|
||||
#define RIAttName(rel, attnum) NameStr(*attnumAttName(rel, attnum))
|
||||
#define RIAttType(rel, attnum) attnumTypeId(rel, attnum)
|
||||
#define RIAttCollation(rel, attnum) attnumCollationId(rel, attnum)
|
||||
#define RIAttCollation(rel, attnum) attnumCollationId(rel, attnum)
|
||||
|
||||
#define RI_TRIGTYPE_INSERT 1
|
||||
#define RI_TRIGTYPE_UPDATE 2
|
||||
@@ -3024,8 +3024,8 @@ ri_GenerateQualCollation(StringInfo buf, Oid collation)
|
||||
collname = NameStr(colltup->collname);
|
||||
|
||||
/*
|
||||
* We qualify the name always, for simplicity and to ensure the query
|
||||
* is not search-path-dependent.
|
||||
* We qualify the name always, for simplicity and to ensure the query is
|
||||
* not search-path-dependent.
|
||||
*/
|
||||
quoteOneName(onename, get_namespace_name(colltup->collnamespace));
|
||||
appendStringInfo(buf, " COLLATE %s", onename);
|
||||
@@ -3964,8 +3964,8 @@ ri_AttributesEqual(Oid eq_opr, Oid typeid,
|
||||
}
|
||||
|
||||
/*
|
||||
* Apply the comparison operator. We assume it doesn't
|
||||
* care about collations.
|
||||
* Apply the comparison operator. We assume it doesn't care about
|
||||
* collations.
|
||||
*/
|
||||
return DatumGetBool(FunctionCall2(&entry->eq_opr_finfo,
|
||||
oldvalue, newvalue));
|
||||
|
@@ -5193,8 +5193,8 @@ get_rule_expr(Node *node, deparse_context *context,
|
||||
if (caseexpr->arg)
|
||||
{
|
||||
/*
|
||||
* The parser should have produced WHEN clauses of
|
||||
* the form "CaseTestExpr = RHS", possibly with an
|
||||
* The parser should have produced WHEN clauses of the
|
||||
* form "CaseTestExpr = RHS", possibly with an
|
||||
* implicit coercion inserted above the CaseTestExpr.
|
||||
* For accurate decompilation of rules it's essential
|
||||
* that we show just the RHS. However in an
|
||||
|
@@ -291,12 +291,12 @@ var_eq_const(VariableStatData *vardata, Oid operator,
|
||||
/* be careful to apply operator right way 'round */
|
||||
if (varonleft)
|
||||
match = DatumGetBool(FunctionCall2Coll(&eqproc,
|
||||
DEFAULT_COLLATION_OID,
|
||||
DEFAULT_COLLATION_OID,
|
||||
values[i],
|
||||
constval));
|
||||
else
|
||||
match = DatumGetBool(FunctionCall2Coll(&eqproc,
|
||||
DEFAULT_COLLATION_OID,
|
||||
DEFAULT_COLLATION_OID,
|
||||
constval,
|
||||
values[i]));
|
||||
if (match)
|
||||
@@ -1185,7 +1185,7 @@ patternsel(PG_FUNCTION_ARGS, Pattern_Type ptype, bool negate)
|
||||
}
|
||||
|
||||
/*
|
||||
* Divide pattern into fixed prefix and remainder. XXX we have to assume
|
||||
* Divide pattern into fixed prefix and remainder. XXX we have to assume
|
||||
* default collation here, because we don't have access to the actual
|
||||
* input collation for the operator. FIXME ...
|
||||
*/
|
||||
@@ -2403,9 +2403,9 @@ eqjoinsel_semi(Oid operator,
|
||||
* before doing the division.
|
||||
*
|
||||
* Crude as the above is, it's completely useless if we don't have
|
||||
* reliable ndistinct values for both sides. Hence, if either nd1
|
||||
* or nd2 is default, punt and assume half of the uncertain rows
|
||||
* have join partners.
|
||||
* reliable ndistinct values for both sides. Hence, if either nd1 or
|
||||
* nd2 is default, punt and assume half of the uncertain rows have
|
||||
* join partners.
|
||||
*/
|
||||
if (nd1 != DEFAULT_NUM_DISTINCT && nd2 != DEFAULT_NUM_DISTINCT)
|
||||
{
|
||||
@@ -4779,7 +4779,7 @@ get_actual_variable_range(PlannerInfo *root, VariableStatData *vardata,
|
||||
* Check whether char is a letter (and, hence, subject to case-folding)
|
||||
*
|
||||
* In multibyte character sets, we can't use isalpha, and it does not seem
|
||||
* worth trying to convert to wchar_t to use iswalpha. Instead, just assume
|
||||
* worth trying to convert to wchar_t to use iswalpha. Instead, just assume
|
||||
* any multibyte char is potentially case-varying.
|
||||
*/
|
||||
static int
|
||||
@@ -4823,7 +4823,7 @@ like_fixed_prefix(Const *patt_const, bool case_insensitive, Oid collation,
|
||||
int pos,
|
||||
match_pos;
|
||||
bool is_multibyte = (pg_database_encoding_max_length() > 1);
|
||||
pg_locale_t locale = 0;
|
||||
pg_locale_t locale = 0;
|
||||
bool locale_is_c = false;
|
||||
|
||||
/* the right-hand const is type text or bytea */
|
||||
@@ -4834,7 +4834,7 @@ like_fixed_prefix(Const *patt_const, bool case_insensitive, Oid collation,
|
||||
if (typeid == BYTEAOID)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("case insensitive matching not supported on type bytea")));
|
||||
errmsg("case insensitive matching not supported on type bytea")));
|
||||
|
||||
/* If case-insensitive, we need locale info */
|
||||
if (lc_ctype_is_c(collation))
|
||||
@@ -4891,7 +4891,7 @@ like_fixed_prefix(Const *patt_const, bool case_insensitive, Oid collation,
|
||||
|
||||
/* Stop if case-varying character (it's sort of a wildcard) */
|
||||
if (case_insensitive &&
|
||||
pattern_char_isalpha(patt[pos], is_multibyte, locale, locale_is_c))
|
||||
pattern_char_isalpha(patt[pos], is_multibyte, locale, locale_is_c))
|
||||
break;
|
||||
|
||||
match[match_pos++] = patt[pos];
|
||||
@@ -4938,7 +4938,7 @@ regex_fixed_prefix(Const *patt_const, bool case_insensitive, Oid collation,
|
||||
char *rest;
|
||||
Oid typeid = patt_const->consttype;
|
||||
bool is_multibyte = (pg_database_encoding_max_length() > 1);
|
||||
pg_locale_t locale = 0;
|
||||
pg_locale_t locale = 0;
|
||||
bool locale_is_c = false;
|
||||
|
||||
/*
|
||||
@@ -5050,7 +5050,7 @@ regex_fixed_prefix(Const *patt_const, bool case_insensitive, Oid collation,
|
||||
|
||||
/* Stop if case-varying character (it's sort of a wildcard) */
|
||||
if (case_insensitive &&
|
||||
pattern_char_isalpha(patt[pos], is_multibyte, locale, locale_is_c))
|
||||
pattern_char_isalpha(patt[pos], is_multibyte, locale, locale_is_c))
|
||||
break;
|
||||
|
||||
/*
|
||||
|
@@ -3829,7 +3829,7 @@ text_format(PG_FUNCTION_ARGS)
|
||||
if (*cp < '0' || *cp > '9')
|
||||
{
|
||||
++arg;
|
||||
if (arg <= 0) /* overflow? */
|
||||
if (arg <= 0) /* overflow? */
|
||||
{
|
||||
/*
|
||||
* Should not happen, as you can't pass billions of arguments
|
||||
@@ -3848,9 +3848,9 @@ text_format(PG_FUNCTION_ARGS)
|
||||
arg = 0;
|
||||
do
|
||||
{
|
||||
int newarg = arg * 10 + (*cp - '0');
|
||||
int newarg = arg * 10 + (*cp - '0');
|
||||
|
||||
if (newarg / 10 != arg) /* overflow? */
|
||||
if (newarg / 10 != arg) /* overflow? */
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
|
||||
errmsg("argument number is out of range")));
|
||||
|
Reference in New Issue
Block a user