changeset 12736:b3cb10df15e6

pgsql: Added assert.
author Timo Sirainen <tss@iki.fi>
date Thu, 17 Feb 2011 08:58:43 +0200
parents 7d265040cd02
children db7abf4a29e5
files src/lib-sql/driver-pgsql.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-sql/driver-pgsql.c	Thu Feb 17 08:41:46 2011 +0200
+++ b/src/lib-sql/driver-pgsql.c	Thu Feb 17 08:58:43 2011 +0200
@@ -75,6 +75,8 @@
 
 static void driver_pgsql_set_state(struct pgsql_db *db, enum sql_db_state state)
 {
+	i_assert(state == SQL_DB_STATE_BUSY || db->cur_result == NULL);
+
 	/* switch back to original ioloop in case the caller wants to
 	   add/remove timeouts */
 	if (db->ioloop != NULL)