From d113bcb19375897c9437262ff50cd00779a71b35 Mon Sep 17 00:00:00 2001 From: Rahim Kanji Date: Thu, 24 Apr 2025 19:46:33 +0500 Subject: [PATCH] Use PG_EVENT_WRITE status for PgSQL --- lib/Base_Thread.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Base_Thread.cpp b/lib/Base_Thread.cpp index a70d119e4..d6ee97fe7 100644 --- a/lib/Base_Thread.cpp +++ b/lib/Base_Thread.cpp @@ -349,8 +349,13 @@ void Base_Thread::configure_pollout(DS * myds, unsigned int n) { } else { if (myds->DSS > STATE_MARIADB_BEGIN && myds->DSS < STATE_MARIADB_END) { thr->mypolls.fds[n].events = POLLIN; - if (thr->mypolls.myds[n]->myconn->async_exit_status & MYSQL_WAIT_WRITE) - thr->mypolls.fds[n].events |= POLLOUT; + if constexpr (std::is_same_v) { + if (thr->mypolls.myds[n]->myconn->async_exit_status & PG_EVENT_WRITE) + thr->mypolls.fds[n].events |= POLLOUT; + } else if constexpr (std::is_same_v) { + if (thr->mypolls.myds[n]->myconn->async_exit_status & MYSQL_WAIT_WRITE) + thr->mypolls.fds[n].events |= POLLOUT; + } } else { myds->set_pollout(); }