diff options
| author | Bruce Momjian | 2014-05-06 16:12:18 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2014-05-06 16:12:18 +0000 |
| commit | 0a7832005792fa6dad171f9cadb8d587fe0dd800 (patch) | |
| tree | 365cfc42c521a52607e41394b08ef44d338d8fc1 /src/pl | |
| parent | fb85cd4320414c3f6e9c8bc69ec944200ae1e493 (diff) | |
pgindent run for 9.4
This includes removing tabs after periods in C comments, which was
applied to back branches, so this change should not effect backpatching.
Diffstat (limited to 'src/pl')
| -rw-r--r-- | src/pl/plperl/plperl.c | 17 | ||||
| -rw-r--r-- | src/pl/plpgsql/src/pl_comp.c | 24 | ||||
| -rw-r--r-- | src/pl/plpgsql/src/pl_exec.c | 66 | ||||
| -rw-r--r-- | src/pl/plpgsql/src/pl_funcs.c | 4 | ||||
| -rw-r--r-- | src/pl/plpgsql/src/pl_handler.c | 6 | ||||
| -rw-r--r-- | src/pl/plpgsql/src/pl_scanner.c | 8 | ||||
| -rw-r--r-- | src/pl/plpgsql/src/plpgsql.h | 12 | ||||
| -rw-r--r-- | src/pl/plpython/plpy_elog.c | 2 | ||||
| -rw-r--r-- | src/pl/plpython/plpy_exec.c | 2 | ||||
| -rw-r--r-- | src/pl/plpython/plpy_typeio.c | 8 | ||||
| -rw-r--r-- | src/pl/plpython/plpy_util.c | 6 | ||||
| -rw-r--r-- | src/pl/tcl/pltcl.c | 8 |
12 files changed, 86 insertions, 77 deletions
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c index ffdf634f55..d57189fe1e 100644 --- a/src/pl/plperl/plperl.c +++ b/src/pl/plperl/plperl.c @@ -62,8 +62,8 @@ PG_MODULE_MAGIC; /********************************************************************** - * Information associated with a Perl interpreter. We have one interpreter - * that is used for all plperlu (untrusted) functions. For plperl (trusted) + * Information associated with a Perl interpreter. We have one interpreter + * that is used for all plperlu (untrusted) functions. For plperl (trusted) * functions, there is a separate interpreter for each effective SQL userid. * (This is needed to ensure that an unprivileged user can't inject Perl code * that'll be executed with the privileges of some other SQL user.) @@ -99,7 +99,7 @@ typedef struct plperl_interp_desc * * The refcount field counts the struct's reference from the hash table shown * below, plus one reference for each function call level that is using the - * struct. We can release the struct, and the associated Perl sub, when the + * struct. We can release the struct, and the associated Perl sub, when the * refcount goes to zero. **********************************************************************/ typedef struct plperl_proc_desc @@ -254,8 +254,8 @@ static void plperl_event_trigger_handler(PG_FUNCTION_ARGS); static void free_plperl_function(plperl_proc_desc *prodesc); static plperl_proc_desc *compile_plperl_function(Oid fn_oid, - bool is_trigger, - bool is_event_trigger); + bool is_trigger, + bool is_event_trigger); static SV *plperl_hash_from_tuple(HeapTuple tuple, TupleDesc tupdesc); static SV *plperl_hash_from_datum(Datum attr); @@ -302,8 +302,8 @@ static char *setlocale_perl(int category, char *locale); static char * hek2cstr(HE *he) { - char *ret; - SV *sv; + char *ret; + SV *sv; /* * HeSVKEY_force will return a temporary mortal SV*, so we need to make @@ -707,6 +707,7 @@ plperl_init_interp(void) int nargs = 3; #ifdef WIN32 + /* * The perl library on startup does horrible things like call * setlocale(LC_ALL,""). We have protected against that on most platforms @@ -3055,7 +3056,7 @@ plperl_spi_execute_fetch_result(SPITupleTable *tuptable, int processed, /* * Note: plperl_return_next is called both in Postgres and Perl contexts. - * We report any errors in Postgres fashion (via ereport). If called in + * We report any errors in Postgres fashion (via ereport). If called in * Perl context, it is SPI.xs's responsibility to catch the error and * convert to a Perl error. We assume (perhaps without adequate justification) * that we need not abort the current transaction if the Perl code traps the diff --git a/src/pl/plpgsql/src/pl_comp.c b/src/pl/plpgsql/src/pl_comp.c index 12ac964d13..d2fd685c35 100644 --- a/src/pl/plpgsql/src/pl_comp.c +++ b/src/pl/plpgsql/src/pl_comp.c @@ -288,7 +288,7 @@ do_compile(FunctionCallInfo fcinfo, MemoryContext func_cxt; /* - * Setup the scanner input and error info. We assume that this function + * Setup the scanner input and error info. We assume that this function * cannot be invoked recursively, so there's no need to save and restore * the static variables used here. */ @@ -388,7 +388,7 @@ do_compile(FunctionCallInfo fcinfo, * needed permanently, so make them in tmp cxt. * * We also need to resolve any polymorphic input or output - * argument types. In validation mode we won't be able to, so we + * argument types. In validation mode we won't be able to, so we * arbitrarily assume we are dealing with integers. */ MemoryContextSwitchTo(compile_tmp_cxt); @@ -471,7 +471,7 @@ do_compile(FunctionCallInfo fcinfo, /* * If there's just one OUT parameter, out_param_varno points - * directly to it. If there's more than one, build a row that + * directly to it. If there's more than one, build a row that * holds all of them. */ if (num_out_args == 1) @@ -810,7 +810,7 @@ plpgsql_compile_inline(char *proc_source) int i; /* - * Setup the scanner input and error info. We assume that this function + * Setup the scanner input and error info. We assume that this function * cannot be invoked recursively, so there's no need to save and restore * the static variables used here. */ @@ -852,7 +852,11 @@ plpgsql_compile_inline(char *proc_source) function->out_param_varno = -1; /* set up for no OUT param */ function->resolve_option = plpgsql_variable_conflict; function->print_strict_params = plpgsql_print_strict_params; - /* don't do extra validation for inline code as we don't want to add spam at runtime */ + + /* + * don't do extra validation for inline code as we don't want to add spam + * at runtime + */ function->extra_warnings = 0; function->extra_errors = 0; @@ -1070,7 +1074,7 @@ plpgsql_post_column_ref(ParseState *pstate, ColumnRef *cref, Node *var) /* * If we find a record/row variable but can't match a field name, throw - * error if there was no core resolution for the ColumnRef either. In + * error if there was no core resolution for the ColumnRef either. In * that situation, the reference is inevitably going to fail, and * complaining about the record/row variable is likely to be more on-point * than the core parser's error message. (It's too bad we don't have @@ -1264,7 +1268,7 @@ resolve_column_ref(ParseState *pstate, PLpgSQL_expr *expr, /* * We should not get here, because a RECFIELD datum should * have been built at parse time for every possible qualified - * reference to fields of this record. But if we do, handle + * reference to fields of this record. But if we do, handle * it like field-not-found: throw error or return NULL. */ if (error_if_no_field) @@ -1871,7 +1875,7 @@ plpgsql_parse_cwordrowtype(List *idents) * * The returned struct may be a PLpgSQL_var, PLpgSQL_row, or * PLpgSQL_rec depending on the given datatype, and is allocated via - * palloc. The struct is automatically added to the current datum + * palloc. The struct is automatically added to the current datum * array, and optionally to the current namespace. */ PLpgSQL_variable * @@ -2325,7 +2329,7 @@ plpgsql_adddatum(PLpgSQL_datum *new) * last call. * * This is used around a DECLARE section to create a list of the VARs - * that have to be initialized at block entry. Note that VARs can also + * that have to be initialized at block entry. Note that VARs can also * be created elsewhere than DECLARE, eg by a FOR-loop, but it is then * the responsibility of special-purpose code to initialize them. * ---------- @@ -2482,7 +2486,7 @@ plpgsql_resolve_polymorphic_argtypes(int numargs, * delete_function - clean up as much as possible of a stale function cache * * We can't release the PLpgSQL_function struct itself, because of the - * possibility that there are fn_extra pointers to it. We can release + * possibility that there are fn_extra pointers to it. We can release * the subsidiary storage, but only if there are no active evaluations * in progress. Otherwise we'll just leak that storage. Since the * case would only occur if a pg_proc update is detected during a nested diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index 5d5439948b..69d1965253 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -56,7 +56,7 @@ typedef struct * creates its own "eval_econtext" ExprContext within this estate for * per-evaluation workspace. eval_econtext is freed at normal function exit, * and the EState is freed at transaction end (in case of error, we assume - * that the abort mechanisms clean it all up). Furthermore, any exception + * that the abort mechanisms clean it all up). Furthermore, any exception * block within a function has to have its own eval_econtext separate from * the containing function's, so that we can clean up ExprContext callbacks * properly at subtransaction exit. We maintain a stack that tracks the @@ -64,7 +64,7 @@ typedef struct * * This arrangement is a bit tedious to maintain, but it's worth the trouble * so that we don't have to re-prepare simple expressions on each trip through - * a function. (We assume the case to optimize is many repetitions of a + * a function. (We assume the case to optimize is many repetitions of a * function within a transaction.) * * However, there's no value in trying to amortize simple expression setup @@ -232,9 +232,9 @@ static Portal exec_dynquery_with_params(PLpgSQL_execstate *estate, const char *portalname, int cursorOptions); static char *format_expr_params(PLpgSQL_execstate *estate, - const PLpgSQL_expr *expr); + const PLpgSQL_expr *expr); static char *format_preparedparamsdata(PLpgSQL_execstate *estate, - const PreparedParamsData *ppd); + const PreparedParamsData *ppd); /* ---------- @@ -543,7 +543,7 @@ plpgsql_exec_trigger(PLpgSQL_function *func, * * We make the tupdescs available in both records even though only one may * have a value. This allows parsing of record references to succeed in - * functions that are used for multiple trigger types. For example, we + * functions that are used for multiple trigger types. For example, we * might have a test like "if (TG_OP = 'INSERT' and NEW.foo = 'xyz')", * which should parse regardless of the current trigger type. */ @@ -1226,7 +1226,7 @@ exec_stmt_block(PLpgSQL_execstate *estate, PLpgSQL_stmt_block *block) SPI_restore_connection(); /* - * Must clean up the econtext too. However, any tuple table made + * Must clean up the econtext too. However, any tuple table made * in the subxact will have been thrown away by SPI during subxact * abort, so we don't need to (and mustn't try to) free the * eval_tuptable. @@ -1630,7 +1630,7 @@ exec_stmt_getdiag(PLpgSQL_execstate *estate, PLpgSQL_stmt_getdiag *stmt) case PLPGSQL_GETDIAG_CONTEXT: { - char *contextstackstr = GetErrorContextStack(); + char *contextstackstr = GetErrorContextStack(); exec_assign_c_string(estate, var, contextstackstr); @@ -3335,7 +3335,7 @@ exec_stmt_execsql(PLpgSQL_execstate *estate, /* * Check for error, and set FOUND if appropriate (for historical reasons - * we set FOUND only for certain query types). Also Assert that we + * we set FOUND only for certain query types). Also Assert that we * identified the statement type the same as SPI did. */ switch (rc) @@ -3422,7 +3422,7 @@ exec_stmt_execsql(PLpgSQL_execstate *estate, { if (stmt->strict) { - char *errdetail; + char *errdetail; if (estate->func->print_strict_params) errdetail = format_expr_params(estate, expr); @@ -3441,7 +3441,7 @@ exec_stmt_execsql(PLpgSQL_execstate *estate, { if (n > 1 && (stmt->strict || stmt->mod_stmt)) { - char *errdetail; + char *errdetail; if (estate->func->print_strict_params) errdetail = format_expr_params(estate, expr); @@ -3614,7 +3614,7 @@ exec_stmt_dynexecute(PLpgSQL_execstate *estate, { if (stmt->strict) { - char *errdetail; + char *errdetail; if (estate->func->print_strict_params) errdetail = format_preparedparamsdata(estate, ppd); @@ -3633,7 +3633,7 @@ exec_stmt_dynexecute(PLpgSQL_execstate *estate, { if (n > 1 && stmt->strict) { - char *errdetail; + char *errdetail; if (estate->func->print_strict_params) errdetail = format_preparedparamsdata(estate, ppd); @@ -4073,7 +4073,7 @@ exec_assign_value(PLpgSQL_execstate *estate, var->datatype->typlen); /* - * Now free the old value. (We can't do this any earlier + * Now free the old value. (We can't do this any earlier * because of the possibility that we are assigning the var's * old value to it, eg "foo := foo". We could optimize out * the assignment altogether in such cases, but it's too @@ -4433,7 +4433,7 @@ exec_assign_value(PLpgSQL_execstate *estate, * At present this doesn't handle PLpgSQL_expr or PLpgSQL_arrayelem datums. * * NOTE: caller must not modify the returned value, since it points right - * at the stored value in the case of pass-by-reference datatypes. In some + * at the stored value in the case of pass-by-reference datatypes. In some * cases we have to palloc a return value, and in such cases we put it into * the estate's short-term memory context. */ @@ -4942,7 +4942,7 @@ exec_for_query(PLpgSQL_execstate *estate, PLpgSQL_stmt_forq *stmt, PinPortal(portal); /* - * Fetch the initial tuple(s). If prefetching is allowed then we grab a + * Fetch the initial tuple(s). If prefetching is allowed then we grab a * few more rows to avoid multiple trips through executor startup * overhead. */ @@ -5080,7 +5080,7 @@ loop_exit: * Because we only store one execution tree for a simple expression, we * can't handle recursion cases. So, if we see the tree is already busy * with an evaluation in the current xact, we just return FALSE and let the - * caller run the expression the hard way. (Other alternatives such as + * caller run the expression the hard way. (Other alternatives such as * creating a new tree for a recursive call either introduce memory leaks, * or add enough bookkeeping to be doubtful wins anyway.) Another case that * is covered by the expr_simple_in_use test is where a previous execution @@ -5308,7 +5308,7 @@ setup_param_list(PLpgSQL_execstate *estate, PLpgSQL_expr *expr) estate->cur_expr = expr; /* - * Also make sure this is set before parser hooks need it. There is + * Also make sure this is set before parser hooks need it. There is * no need to save and restore, since the value is always correct once * set. (Should be set already, but let's be sure.) */ @@ -5350,7 +5350,7 @@ plpgsql_param_fetch(ParamListInfo params, int paramid) /* * Do nothing if asked for a value that's not supposed to be used by this - * SQL expression. This avoids unwanted evaluations when functions such + * SQL expression. This avoids unwanted evaluations when functions such * as copyParamList try to materialize all the values. */ if (!bms_is_member(dno, expr->paramnos)) @@ -5684,7 +5684,7 @@ convert_value_to_string(PLpgSQL_execstate *estate, Datum value, Oid valtype) * * Note: the estate's eval_econtext is used for temporary storage, and may * also contain the result Datum if we have to do a conversion to a pass- - * by-reference data type. Be sure to do an exec_eval_cleanup() call when + * by-reference data type. Be sure to do an exec_eval_cleanup() call when * done with the result. * ---------- */ @@ -6216,7 +6216,7 @@ plpgsql_create_econtext(PLpgSQL_execstate *estate) /* * Create an EState for evaluation of simple expressions, if there's not - * one already in the current transaction. The EState is made a child of + * one already in the current transaction. The EState is made a child of * TopTransactionContext so it will have the right lifespan. * * Note that this path is never taken when executing a DO block; the @@ -6531,10 +6531,10 @@ static char * format_expr_params(PLpgSQL_execstate *estate, const PLpgSQL_expr *expr) { - int paramno; - int dno; + int paramno; + int dno; StringInfoData paramstr; - Bitmapset *tmpset; + Bitmapset *tmpset; if (!expr->paramnos) return NULL; @@ -6544,10 +6544,10 @@ format_expr_params(PLpgSQL_execstate *estate, paramno = 0; while ((dno = bms_first_member(tmpset)) >= 0) { - Datum paramdatum; - Oid paramtypeid; - bool paramisnull; - int32 paramtypmod; + Datum paramdatum; + Oid paramtypeid; + bool paramisnull; + int32 paramtypmod; PLpgSQL_var *curvar; curvar = (PLpgSQL_var *) estate->datums[dno]; @@ -6563,8 +6563,9 @@ format_expr_params(PLpgSQL_execstate *estate, appendStringInfoString(¶mstr, "NULL"); else { - char *value = convert_value_to_string(estate, paramdatum, paramtypeid); - char *p; + char *value = convert_value_to_string(estate, paramdatum, paramtypeid); + char *p; + appendStringInfoCharMacro(¶mstr, '\''); for (p = value; *p; p++) { @@ -6590,7 +6591,7 @@ static char * format_preparedparamsdata(PLpgSQL_execstate *estate, const PreparedParamsData *ppd) { - int paramno; + int paramno; StringInfoData paramstr; if (!ppd) @@ -6607,8 +6608,9 @@ format_preparedparamsdata(PLpgSQL_execstate *estate, appendStringInfoString(¶mstr, "NULL"); else { - char *value = convert_value_to_string(estate, ppd->values[paramno], ppd->types[paramno]); - char *p; + char *value = convert_value_to_string(estate, ppd->values[paramno], ppd->types[paramno]); + char *p; + appendStringInfoCharMacro(¶mstr, '\''); for (p = value; *p; p++) { diff --git a/src/pl/plpgsql/src/pl_funcs.c b/src/pl/plpgsql/src/pl_funcs.c index 430232c687..d6825e4634 100644 --- a/src/pl/plpgsql/src/pl_funcs.c +++ b/src/pl/plpgsql/src/pl_funcs.c @@ -25,7 +25,7 @@ * list or "chain" (from the youngest item to the root) is accessible from * any one plpgsql statement. During initial parsing of a function, ns_top * points to the youngest item accessible from the block currently being - * parsed. We store the entire tree, however, since at runtime we will need + * parsed. We store the entire tree, however, since at runtime we will need * to access the chain that's relevant to any one statement. * * Block boundaries in the namespace chain are marked by PLPGSQL_NSTYPE_LABEL @@ -113,7 +113,7 @@ plpgsql_ns_additem(int itemtype, int itemno, const char *name) * * If localmode is TRUE, only the topmost block level is searched. * - * name1 must be non-NULL. Pass NULL for name2 and/or name3 if parsing a name + * name1 must be non-NULL. Pass NULL for name2 and/or name3 if parsing a name * with fewer than three components. * * If names_used isn't NULL, *names_used receives the number of names diff --git a/src/pl/plpgsql/src/pl_handler.c b/src/pl/plpgsql/src/pl_handler.c index e659f8e289..e3e350c0f8 100644 --- a/src/pl/plpgsql/src/pl_handler.c +++ b/src/pl/plpgsql/src/pl_handler.c @@ -44,8 +44,8 @@ int plpgsql_variable_conflict = PLPGSQL_RESOLVE_ERROR; bool plpgsql_print_strict_params = false; -char *plpgsql_extra_warnings_string = NULL; -char *plpgsql_extra_errors_string = NULL; +char *plpgsql_extra_warnings_string = NULL; +char *plpgsql_extra_errors_string = NULL; int plpgsql_extra_warnings; int plpgsql_extra_errors; @@ -59,7 +59,7 @@ plpgsql_extra_checks_check_hook(char **newvalue, void **extra, GucSource source) char *rawstring; List *elemlist; ListCell *l; - int extrachecks = 0; + int extrachecks = 0; int *myextra; if (pg_strcasecmp(*newvalue, "all") == 0) diff --git a/src/pl/plpgsql/src/pl_scanner.c b/src/pl/plpgsql/src/pl_scanner.c index 19d96b75fc..6a5a04bc0c 100644 --- a/src/pl/plpgsql/src/pl_scanner.c +++ b/src/pl/plpgsql/src/pl_scanner.c @@ -44,7 +44,7 @@ IdentifierLookup plpgsql_IdentifierLookup = IDENTIFIER_LOOKUP_NORMAL; * * For the most part, the reserved keywords are those that start a PL/pgSQL * statement (and so would conflict with an assignment to a variable of the - * same name). We also don't sweat it much about reserving keywords that + * same name). We also don't sweat it much about reserving keywords that * are reserved in the core grammar. Try to avoid reserving other words. */ @@ -177,7 +177,7 @@ typedef struct /* * Scanner working state. At some point we might wish to fold all this - * into a YY_EXTRA struct. For the moment, there is no need for plpgsql's + * into a YY_EXTRA struct. For the moment, there is no need for plpgsql's * lexer to be re-entrant, and the notational burden of passing a yyscanner * pointer around is great enough to not want to do it without need. */ @@ -345,7 +345,7 @@ plpgsql_yylex(void) /* * Internal yylex function. This wraps the core lexer and adds one feature: - * a token pushback stack. We also make a couple of trivial single-token + * a token pushback stack. We also make a couple of trivial single-token * translations from what the core lexer does to what we want, in particular * interfacing from the core_YYSTYPE to YYSTYPE union. */ @@ -559,7 +559,7 @@ plpgsql_yyerror(const char *message) /* * If we have done any lookahead then flex will have restored the * character after the end-of-token. Zap it again so that we report - * only the single token here. This modifies scanbuf but we no longer + * only the single token here. This modifies scanbuf but we no longer * care about that. */ yytext[plpgsql_yyleng] = '\0'; diff --git a/src/pl/plpgsql/src/plpgsql.h b/src/pl/plpgsql/src/plpgsql.h index b4d1498e43..d6f31ffc63 100644 --- a/src/pl/plpgsql/src/plpgsql.h +++ b/src/pl/plpgsql/src/plpgsql.h @@ -668,7 +668,7 @@ typedef struct PLpgSQL_func_hashkey /* * For a trigger function, the OID of the relation triggered on is part of * the hash key --- we want to compile the trigger separately for each - * relation it is used with, in case the rowtype is different. Zero if + * relation it is used with, in case the rowtype is different. Zero if * not called as a trigger. */ Oid trigrelOid; @@ -740,8 +740,8 @@ typedef struct PLpgSQL_function bool print_strict_params; /* extra checks */ - int extra_warnings; - int extra_errors; + int extra_warnings; + int extra_errors; int ndatums; PLpgSQL_datum **datums; @@ -827,7 +827,7 @@ typedef struct PLpgSQL_execstate * * Also, immediately before any call to func_setup, PL/pgSQL fills in the * error_callback and assign_expr fields with pointers to its own - * plpgsql_exec_error_callback and exec_assign_expr functions. This is + * plpgsql_exec_error_callback and exec_assign_expr functions. This is * a somewhat ad-hoc expedient to simplify life for debugger plugins. */ @@ -890,8 +890,8 @@ extern bool plpgsql_print_strict_params; #define PLPGSQL_XCHECK_SHADOWVAR 1 #define PLPGSQL_XCHECK_ALL ((int) ~0) -extern int plpgsql_extra_warnings; -extern int plpgsql_extra_errors; +extern int plpgsql_extra_warnings; +extern int plpgsql_extra_errors; extern bool plpgsql_check_syntax; extern bool plpgsql_DumpExecTree; diff --git a/src/pl/plpython/plpy_elog.c b/src/pl/plpython/plpy_elog.c index 77cd4273ba..461d68c546 100644 --- a/src/pl/plpython/plpy_elog.c +++ b/src/pl/plpython/plpy_elog.c @@ -30,7 +30,7 @@ static char *get_source_line(const char *src, int lineno); /* * Emit a PG error or notice, together with any available info about * the current Python error, previously set by PLy_exception_set(). - * This should be used to propagate Python errors into PG. If fmt is + * This should be used to propagate Python errors into PG. If fmt is * NULL, the Python error becomes the primary error message, otherwise * it becomes the detail. If there is a Python traceback, it is put * in the context. diff --git a/src/pl/plpython/plpy_exec.c b/src/pl/plpython/plpy_exec.c index 74e2f3dadf..b6eb6f1f95 100644 --- a/src/pl/plpython/plpy_exec.c +++ b/src/pl/plpython/plpy_exec.c @@ -247,7 +247,7 @@ PLy_exec_trigger(FunctionCallInfo fcinfo, PLyProcedure *proc) Assert(CALLED_AS_TRIGGER(fcinfo)); /* - * Input/output conversion for trigger tuples. Use the result TypeInfo + * Input/output conversion for trigger tuples. Use the result TypeInfo * variable to store the tuple conversion info. We do this over again on * each call to cover the possibility that the relation's tupdesc changed * since the trigger was last called. PLy_input_tuple_funcs and diff --git a/src/pl/plpython/plpy_typeio.c b/src/pl/plpython/plpy_typeio.c index 7a5e581280..566cf6c0fe 100644 --- a/src/pl/plpython/plpy_typeio.c +++ b/src/pl/plpython/plpy_typeio.c @@ -377,7 +377,7 @@ PLy_output_datum_func2(PLyObToDatum *arg, HeapTuple typeTup) /* * Select a conversion function to convert Python objects to PostgreSQL - * datums. Most data types can go through the generic function. + * datums. Most data types can go through the generic function. */ switch (getBaseType(element_type ? element_type : arg->typoid)) { @@ -427,6 +427,7 @@ static void PLy_input_datum_func2(PLyDatumToOb *arg, Oid typeOid, HeapTuple typeTup) { Form_pg_type typeStruct = (Form_pg_type) GETSTRUCT(typeTup); + /* It's safe to handle domains of array types as its base array type. */ Oid element_type = get_base_element_type(typeOid); @@ -647,7 +648,7 @@ PLyList_FromArray(PLyDatumToOb *arg, Datum d) } /* - * Convert a Python object to a PostgreSQL bool datum. This can't go + * Convert a Python object to a PostgreSQL bool datum. This can't go * through the generic conversion function, because Python attaches a * Boolean value to everything, more things than the PostgreSQL bool * type can parse. @@ -809,7 +810,7 @@ static Datum PLySequence_ToArray(PLyObToDatum *arg, int32 typmod, PyObject *plrv) { ArrayType *array; - Datum rv; + Datum rv; int i; Datum *elems; bool *nulls; @@ -847,6 +848,7 @@ PLySequence_ToArray(PLyObToDatum *arg, int32 typmod, PyObject *plrv) lbs = 1; array = construct_md_array(elems, nulls, 1, &len, &lbs, get_base_element_type(arg->typoid), arg->elm->typlen, arg->elm->typbyval, arg->elm->typalign); + /* * If the result type is a domain of array, the resulting array must be * checked. diff --git a/src/pl/plpython/plpy_util.c b/src/pl/plpython/plpy_util.c index 88670e66d0..36958cb10f 100644 --- a/src/pl/plpython/plpy_util.c +++ b/src/pl/plpython/plpy_util.c @@ -55,7 +55,7 @@ PLy_free(void *ptr) /* * Convert a Python unicode object to a Python string/bytes object in - * PostgreSQL server encoding. Reference ownership is passed to the + * PostgreSQL server encoding. Reference ownership is passed to the * caller. */ PyObject * @@ -121,7 +121,7 @@ PLyUnicode_Bytes(PyObject *unicode) * function. The result is palloc'ed. * * Note that this function is disguised as PyString_AsString() when - * using Python 3. That function retuns a pointer into the internal + * using Python 3. That function retuns a pointer into the internal * memory of the argument, which isn't exactly the interface of this * function. But in either case you get a rather short-lived * reference that you ought to better leave alone. @@ -139,7 +139,7 @@ PLyUnicode_AsString(PyObject *unicode) #if PY_MAJOR_VERSION >= 3 /* * Convert a C string in the PostgreSQL server encoding to a Python - * unicode object. Reference ownership is passed to the caller. + * unicode object. Reference ownership is passed to the caller. */ PyObject * PLyUnicode_FromString(const char *s) diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c index 8c18d5ea20..a53cca4f27 100644 --- a/src/pl/tcl/pltcl.c +++ b/src/pl/tcl/pltcl.c @@ -208,8 +208,8 @@ static void pltcl_event_trigger_handler(PG_FUNCTION_ARGS, bool pltrusted); static void throw_tcl_error(Tcl_Interp *interp, const char *proname); static pltcl_proc_desc *compile_pltcl_function(Oid fn_oid, Oid tgreloid, - bool is_event_trigger, - bool pltrusted); + bool is_event_trigger, + bool pltrusted); static int pltcl_elog(ClientData cdata, Tcl_Interp *interp, int argc, CONST84 char *argv[]); @@ -855,7 +855,7 @@ pltcl_trigger_handler(PG_FUNCTION_ARGS, bool pltrusted) /* Find or compile the function */ prodesc = compile_pltcl_function(fcinfo->flinfo->fn_oid, RelationGetRelid(trigdata->tg_relation), - false, /* not an event trigger */ + false, /* not an event trigger */ pltrusted); pltcl_current_prodesc = prodesc; @@ -1607,7 +1607,7 @@ pltcl_elog(ClientData cdata, Tcl_Interp *interp, if (level == ERROR) { /* - * We just pass the error back to Tcl. If it's not caught, it'll + * We just pass the error back to Tcl. If it's not caught, it'll * eventually get converted to a PG error when we reach the call * handler. */ |
