First Commit
/ build_macos (push) Has been cancelled
/ build_windows (push) Has been cancelled
/ build_ubuntu (push) Has been cancelled

This commit is contained in:
dsutanto committed 2025-11-19 16:23:45 +07:00
commit dbdc5bcc4a
1791 files changed
+489451

No files matched your search

@@ -0,0 +1,25 @@
#include <pqxx/pipeline>
#include <pqxx/transaction>
#include "../test_helpers.hxx"
namespace
{
void test_cancel_query()
{
pqxx::connection conn;
pqxx::work tx{conn};
// Calling cancel_query() while none is in progress has no effect.
conn.cancel_query();
// Nothing much is guaranteed about cancel_query, except that it doesn't make
// the process die in flames.
pqxx::pipeline p{tx, "test_cancel_query"};
p.retain(0);
p.insert("SELECT pg_sleep(1)");
conn.cancel_query();
}
PQXX_REGISTER_TEST(test_cancel_query);
} // namespace