Mercurial > dovecot > core-2.2
comparison src/lib-sql/driver-sqlite.c @ 3947:5b21fb41d14d HEAD
Cleanups.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 27 Jan 2006 17:44:40 +0200 |
parents | d7051c7a0200 |
children | 1a98cb709395 |
comparison
equal
deleted
inserted
replaced
3946:d7051c7a0200 | 3947:5b21fb41d14d |
---|---|
3 #include "lib.h" | 3 #include "lib.h" |
4 #include "str.h" | 4 #include "str.h" |
5 #include "sql-api-private.h" | 5 #include "sql-api-private.h" |
6 | 6 |
7 #ifdef BUILD_SQLITE | 7 #ifdef BUILD_SQLITE |
8 #include <stdlib.h> | |
9 #include <time.h> | |
10 #include <sqlite3.h> | 8 #include <sqlite3.h> |
11 | 9 |
12 /* retry time if db is busy (in ms) */ | 10 /* retry time if db is busy (in ms) */ |
13 const int sqlite_busy_timeout = 1000; | 11 const int sqlite_busy_timeout = 1000; |
14 | 12 |
141 { | 139 { |
142 struct sqlite_result *result = (struct sqlite_result *)_result; | 140 struct sqlite_result *result = (struct sqlite_result *)_result; |
143 struct sqlite_db *db = (struct sqlite_db *) result->api.db; | 141 struct sqlite_db *db = (struct sqlite_db *) result->api.db; |
144 int rc; | 142 int rc; |
145 | 143 |
144 if (_result->callback) | |
145 return; | |
146 | |
146 if (result->stmt != NULL) { | 147 if (result->stmt != NULL) { |
147 if ((rc = sqlite3_finalize(result->stmt)) != SQLITE_OK) { | 148 if ((rc = sqlite3_finalize(result->stmt)) != SQLITE_OK) { |
148 i_warning("sqlite: finalize failed: %s (%d)", | 149 i_warning("sqlite: finalize failed: %s (%d)", |
149 sqlite3_errmsg(db->sqlite), rc); | 150 sqlite3_errmsg(db->sqlite), rc); |
150 } | 151 } |