diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-10 16:24:32 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-10 16:24:32 +0100 |
commit | 89711694a948df88cafe7574cdcb08fb6e5308fa (patch) | |
tree | b106aec1ed2d0b3df82b1f490fc530d6bb1511aa /src | |
parent | 698b03d48c675796792b0fdeaf03602f88e73cc0 (diff) | |
download | rspamd-89711694a948df88cafe7574cdcb08fb6e5308fa.tar.gz rspamd-89711694a948df88cafe7574cdcb08fb6e5308fa.zip |
Finally fix an issue with data isolation in sqlite.
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/sqlite_utils.c | 8 | ||||
-rw-r--r-- | src/libutil/sqlite_utils.h | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/libutil/sqlite_utils.c b/src/libutil/sqlite_utils.c index 5691be132..61ba49caf 100644 --- a/src/libutil/sqlite_utils.c +++ b/src/libutil/sqlite_utils.c @@ -156,6 +156,10 @@ rspamd_sqlite3_run_prstmt (sqlite3 *db, GArray *stmts, } } + if (!(nst->flags & RSPAMD_SQLITE3_STMT_MULTIPLE)) { + sqlite3_reset (stmt); + } + return SQLITE_OK; } else if (retcode != SQLITE_DONE) { @@ -163,6 +167,10 @@ rspamd_sqlite3_run_prstmt (sqlite3 *db, GArray *stmts, retcode, sqlite3_errmsg (db)); } + if (!(nst->flags & RSPAMD_SQLITE3_STMT_MULTIPLE)) { + sqlite3_reset (stmt); + } + return retcode; } diff --git a/src/libutil/sqlite_utils.h b/src/libutil/sqlite_utils.h index 18dd20a6f..3a8f81b18 100644 --- a/src/libutil/sqlite_utils.h +++ b/src/libutil/sqlite_utils.h @@ -29,6 +29,8 @@ #include "config.h" #include "sqlite3.h" +#define RSPAMD_SQLITE3_STMT_MULTIPLE (1 << 0) + struct rspamd_sqlite3_prstmt { gint idx; const gchar *sql; @@ -36,6 +38,7 @@ struct rspamd_sqlite3_prstmt { sqlite3_stmt *stmt; gint result; const gchar *ret; + gint flags; }; /** |