1
0
Fork 0
Commit Graph

14 Commits

Author SHA1 Message Date
Hannah von Reth de2d11125b Move Prepared sql queries to seperate class to manage access 2021-08-23 09:40:26 +02:00
Hannah von Reth 3b99b11849 Always reset prepared sql statements
This allow the creation of checkpoints and fixes the growing wal issue

Fixes: #7646
2021-08-11 17:13:44 +00:00
Hannah von Reth f977a54694 Finish is already called in the destructor 2021-08-11 17:13:44 +00:00
allexzander 4d66d209bc Fix incorrect logger output for non-latin strings.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-02-16 09:30:08 +02:00
Hannah von Reth 563b347567
csync: apply strict QString handling 2020-12-15 10:59:16 +01:00
Hannah von Reth 29c6f44124
Logging: Print enum before cast in SqlQuer::bindValue 2020-12-15 10:59:15 +01:00
Christian Kamm 4bd062f5be
OwnSql: Distinguish no-data from error #6677
This could fix a problem where the client incorrectly decides to delete
local data.

Previously any sqlite3_step() return value that wasn't SQLITE_ROW would
be interpreted as "there's no more data here". Thus an sqlite error at a
bad time could cause the remote discovery to fail to read an unchanged
subtree from the database. These files would then be deleted locally.

With this change sqlite errors from sqlite3_step are detected and
logged. For the particular case of SyncJournalDb::getFilesBelowPath()
the error will now be propagated and the sync run will fail instead of
performing spurious deletes.

Note that many other database functions still don't distinguish
not-found from error cases. Most of them won't have as severe effects on
affected sync runs though.
2020-12-15 10:58:43 +01:00
Kevin Ottens e3e262e42e Use default member init when applicable
This also fixes a couple of warnings at places (out of order init for
instance) and a potential bug in the webflow credentials / qtkeychain
integration.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-03 16:10:39 +02:00
Olivier Goffart d114212333
OwnSql: Fixup after feedback for #6388 2018-07-03 10:33:26 +02:00
Olivier Goffart 779969f865
OwnSql: Put the SQL queries next to their use.
This avoid haivng to modify 4 places when we want to add a query
2018-07-03 10:33:26 +02:00
Olivier Goffart 518fb90757
OwnSql: Some refactoring
Use QByteArray for the query so we don't have to convert twice.
Automatically finish the query when the DB close, so we don't
have to call reset
2018-07-03 10:33:26 +02:00
Olivier Goffart 776bbbf7b1 Don't include sqlite3.h from headers
So that sqlite is not part of the public interface of csync
(and that the sqlite include path don't need to be passed when compiling
libsync or gui)
2018-01-13 13:58:17 +01:00
Christian Kamm 4dbe9d4113 Journal: Don't crash if the db file is readonly #6050
Surprisingly sqlite3_open_v2() returns ok on readonly files with
SQLITE_OPEN_READWRITE. Probably due to the journal mode?
2017-11-02 16:36:51 +01:00
Jocelyn Turcotte a1f1775d15 Move SyncJournalDB to src/common 2017-09-18 14:00:52 +02:00