From 85d151abd0f607178d4fdec95e61fec30769bfa3 Mon Sep 17 00:00:00 2001 From: randomdan Date: Mon, 14 Feb 2011 01:14:00 +0000 Subject: Fixes to compile with all gcc warnings as errors Fixes to keep uuid impl choice entirely within uuid class Fix to collect all text in xslRows Error in unhandled compares Add support for no change check in PQ connector Move dumptask in p2console, soon to be removed Fix variable creation code to set type correctly --- libpqpp/modifycommand.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libpqpp/modifycommand.cpp') diff --git a/libpqpp/modifycommand.cpp b/libpqpp/modifycommand.cpp index 14bfb16..ae7abeb 100644 --- a/libpqpp/modifycommand.cpp +++ b/libpqpp/modifycommand.cpp @@ -1,4 +1,5 @@ #include "modifycommand.h" +#include "error.h" #include #include "connection.h" @@ -18,9 +19,12 @@ PQ::ModifyCommand::execute(bool anc) { prepare(); PGresult * res = PQexecPrepared(c->conn, stmntName.c_str(), values.size(), &values.front(), &lengths.front(), &formats.front(), 0); - c->checkResult(res, PGRES_COMMAND_OK, __PRETTY_FUNCTION__); + c->checkResult(res, PGRES_COMMAND_OK); unsigned int rows = atoi(PQcmdTuples(res)); PQclear(res); + if (rows == 0 && !anc) { + throw Error("No rows affected"); + } return rows; } -- cgit v1.2.3