X-Git-Url: http://sigaev.ru/git/gitweb.cgi?p=ftsbench.git;a=blobdiff_plain;f=pgdriver.c;fp=pgdriver.c;h=ed15a57f79b859974b6151b58e0ac3ee0219a670;hp=0a373b6e383ae577905c355c4809a2e120bf0915;hb=04bb53c0bccbe6936503cb32b4c80024a90f19c1;hpb=18b8e016bce54cca0bc8efb4f4252bd0b049605d diff --git a/pgdriver.c b/pgdriver.c index 0a373b6..ed15a57 100644 --- a/pgdriver.c +++ b/pgdriver.c @@ -260,7 +260,13 @@ execQuery(ftsDB* adb, char ** words, int flags) { fprintf(stderr, "Execution of prepared statement failed: %s\n", PQerrorMessage(db->conn)); exit(1); } + } else if ( PQntuples(res) == 1 ) { + db->db.nres += atoi( PQgetvalue(res,0,0) ); + } else { + fprintf(stderr,"Bad PQntuples %d\n", PQntuples(res)); + exit(1); } + PQclear(res); db->emptyquery = 0;