[dovecot-cvs] dovecot/src/lib-sql driver-mysql.c,1.2,1.3
cras at dovecot.org
cras at dovecot.org
Fri Jan 7 16:39:24 EET 2005
Update of /var/lib/cvs/dovecot/src/lib-sql
In directory talvi:/tmp/cvs-serv8869
Modified Files:
driver-mysql.c
Log Message:
Check if mysql_fetch_row() returns error.
Index: driver-mysql.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-sql/driver-mysql.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- driver-mysql.c 1 Nov 2004 12:18:04 -0000 1.2
+++ driver-mysql.c 7 Jan 2005 14:39:22 -0000 1.3
@@ -236,9 +236,13 @@
static int driver_mysql_result_next_row(struct sql_result *_result)
{
struct mysql_result *result = (struct mysql_result *)_result;
+ struct mysql_db *db = (struct mysql_db *)_result->db;
result->row = mysql_fetch_row(result->result);
- return result->row != NULL;
+ if (result->row != NULL)
+ return 1;
+
+ return mysql_errno(db->mysql) ? -1 : 0;
}
static void driver_mysql_result_fetch_fields(struct mysql_result *result)
More information about the dovecot-cvs
mailing list