aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/ri_triggers.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2019-07-23 00:14:11 +1200
committerDavid Rowley <drowley@postgresql.org>2019-07-23 00:14:11 +1200
commit1e6a759838f7c104f3cd1fe6981a98780da4131b (patch)
tree47047d8991d0918b531fe71f38b637dc086c9ffa /src/backend/utils/adt/ri_triggers.c
parent19781729f789f3c6b2540e02b96f8aa500460322 (diff)
downloadpostgresql-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 'src/backend/utils/adt/ri_triggers.c')
-rw-r--r--src/backend/utils/adt/ri_triggers.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c
index 44a6eef5bbf..8c895459c37 100644
--- a/src/backend/utils/adt/ri_triggers.c
+++ b/src/backend/utils/adt/ri_triggers.c
@@ -927,7 +927,7 @@ RI_FKey_cascade_upd(PG_FUNCTION_ARGS)
queryoids[i] = pk_type;
queryoids[j] = pk_type;
}
- appendStringInfoString(&querybuf, qualbuf.data);
+ appendBinaryStringInfo(&querybuf, qualbuf.data, qualbuf.len);
/* Prepare and save the plan */
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys * 2, queryoids,
@@ -1106,7 +1106,7 @@ ri_set(TriggerData *trigdata, bool is_set_null)
qualsep = "AND";
queryoids[i] = pk_type;
}
- appendStringInfoString(&querybuf, qualbuf.data);
+ appendBinaryStringInfo(&querybuf, qualbuf.data, qualbuf.len);
/* Prepare and save the plan */
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids,