]> jfr.im git - irc/quakenet/newserv.git/blobdiff - pqsql/pqsql.c
Merge chanserv-live into default.
[irc/quakenet/newserv.git] / pqsql / pqsql.c
index 46a547ba2a343fa899e766504a37da677a1bb822..c2174da90c9e1e656dc25ec10fd036bca81f1d25 100644 (file)
@@ -188,14 +188,15 @@ void dbhandler(int fd, short revents) {
         if(queryhead->identifier != QH_ALREADYFIRED) {
           switch(PQresultStatus(res)) {
             case PGRES_TUPLES_OK:
-              Error("pqsql", ERR_WARNING, "Unhandled tuples output (query: %s)", queryhead->query);
+              if(!(queryhead->flags & DB_CALL))
+                Error("pqsql", ERR_WARNING, "Unhandled tuples output (query: %s)", queryhead->query);
               break;
 
             case PGRES_NONFATAL_ERROR:
             case PGRES_FATAL_ERROR:
               /* if a create query returns an error assume it went ok, paul will winge about this */
               if(!(queryhead->flags & DB_CREATE))
-                Error("pqsql", ERR_WARNING, "Unhandled error response (query: %s)", queryhead->query);
+                Error("pqsql", ERR_WARNING, "Unhandled error response (query: %s): %s", queryhead->query, PQresultErrorMessage(res));
               break;
          
             default:
@@ -307,7 +308,7 @@ void pqstartloadtable(PGconn *dbconn, void *arg)
     return;
   }
 
-  tablecrc=crc32(tli->tablename->content);
+  tablecrc=irc_crc32(tli->tablename->content);
   count=strtoul(PQgetvalue(res, 0, 0), NULL, 10);
   PQclear(res);