mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
Fix whitespace issues found by git diff --check, add gitattributes
Set per file type attributes in .gitattributes to fine-tune whitespace checks. With the associated cleanups, the tree is now clean for git
This commit is contained in:
@@ -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)) {
|
||||
|
@@ -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)) {
|
||||
|
@@ -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 */
|
||||
|
@@ -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
|
||||
|
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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 {
|
||||
|
@@ -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
|
||||
|
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user