summaryrefslogtreecommitdiff
path: root/src/pl/plperl/plperl.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-06-21 15:35:54 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2017-06-21 15:35:54 -0400
commit382ceffdf7f620d8f2d50e451b4167d291ae2348 (patch)
treef558251492f2c6f86e3566f7a82f9d00509122c2 /src/pl/plperl/plperl.c
parentc7b8998ebbf310a156aa38022555a24d98fdbfb4 (diff)
downloadpostgresql-382ceffdf7f620d8f2d50e451b4167d291ae2348.tar.gz
Phase 3 of pgindent updates.
Don't move parenthesized lines to the left, even if that means they flow past the right margin. By default, BSD indent lines up statement continuation lines that are within parentheses so that they start just to the right of the preceding left parenthesis. However, traditionally, if that resulted in the continuation line extending to the right of the desired right margin, then indent would push it left just far enough to not overrun the margin, if it could do so without making the continuation line start to the left of the current statement indent. That makes for a weird mix of indentations unless one has been completely rigid about never violating the 80-column limit. This behavior has been pretty universally panned by Postgres developers. Hence, disable it with indent's new -lpl switch, so that parenthesized lines are always lined up with the preceding left paren. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
Diffstat (limited to 'src/pl/plperl/plperl.c')
-rw-r--r--src/pl/plperl/plperl.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c
index 02ce670346..5a45e3e0aa 100644
--- a/src/pl/plperl/plperl.c
+++ b/src/pl/plperl/plperl.c
@@ -649,7 +649,7 @@ select_perl_context(bool trusted)
ereport(ERROR,
(errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
errmsg("%s", strip_trailing_ws(sv2cstr(ERRSV))),
- errcontext("while executing PostgreSQL::InServer::SPI::bootstrap")));
+ errcontext("while executing PostgreSQL::InServer::SPI::bootstrap")));
/* Fully initialized, so mark the hashtable entry valid */
interp_desc->interp = interp;
@@ -1320,19 +1320,19 @@ plperl_sv_to_datum(SV *sv, Oid typid, int32 typmod,
if (!type_is_rowtype(typid))
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
- errmsg("cannot convert Perl hash to non-composite type %s",
- format_type_be(typid))));
+ errmsg("cannot convert Perl hash to non-composite type %s",
+ format_type_be(typid))));
td = lookup_rowtype_tupdesc_noerror(typid, typmod, true);
if (td == NULL)
{
/* Try to look it up based on our result type */
if (fcinfo == NULL ||
- get_call_result_type(fcinfo, NULL, &td) != TYPEFUNC_COMPOSITE)
+ get_call_result_type(fcinfo, NULL, &td) != TYPEFUNC_COMPOSITE)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("function returning record called in context "
- "that cannot accept type record")));
+ errmsg("function returning record called in context "
+ "that cannot accept type record")));
}
ret = plperl_hash_to_datum(sv, td);
@@ -1346,7 +1346,7 @@ plperl_sv_to_datum(SV *sv, Oid typid, int32 typmod,
/* Reference, but not reference to hash or array ... */
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
- errmsg("PL/Perl function must return reference to hash or array")));
+ errmsg("PL/Perl function must return reference to hash or array")));
return (Datum) 0; /* shut up compiler */
}
else
@@ -1436,8 +1436,8 @@ plperl_ref_from_pg_array(Datum arg, Oid typid)
/* Check for a transform function */
transform_funcid = get_transform_fromsql(elementtype,
- current_call_data->prodesc->lang_oid,
- current_call_data->prodesc->trftypes);
+ current_call_data->prodesc->lang_oid,
+ current_call_data->prodesc->trftypes);
/* Look up transform or output function as appropriate */
if (OidIsValid(transform_funcid))
@@ -1572,7 +1572,7 @@ plperl_trigger_build_args(FunctionCallInfo fcinfo)
relid = DatumGetCString(
DirectFunctionCall1(oidout,
- ObjectIdGetDatum(tdata->tg_relation->rd_id)
+ ObjectIdGetDatum(tdata->tg_relation->rd_id)
)
);
@@ -1725,8 +1725,8 @@ plperl_modify_tuple(HV *hvTD, TriggerData *tdata, HeapTuple otup)
key)));
modvalues[attn - 1] = plperl_sv_to_datum(val,
- tupdesc->attrs[attn - 1]->atttypid,
- tupdesc->attrs[attn - 1]->atttypmod,
+ tupdesc->attrs[attn - 1]->atttypid,
+ tupdesc->attrs[attn - 1]->atttypmod,
NULL,
NULL,
InvalidOid,
@@ -2076,8 +2076,8 @@ plperl_create_sub(plperl_proc_desc *prodesc, char *s, Oid fn_oid)
if (!subref)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("didn't get a CODE reference from compiling function \"%s\"",
- prodesc->proname)));
+ errmsg("didn't get a CODE reference from compiling function \"%s\"",
+ prodesc->proname)));
prodesc->reference = subref;
@@ -2527,8 +2527,8 @@ plperl_trigger_handler(PG_FUNCTION_ARGS)
{
ereport(ERROR,
(errcode(ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED),
- errmsg("result of PL/Perl trigger function must be undef, "
- "\"SKIP\", or \"MODIFY\"")));
+ errmsg("result of PL/Perl trigger function must be undef, "
+ "\"SKIP\", or \"MODIFY\"")));
trv = NULL;
}
retval = PointerGetDatum(trv);
@@ -2735,7 +2735,7 @@ compile_plperl_function(Oid fn_oid, bool is_trigger, bool is_event_trigger)
/* Fetch protrftypes */
protrftypes_datum = SysCacheGetAttr(PROCOID, procTup,
- Anum_pg_proc_protrftypes, &isnull);
+ Anum_pg_proc_protrftypes, &isnull);
MemoryContextSwitchTo(proc_cxt);
prodesc->trftypes = isnull ? NIL : oid_array_to_list(protrftypes_datum);
MemoryContextSwitchTo(oldcontext);
@@ -2789,7 +2789,7 @@ compile_plperl_function(Oid fn_oid, bool is_trigger, bool is_event_trigger)
prodesc->result_oid = procStruct->prorettype;
prodesc->fn_retisset = procStruct->proretset;
prodesc->fn_retistuple = (procStruct->prorettype == RECORDOID ||
- typeStruct->typtype == TYPTYPE_COMPOSITE);
+ typeStruct->typtype == TYPTYPE_COMPOSITE);
prodesc->fn_retisarray =
(typeStruct->typlen == -1 && typeStruct->typelem);
@@ -2813,7 +2813,7 @@ compile_plperl_function(Oid fn_oid, bool is_trigger, bool is_event_trigger)
for (i = 0; i < prodesc->nargs; i++)
{
typeTup = SearchSysCache1(TYPEOID,
- ObjectIdGetDatum(procStruct->proargtypes.values[i]));
+ ObjectIdGetDatum(procStruct->proargtypes.values[i]));
if (!HeapTupleIsValid(typeTup))
elog(ERROR, "cache lookup failed for type %u",
procStruct->proargtypes.values[i]);
@@ -2825,7 +2825,7 @@ compile_plperl_function(Oid fn_oid, bool is_trigger, bool is_event_trigger)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("PL/Perl functions cannot accept type %s",
- format_type_be(procStruct->proargtypes.values[i]))));
+ format_type_be(procStruct->proargtypes.values[i]))));
if (typeStruct->typtype == TYPTYPE_COMPOSITE ||
procStruct->proargtypes.values[i] == RECORDOID)
@@ -3117,7 +3117,7 @@ plperl_spi_execute_fetch_result(SPITupleTable *tuptable, uint64 processed,
if (processed > (uint64) AV_SIZE_MAX)
ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
- errmsg("query result has too many rows to fit in a Perl array")));
+ errmsg("query result has too many rows to fit in a Perl array")));
rows = newAV();
av_extend(rows, processed);
@@ -3635,7 +3635,7 @@ plperl_spi_exec_prepared(char *query, HV *attr, int argc, SV **argv)
* go
************************************************************/
spi_rv = SPI_execute_plan(qdesc->plan, argvalues, nulls,
- current_call_data->prodesc->fn_readonly, limit);
+ current_call_data->prodesc->fn_readonly, limit);
ret_hv = plperl_spi_execute_fetch_result(SPI_tuptable, SPI_processed,
spi_rv);
if (argc > 0)