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

Commit22ef6b0

Browse files
committed
dblink: Change some StringInfo to StringInfoData
For consistency with other code and to avoid wasting some small amountof memory.From: Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com>
1 parentacaf7cc commit22ef6b0

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

‎contrib/dblink/dblink.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2721,13 +2721,15 @@ get_connect_string(const char *servername)
27212721
ForeignServer*foreign_server=NULL;
27222722
UserMapping*user_mapping;
27232723
ListCell*cell;
2724-
StringInfobuf=makeStringInfo();
2724+
StringInfoDatabuf;
27252725
ForeignDataWrapper*fdw;
27262726
AclResultaclresult;
27272727
char*srvname;
27282728

27292729
staticconstPQconninfoOption*options=NULL;
27302730

2731+
initStringInfo(&buf);
2732+
27312733
/*
27322734
* Get list of valid libpq options.
27332735
*
@@ -2769,7 +2771,7 @@ get_connect_string(const char *servername)
27692771
DefElem*def=lfirst(cell);
27702772

27712773
if (is_valid_dblink_option(options,def->defname,ForeignDataWrapperRelationId))
2772-
appendStringInfo(buf,"%s='%s' ",def->defname,
2774+
appendStringInfo(&buf,"%s='%s' ",def->defname,
27732775
escape_param_str(strVal(def->arg)));
27742776
}
27752777

@@ -2778,7 +2780,7 @@ get_connect_string(const char *servername)
27782780
DefElem*def=lfirst(cell);
27792781

27802782
if (is_valid_dblink_option(options,def->defname,ForeignServerRelationId))
2781-
appendStringInfo(buf,"%s='%s' ",def->defname,
2783+
appendStringInfo(&buf,"%s='%s' ",def->defname,
27822784
escape_param_str(strVal(def->arg)));
27832785
}
27842786

@@ -2788,11 +2790,11 @@ get_connect_string(const char *servername)
27882790
DefElem*def=lfirst(cell);
27892791

27902792
if (is_valid_dblink_option(options,def->defname,UserMappingRelationId))
2791-
appendStringInfo(buf,"%s='%s' ",def->defname,
2793+
appendStringInfo(&buf,"%s='%s' ",def->defname,
27922794
escape_param_str(strVal(def->arg)));
27932795
}
27942796

2795-
returnbuf->data;
2797+
returnbuf.data;
27962798
}
27972799
else
27982800
returnNULL;
@@ -2807,16 +2809,18 @@ static char *
28072809
escape_param_str(constchar*str)
28082810
{
28092811
constchar*cp;
2810-
StringInfobuf=makeStringInfo();
2812+
StringInfoDatabuf;
2813+
2814+
initStringInfo(&buf);
28112815

28122816
for (cp=str;*cp;cp++)
28132817
{
28142818
if (*cp=='\\'||*cp=='\'')
2815-
appendStringInfoChar(buf,'\\');
2816-
appendStringInfoChar(buf,*cp);
2819+
appendStringInfoChar(&buf,'\\');
2820+
appendStringInfoChar(&buf,*cp);
28172821
}
28182822

2819-
returnbuf->data;
2823+
returnbuf.data;
28202824
}
28212825

28222826
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp