diff options
author | David Rowley <drowley@postgresql.org> | 2019-07-23 00:14:11 +1200 |
---|---|---|
committer | David Rowley <drowley@postgresql.org> | 2019-07-23 00:14:11 +1200 |
commit | 1e6a759838f7c104f3cd1fe6981a98780da4131b (patch) | |
tree | 47047d8991d0918b531fe71f38b637dc086c9ffa /contrib/postgres_fdw | |
parent | 19781729f789f3c6b2540e02b96f8aa500460322 (diff) | |
download | postgresql-1e6a759838f7c104f3cd1fe6981a98780da4131b.tar.gz postgresql-1e6a759838f7c104f3cd1fe6981a98780da4131b.zip |
Use appendBinaryStringInfo in more places where the length is known
When we already know the length that we're going to append, then it
makes sense to use appendBinaryStringInfo instead of
appendStringInfoString so that the append can be performed with a simple
memcpy() using a known length rather than having to first perform a
strlen() call to obtain the length.
Discussion: https://postgr.es/m/CAKJS1f8+FRAM1s5+mAa3isajeEoAaicJ=4e0WzrH3tAusbbiMQ@mail.gmail.com
Diffstat (limited to 'contrib/postgres_fdw')
-rw-r--r-- | contrib/postgres_fdw/deparse.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/postgres_fdw/deparse.c b/contrib/postgres_fdw/deparse.c index 548ae66119b..19f928ec598 100644 --- a/contrib/postgres_fdw/deparse.c +++ b/contrib/postgres_fdw/deparse.c @@ -1531,7 +1531,7 @@ deparseFromExprForRel(StringInfo buf, PlannerInfo *root, RelOptInfo *foreignrel, { Assert(fpinfo->jointype == JOIN_INNER); Assert(fpinfo->joinclauses == NIL); - appendStringInfoString(buf, join_sql_o.data); + appendBinaryStringInfo(buf, join_sql_o.data, join_sql_o.len); return; } } @@ -1552,7 +1552,7 @@ deparseFromExprForRel(StringInfo buf, PlannerInfo *root, RelOptInfo *foreignrel, { Assert(fpinfo->jointype == JOIN_INNER); Assert(fpinfo->joinclauses == NIL); - appendStringInfoString(buf, join_sql_i.data); + appendBinaryStringInfo(buf, join_sql_i.data, join_sql_i.len); return; } } |