diff options
Diffstat (limited to 'src/pl')
-rw-r--r-- | src/pl/plperl/expected/plperl_array.out | 8 | ||||
-rw-r--r-- | src/pl/plperl/sql/plperl_array.sql | 8 | ||||
-rw-r--r-- | src/pl/plpgsql/src/pl_exec.c | 14 | ||||
-rw-r--r-- | src/pl/plpgsql/src/pl_gram.y | 2 | ||||
-rw-r--r-- | src/pl/tcl/expected/pltcl_setup.out | 10 | ||||
-rw-r--r-- | src/pl/tcl/modules/pltcl_listmod.in | 4 | ||||
-rw-r--r-- | src/pl/tcl/modules/pltcl_loadmod.in | 4 | ||||
-rw-r--r-- | src/pl/tcl/sql/pltcl_setup.sql | 10 |
8 files changed, 28 insertions, 32 deletions
diff --git a/src/pl/plperl/expected/plperl_array.out b/src/pl/plperl/expected/plperl_array.out index efa884b359f..d21c84bd98a 100644 --- a/src/pl/plperl/expected/plperl_array.out +++ b/src/pl/plperl/expected/plperl_array.out @@ -72,7 +72,7 @@ CREATE OR REPLACE FUNCTION plperl_concat(TEXT[]) RETURNS TEXT AS $$ my $array_arg = shift; my $result = ""; my @arrays; - + push @arrays, @$array_arg; while (@arrays > 0) { my $el = shift @arrays; @@ -107,7 +107,7 @@ CREATE TYPE foo AS (bar INTEGER, baz TEXT); CREATE OR REPLACE FUNCTION plperl_array_of_rows(foo[]) RETURNS TEXT AS $$ my $array_arg = shift; my $result = ""; - + for my $row_ref (@$array_arg) { die "not a hash reference" unless (ref $row_ref eq "HASH"); $result .= $row_ref->{bar}." items of ".$row_ref->{baz}.";"; @@ -125,7 +125,7 @@ CREATE TYPE rowfoo AS (bar INTEGER, baz INTEGER[]); CREATE OR REPLACE FUNCTION plperl_sum_row_elements(rowfoo) RETURNS TEXT AS $$ my $row_ref = shift; my $result; - + if (ref $row_ref ne 'HASH') { $result = 0; } @@ -152,7 +152,7 @@ CREATE TYPE rowbar AS (foo rowfoo[]); CREATE OR REPLACE FUNCTION plperl_sum_array_of_rows(rowbar) RETURNS TEXT AS $$ my $rowfoo_ref = shift; my $result = 0; - + if (ref $rowfoo_ref eq 'HASH') { my $row_array_ref = $rowfoo_ref->{foo}; if (is_array_ref($row_array_ref)) { diff --git a/src/pl/plperl/sql/plperl_array.sql b/src/pl/plperl/sql/plperl_array.sql index 00314726459..66179294ce8 100644 --- a/src/pl/plperl/sql/plperl_array.sql +++ b/src/pl/plperl/sql/plperl_array.sql @@ -46,7 +46,7 @@ CREATE OR REPLACE FUNCTION plperl_concat(TEXT[]) RETURNS TEXT AS $$ my $array_arg = shift; my $result = ""; my @arrays; - + push @arrays, @$array_arg; while (@arrays > 0) { my $el = shift @arrays; @@ -68,7 +68,7 @@ CREATE TYPE foo AS (bar INTEGER, baz TEXT); CREATE OR REPLACE FUNCTION plperl_array_of_rows(foo[]) RETURNS TEXT AS $$ my $array_arg = shift; my $result = ""; - + for my $row_ref (@$array_arg) { die "not a hash reference" unless (ref $row_ref eq "HASH"); $result .= $row_ref->{bar}." items of ".$row_ref->{baz}.";"; @@ -84,7 +84,7 @@ CREATE TYPE rowfoo AS (bar INTEGER, baz INTEGER[]); CREATE OR REPLACE FUNCTION plperl_sum_row_elements(rowfoo) RETURNS TEXT AS $$ my $row_ref = shift; my $result; - + if (ref $row_ref ne 'HASH') { $result = 0; } @@ -109,7 +109,7 @@ CREATE TYPE rowbar AS (foo rowfoo[]); CREATE OR REPLACE FUNCTION plperl_sum_array_of_rows(rowbar) RETURNS TEXT AS $$ my $rowfoo_ref = shift; my $result = 0; - + if (ref $rowfoo_ref eq 'HASH') { my $row_array_ref = $rowfoo_ref->{foo}; if (is_array_ref($row_array_ref)) { diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index f9d7a049ab7..bc31fe90850 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -222,7 +222,7 @@ 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); @@ -3407,8 +3407,7 @@ exec_stmt_execsql(PLpgSQL_execstate *estate, ereport(ERROR, (errcode(ERRCODE_NO_DATA_FOUND), errmsg("query returned no rows"), - errdetail ? - errdetail_internal("parameters: %s", errdetail) : 0)); + errdetail ? errdetail_internal("parameters: %s", errdetail) : 0)); } /* set the target to NULL(s) */ exec_move_row(estate, rec, row, NULL, tuptab->tupdesc); @@ -3427,8 +3426,7 @@ exec_stmt_execsql(PLpgSQL_execstate *estate, ereport(ERROR, (errcode(ERRCODE_TOO_MANY_ROWS), errmsg("query returned more than one row"), - errdetail ? - errdetail_internal("parameters: %s", errdetail) : 0)); + errdetail ? errdetail_internal("parameters: %s", errdetail) : 0)); } /* Put the first result row into the target */ exec_move_row(estate, rec, row, tuptab->vals[0], tuptab->tupdesc); @@ -3601,8 +3599,7 @@ exec_stmt_dynexecute(PLpgSQL_execstate *estate, ereport(ERROR, (errcode(ERRCODE_NO_DATA_FOUND), errmsg("query returned no rows"), - errdetail ? - errdetail_internal("parameters: %s", errdetail) : 0)); + errdetail ? errdetail_internal("parameters: %s", errdetail) : 0)); } /* set the target to NULL(s) */ exec_move_row(estate, rec, row, NULL, tuptab->tupdesc); @@ -3621,8 +3618,7 @@ exec_stmt_dynexecute(PLpgSQL_execstate *estate, ereport(ERROR, (errcode(ERRCODE_TOO_MANY_ROWS), errmsg("query returned more than one row"), - errdetail ? - errdetail_internal("parameters: %s", errdetail) : 0)); + errdetail ? errdetail_internal("parameters: %s", errdetail) : 0)); } /* Put the first result row into the target */ diff --git a/src/pl/plpgsql/src/pl_gram.y b/src/pl/plpgsql/src/pl_gram.y index 51b8c5f46a6..f11228210df 100644 --- a/src/pl/plpgsql/src/pl_gram.y +++ b/src/pl/plpgsql/src/pl_gram.y @@ -185,7 +185,7 @@ static List *read_raise_options(void); %type <forvariable> for_variable %type <stmt> for_control -%type <str> any_identifier opt_block_label opt_label option_value +%type <str> any_identifier opt_block_label opt_label option_value %type <list> proc_sect proc_stmts stmt_elsifs stmt_else %type <loop_body> loop_body diff --git a/src/pl/tcl/expected/pltcl_setup.out b/src/pl/tcl/expected/pltcl_setup.out index 3f36a805252..c4cdb26bde8 100644 --- a/src/pl/tcl/expected/pltcl_setup.out +++ b/src/pl/tcl/expected/pltcl_setup.out @@ -38,7 +38,7 @@ create function check_pkey1_exists(int4, bpchar) returns bool as E' set GD(plan) [spi_prepare \\ "select 1 from T_pkey1 \\ where key1 = \\$1 and key2 = \\$2" \\ - {int4 bpchar}] + {int4 bpchar}] } set n [spi_execp -count 1 $GD(plan) [list $1 $2]] @@ -55,8 +55,8 @@ CREATE VIEW trigger_test_view AS SELECT * FROM trigger_test; CREATE FUNCTION trigger_data() returns trigger language pltcl as $_$ if { [info exists TG_relid] } { - set TG_relid "bogus:12345" - } + set TG_relid "bogus:12345" + } set dnames [info locals {[a-zA-Z]*} ] @@ -72,10 +72,10 @@ CREATE FUNCTION trigger_data() returns trigger language pltcl as $_$ set str "$str$akey: $val" } set str "$str}" - elog NOTICE "$key: $str" + elog NOTICE "$key: $str" } else { set val [eval list "\$$key" ] - elog NOTICE "$key: $val" + elog NOTICE "$key: $val" } } diff --git a/src/pl/tcl/modules/pltcl_listmod.in b/src/pl/tcl/modules/pltcl_listmod.in index 231cb3f316d..7d930ff0ea5 100644 --- a/src/pl/tcl/modules/pltcl_listmod.in +++ b/src/pl/tcl/modules/pltcl_listmod.in @@ -109,8 +109,8 @@ set conn [eval pg_connect $dbname $options] if {$i == $argc} { pg_select $conn "select distinct modname from pltcl_modules \ - order by modname" \ - MOD { + order by modname" \ + MOD { listmodule $conn $MOD(modname) } } else { diff --git a/src/pl/tcl/modules/pltcl_loadmod.in b/src/pl/tcl/modules/pltcl_loadmod.in index c26e2a229e3..645c6bbd9cf 100644 --- a/src/pl/tcl/modules/pltcl_loadmod.in +++ b/src/pl/tcl/modules/pltcl_loadmod.in @@ -84,7 +84,7 @@ proc __PLTcl_loadmod_check_table {conn tabname expnames exptypes} { set found 0 pg_select $conn "select C.relname, A.attname, A.attnum, T.typname \ - from pg_catalog.pg_class C, pg_catalog.pg_attribute A, pg_catalog.pg_type T \ + from pg_catalog.pg_class C, pg_catalog.pg_attribute A, pg_catalog.pg_type T \ where C.relname = '$tabname' \ and A.attrelid = C.oid \ and A.attnum > 0 \ @@ -449,7 +449,7 @@ proc __PLTcl_loadmod_load_modules {conn} { set srctext [string range $srctext 4000 end] pg_result [ \ - pg_exec $conn "insert into pltcl_modules values ( \ + pg_exec $conn "insert into pltcl_modules values ( \ '$xname', $i, '$xpart')" \ ] -clear incr i diff --git a/src/pl/tcl/sql/pltcl_setup.sql b/src/pl/tcl/sql/pltcl_setup.sql index df7f9fadd18..0ac6669c6ef 100644 --- a/src/pl/tcl/sql/pltcl_setup.sql +++ b/src/pl/tcl/sql/pltcl_setup.sql @@ -43,7 +43,7 @@ create function check_pkey1_exists(int4, bpchar) returns bool as E' set GD(plan) [spi_prepare \\ "select 1 from T_pkey1 \\ where key1 = \\$1 and key2 = \\$2" \\ - {int4 bpchar}] + {int4 bpchar}] } set n [spi_execp -count 1 $GD(plan) [list $1 $2]] @@ -65,8 +65,8 @@ CREATE VIEW trigger_test_view AS SELECT * FROM trigger_test; CREATE FUNCTION trigger_data() returns trigger language pltcl as $_$ if { [info exists TG_relid] } { - set TG_relid "bogus:12345" - } + set TG_relid "bogus:12345" + } set dnames [info locals {[a-zA-Z]*} ] @@ -82,10 +82,10 @@ CREATE FUNCTION trigger_data() returns trigger language pltcl as $_$ set str "$str$akey: $val" } set str "$str}" - elog NOTICE "$key: $str" + elog NOTICE "$key: $str" } else { set val [eval list "\$$key" ] - elog NOTICE "$key: $val" + elog NOTICE "$key: $val" } } |