Skip to content

Commit 1787e82

Browse files
author
romankoshelev
committed
feat userver: support PQsendPipelineSync
commit_hash:398e6ddac4e063d70280adb586d1b9d29d962c71
1 parent 3de80e6 commit 1787e82

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

postgresql/src/storages/postgres/detail/pg_connection_wrapper.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#else
1111
auto PQXisBusy(PGconn* conn, const PGresult*) { return ::PQisBusy(conn); }
1212
auto PQXgetResult(PGconn* conn, const PGresult*) { return ::PQgetResult(conn); }
13-
int PQXpipelinePutSync(PGconn*) { return 0; }
1413
auto PQXsendQueryPrepared(PGconn* conn, const char* stmtName, int nParams, const char* const* paramValues, const int* paramLengths, const int* paramFormats, int resultFormat, PGresult*) {
1514
return ::PQsendQueryPrepared(conn, stmtName, nParams, paramValues, paramLengths, paramFormats, resultFormat);
1615
}
@@ -1020,7 +1019,13 @@ void PGConnectionWrapper::PutPipelineSync() {
10201019
#else
10211020
if (PQpipelineStatus(conn_) != PQ_PIPELINE_OFF) {
10221021
HandleSocketPostClose();
1022+
#if LIBPQ_HAS_SEND_PIPELINE_SYNC
1023+
CheckError<CommandError>("PQsendPipelineSync", PQsendPipelineSync(conn_));
1024+
#elif defined(USERVER_NO_LIBPQ_PATCHES)
1025+
CheckError<CommandError>("PQpipelineSync", PQpipelineSync(conn_));
1026+
#else
10231027
CheckError<CommandError>("PQXpipelinePutSync", PQXpipelinePutSync(conn_));
1028+
#endif
10241029
++pipeline_sync_counter_;
10251030
}
10261031
#endif

0 commit comments

Comments
 (0)