Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf99a569

Browse files
committed
pgindent run for 8.2.
1 parent451e419 commitf99a569

File tree

522 files changed

+21508
-17381
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

522 files changed

+21508
-17381
lines changed

‎contrib/adminpack/adminpack.c

Lines changed: 93 additions & 85 deletions
Large diffs are not rendered by default.

‎contrib/cube/cube.c

Lines changed: 129 additions & 110 deletions
Large diffs are not rendered by default.

‎contrib/dblink/dblink.c

Lines changed: 67 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Darko Prenosil <Darko.Prenosil@finteh.hr>
99
* Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
1010
*
11-
* $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.58 2006/09/02 21:11:15 joe Exp $
11+
* $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.59 2006/10/04 00:29:44 momjian Exp $
1212
* Copyright (c) 2001-2006, PostgreSQL Global Development Group
1313
* ALL RIGHTS RESERVED;
1414
*
@@ -362,11 +362,11 @@ dblink_open(PG_FUNCTION_ARGS)
362362
DBLINK_RES_INTERNALERROR("begin error");
363363
PQclear(res);
364364
rconn->newXactForCursor= TRUE;
365+
365366
/*
366367
* Since transaction state was IDLE, we force cursor count to
367-
* initially be 0. This is needed as a previous ABORT might
368-
* have wiped out our transaction without maintaining the
369-
* cursor count for us.
368+
* initially be 0. This is needed as a previous ABORT might have wiped
369+
* out our transaction without maintaining the cursor count for us.
370370
*/
371371
rconn->openCursorCount=0;
372372
}
@@ -621,8 +621,8 @@ dblink_fetch(PG_FUNCTION_ARGS)
621621
if (PQnfields(res)!=tupdesc->natts)
622622
ereport(ERROR,
623623
(errcode(ERRCODE_DATATYPE_MISMATCH),
624-
errmsg("remote query result rowtype does not match "
625-
"the specified FROM clause rowtype")));
624+
errmsg("remote query result rowtype does not match "
625+
"the specified FROM clause rowtype")));
626626

627627
/* fast track when no results */
628628
if (funcctx->max_calls<1)
@@ -827,7 +827,7 @@ dblink_record_internal(FunctionCallInfo fcinfo, bool is_async, bool do_get)
827827

828828
if (!res||
829829
(PQresultStatus(res)!=PGRES_COMMAND_OK&&
830-
PQresultStatus(res)!=PGRES_TUPLES_OK))
830+
PQresultStatus(res)!=PGRES_TUPLES_OK))
831831
{
832832
if (fail)
833833
DBLINK_RES_ERROR("sql error");
@@ -839,33 +839,33 @@ dblink_record_internal(FunctionCallInfo fcinfo, bool is_async, bool do_get)
839839
SRF_RETURN_DONE(funcctx);
840840
}
841841
}
842-
842+
843843
if (PQresultStatus(res)==PGRES_COMMAND_OK)
844844
{
845845
is_sql_cmd= true;
846-
846+
847847
/* need a tuple descriptor representing one TEXT column */
848848
tupdesc=CreateTemplateTupleDesc(1, false);
849849
TupleDescInitEntry(tupdesc, (AttrNumber)1,"status",
850-
TEXTOID,-1,0);
851-
850+
TEXTOID,-1,0);
851+
852852
/*
853-
* and save a copy of the command status string to return as our
854-
* result tuple
855-
*/
853+
* and save a copy of the command status string to return as
854+
* our result tuple
855+
*/
856856
sql_cmd_status=PQcmdStatus(res);
857857
funcctx->max_calls=1;
858858
}
859859
else
860860
funcctx->max_calls=PQntuples(res);
861-
861+
862862
/* got results, keep track of them */
863863
funcctx->user_fctx=res;
864-
864+
865865
/* if needed, close the connection to the database and cleanup */
866866
if (freeconn)
867867
PQfinish(conn);
868-
868+
869869
if (!is_sql_cmd)
870870
{
871871
/* get a tuple descriptor for our result type */
@@ -878,38 +878,41 @@ dblink_record_internal(FunctionCallInfo fcinfo, bool is_async, bool do_get)
878878
/* failed to determine actual type of RECORD */
879879
ereport(ERROR,
880880
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
881-
errmsg("function returning record called in context "
882-
"that cannot accept type record")));
881+
errmsg("function returning record called in context "
882+
"that cannot accept type record")));
883883
break;
884884
default:
885885
/* result type isn't composite */
886886
elog(ERROR,"return type must be a row type");
887887
break;
888888
}
889-
889+
890890
/* make sure we have a persistent copy of the tupdesc */
891891
tupdesc=CreateTupleDescCopy(tupdesc);
892892
}
893-
894-
/* check result and tuple descriptor have the same number of columns */
893+
894+
/*
895+
* check result and tuple descriptor have the same number of
896+
* columns
897+
*/
895898
if (PQnfields(res)!=tupdesc->natts)
896899
ereport(ERROR,
897900
(errcode(ERRCODE_DATATYPE_MISMATCH),
898-
errmsg("remote query result rowtype does not match "
899-
"the specified FROM clause rowtype")));
900-
901+
errmsg("remote query result rowtype does not match "
902+
"the specified FROM clause rowtype")));
903+
901904
/* fast track when no results */
902905
if (funcctx->max_calls<1)
903906
{
904907
if (res)
905908
PQclear(res);
906909
SRF_RETURN_DONE(funcctx);
907910
}
908-
911+
909912
/* store needed metadata for subsequent calls */
910913
attinmeta=TupleDescGetAttInMetadata(tupdesc);
911914
funcctx->attinmeta=attinmeta;
912-
915+
913916
MemoryContextSwitchTo(oldcontext);
914917
}
915918
else
@@ -991,9 +994,9 @@ PG_FUNCTION_INFO_V1(dblink_get_connections);
991994
Datum
992995
dblink_get_connections(PG_FUNCTION_ARGS)
993996
{
994-
HASH_SEQ_STATUSstatus;
995-
remoteConnHashEnt*hentry;
996-
ArrayBuildState*astate=NULL;
997+
HASH_SEQ_STATUSstatus;
998+
remoteConnHashEnt*hentry;
999+
ArrayBuildState*astate=NULL;
9971000

9981001
if (remoteConnHash)
9991002
{
@@ -1019,19 +1022,19 @@ dblink_get_connections(PG_FUNCTION_ARGS)
10191022
*
10201023
* Returns 1 if the connection is busy, 0 otherwise
10211024
* Params:
1022-
*text connection_name - name of the connection to check
1023-
*
1025+
*text connection_name - name of the connection to check
1026+
*
10241027
*/
10251028
PG_FUNCTION_INFO_V1(dblink_is_busy);
10261029
Datum
10271030
dblink_is_busy(PG_FUNCTION_ARGS)
10281031
{
1029-
char*msg;
1030-
PGconn*conn=NULL;
1031-
char*conname=NULL;
1032-
char*connstr=NULL;
1033-
remoteConn*rconn=NULL;
1034-
boolfreeconn= false;
1032+
char*msg;
1033+
PGconn*conn=NULL;
1034+
char*conname=NULL;
1035+
char*connstr=NULL;
1036+
remoteConn*rconn=NULL;
1037+
boolfreeconn= false;
10351038

10361039
DBLINK_INIT;
10371040
DBLINK_GET_CONN;
@@ -1045,27 +1048,27 @@ dblink_is_busy(PG_FUNCTION_ARGS)
10451048
/*
10461049
* Cancels a running request on a connection
10471050
*
1048-
* Returns text:
1051+
* Returns text:
10491052
*"OK" if the cancel request has been sent correctly,
1050-
*an error message otherwise
1051-
*
1053+
*an error message otherwise
1054+
*
10521055
* Params:
1053-
*text connection_name - name of the connection to check
1054-
*
1056+
*text connection_name - name of the connection to check
1057+
*
10551058
*/
10561059
PG_FUNCTION_INFO_V1(dblink_cancel_query);
10571060
Datum
10581061
dblink_cancel_query(PG_FUNCTION_ARGS)
10591062
{
1060-
char*msg;
1061-
intres=0;
1062-
PGconn*conn=NULL;
1063-
char*conname=NULL;
1064-
char*connstr=NULL;
1065-
remoteConn*rconn=NULL;
1066-
boolfreeconn= false;
1067-
PGcancel*cancel;
1068-
charerrbuf[256];
1063+
char*msg;
1064+
intres=0;
1065+
PGconn*conn=NULL;
1066+
char*conname=NULL;
1067+
char*connstr=NULL;
1068+
remoteConn*rconn=NULL;
1069+
boolfreeconn= false;
1070+
PGcancel*cancel;
1071+
charerrbuf[256];
10691072

10701073
DBLINK_INIT;
10711074
DBLINK_GET_CONN;
@@ -1077,7 +1080,7 @@ dblink_cancel_query(PG_FUNCTION_ARGS)
10771080
PQfreeCancel(cancel);
10781081

10791082
if (res==0)
1080-
PG_RETURN_TEXT_P(GET_TEXT("OK"));
1083+
PG_RETURN_TEXT_P(GET_TEXT("OK"));
10811084
else
10821085
PG_RETURN_TEXT_P(GET_TEXT(errbuf));
10831086
}
@@ -1086,23 +1089,23 @@ dblink_cancel_query(PG_FUNCTION_ARGS)
10861089
/*
10871090
* Get error message from a connection
10881091
*
1089-
* Returns text:
1092+
* Returns text:
10901093
*"OK" if no error, an error message otherwise
1091-
*
1094+
*
10921095
* Params:
1093-
*text connection_name - name of the connection to check
1094-
*
1096+
*text connection_name - name of the connection to check
1097+
*
10951098
*/
10961099
PG_FUNCTION_INFO_V1(dblink_error_message);
10971100
Datum
10981101
dblink_error_message(PG_FUNCTION_ARGS)
10991102
{
1100-
char*msg;
1101-
PGconn*conn=NULL;
1102-
char*conname=NULL;
1103-
char*connstr=NULL;
1104-
remoteConn*rconn=NULL;
1105-
boolfreeconn= false;
1103+
char*msg;
1104+
PGconn*conn=NULL;
1105+
char*conname=NULL;
1106+
char*connstr=NULL;
1107+
remoteConn*rconn=NULL;
1108+
boolfreeconn= false;
11061109

11071110
DBLINK_INIT;
11081111
DBLINK_GET_CONN;
@@ -1859,7 +1862,7 @@ get_sql_delete(Oid relid, int2vector *pkattnums, int16 pknumatts, char **tgt_pka
18591862
char*relname;
18601863
TupleDesctupdesc;
18611864
intnatts;
1862-
StringInfoDatabuf;
1865+
StringInfoDatabuf;
18631866
inti;
18641867

18651868
initStringInfo(&buf);

‎contrib/hstore/hstore.h

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,42 @@
1111
#include"storage/bufpage.h"
1212

1313

14-
typedefstruct {
15-
uint16keylen;
16-
uint16vallen;
17-
uint32
18-
valisnull:1,
19-
pos:31;
20-
}HEntry;
21-
22-
23-
typedefstruct {
24-
int4len;
25-
int4size;
26-
chardata[1];
27-
}HStore;
14+
typedefstruct
15+
{
16+
uint16keylen;
17+
uint16vallen;
18+
uint32
19+
valisnull:1,
20+
pos:31;
21+
}HEntry;
22+
23+
24+
typedefstruct
25+
{
26+
int4len;
27+
int4size;
28+
chardata[1];
29+
}HStore;
2830

2931
#defineHSHRDSIZE(2*sizeof(int4))
3032
#defineCALCDATASIZE(x,lenstr) ( (x) * sizeof(HEntry) + HSHRDSIZE + (lenstr) )
31-
#defineARRPTR(x)( (HEntry*) ( (char*)(x) + HSHRDSIZE ) )
32-
#defineSTRPTR(x)( (char*)(x) + HSHRDSIZE + ( sizeof(HEntry) * ((HStore*)x)->size ) )
33+
#defineARRPTR(x)( (HEntry*) ( (char*)(x) + HSHRDSIZE ) )
34+
#defineSTRPTR(x)( (char*)(x) + HSHRDSIZE + ( sizeof(HEntry) * ((HStore*)x)->size ) )
3335

3436

35-
#definePG_GETARG_HS(x)((HStore*)PG_DETOAST_DATUM(PG_GETARG_DATUM(x)))
37+
#definePG_GETARG_HS(x)((HStore*)PG_DETOAST_DATUM(PG_GETARG_DATUM(x)))
3638

37-
typedefstruct {
38-
char*key;
39-
char*val;
40-
uint16keylen;
41-
uint16vallen;
42-
boolisnull;
43-
boolneedfree;
44-
}Pairs;
39+
typedefstruct
40+
{
41+
char*key;
42+
char*val;
43+
uint16keylen;
44+
uint16vallen;
45+
boolisnull;
46+
boolneedfree;
47+
}Pairs;
4548

46-
intcomparePairs(constvoid*a,constvoid*b);
47-
intuniquePairs(Pairs*a,int4l,int4*buflen);
49+
intcomparePairs(constvoid*a,constvoid*b);
50+
intuniquePairs(Pairs*a,int4l,int4*buflen);
4851

4952
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp