[dovecot-cvs] dovecot/src/lib-sql driver-mysql.c,1.16.2.2,1.16.2.3
cras at dovecot.org
cras at dovecot.org
Fri Jun 16 14:42:31 EEST 2006
- Previous message: [dovecot-cvs] dovecot/src/lib-ntlm ntlm-byteorder.h, 1.3,
1.4 ntlm-encrypt.c, 1.8, 1.9 ntlm-flags.h, 1.1,
1.2 ntlm-message.c, 1.9, 1.10 ntlm-types.h, 1.3, 1.4
- Next message: [dovecot-cvs] dovecot/src/lib-sql driver-mysql.c,1.18,1.19
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/lib/cvs/dovecot/src/lib-sql
In directory talvi:/tmp/cvs-serv1812
Modified Files:
Tag: branch_1_0
driver-mysql.c
Log Message:
Fixes to handling database updates.
Index: driver-mysql.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-sql/driver-mysql.c,v
retrieving revision 1.16.2.2
retrieving revision 1.16.2.3
diff -u -d -r1.16.2.2 -r1.16.2.3
--- driver-mysql.c 31 May 2006 11:02:45 -0000 1.16.2.2
+++ driver-mysql.c 16 Jun 2006 11:42:29 -0000 1.16.2.3
@@ -228,6 +228,12 @@
}
t_pop();
+#ifdef CLIENT_MULTI_STATEMENTS
+ /* Updates require this because everything is committed in one large
+ SQL statement. */
+ db->client_flags |= CLIENT_MULTI_STATEMENTS;
+#endif
+
if (array_count(&db->connections) == 0)
i_fatal("mysql: No hosts given in connect string");
}
@@ -393,7 +399,7 @@
case 1:
/* query ok */
result->result = mysql_store_result(conn->mysql);
- if (result->result != NULL)
+ if (result->result != NULL || mysql_errno(conn->mysql) == 0)
break;
/* fallback */
case -1:
@@ -422,11 +428,16 @@
{
struct mysql_result *result = (struct mysql_result *)_result;
+ if (result->result == NULL) {
+ /* no results */
+ return 0;
+ }
+
result->row = mysql_fetch_row(result->result);
if (result->row != NULL)
return 1;
- return mysql_errno(result->conn->mysql) ? -1 : 0;
+ return mysql_errno(result->conn->mysql) != 0 ? -1 : 0;
}
static void driver_mysql_result_fetch_fields(struct mysql_result *result)
- Previous message: [dovecot-cvs] dovecot/src/lib-ntlm ntlm-byteorder.h, 1.3,
1.4 ntlm-encrypt.c, 1.8, 1.9 ntlm-flags.h, 1.1,
1.2 ntlm-message.c, 1.9, 1.10 ntlm-types.h, 1.3, 1.4
- Next message: [dovecot-cvs] dovecot/src/lib-sql driver-mysql.c,1.18,1.19
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list