]> dgit.raspbian.org Git - nextcloud-desktop.git/commit
SqlQuery: Write NULL when intended #4548
authorChristian Kamm <mail@ckamm.de>
Tue, 15 Mar 2016 13:32:09 +0000 (14:32 +0100)
committerChristian Kamm <mail@ckamm.de>
Tue, 15 Mar 2016 13:38:31 +0000 (14:38 +0100)
commit7bd4f95b8c200e0fc2d5eff2bc5ab2428356a2ba
tree2bc8735ca2ea45c429b4d2f84b82569484a0caec
parent6e697bae9733ee054b931ec59a5aac6391dd6db0
SqlQuery: Write NULL when intended #4548

In SQLite bindings are not cleared by sqlite3_reset() calls, so
skipping a sqlite3_bind call to create a NULL value doesn't work,
instead the previous value will be written.

To fix this, I clear all bindings in SqlQuery::reset and make sure
to explicitly bind NULL when desired in SqlQuery::bind.

To make sure there's no confusion about SqlQuery::reset and
sqlite3_reset, I rename our method to reset_and_clear_bindings().
src/gui/socketapi.cpp
src/libsync/ownsql.cpp
src/libsync/ownsql.h
src/libsync/syncjournaldb.cpp