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
ea3d78aecf
Fix warning by using QByteArrayLiteral
...
Signed-off-by: Matthieu Gallien <matthieu_gallien@yahoo.fr>
2021-05-06 07:35:59 +00: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
Olivier Goffart
7e1840bb2f
OwnSql: Speedup by avoiding allocating an error string on success
2020-12-15 10:58:18 +01:00
Kevin Ottens
80cc196f6f
Enable bugprone-narrowing-conversions clang-tidy check
...
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-01 06:37:03 +00:00
Kevin Ottens
2f8c29082a
Enable the modernize-use-equals-default check on clang-tidy
...
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-13 14:19:42 +02: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
Camila San
3bae570f29
Do not declare local variables without an initial value.
...
Signed-off-by: Camila San <hello@camila.codes>
2020-06-03 07:50:40 +00:00
Kevin Ottens
712869db9a
Use auto to avoiding repeating type names
...
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-20 03:54:41 +02:00
Kevin Ottens
dea6ebaa35
Use nullptr when appropriate
...
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-05-20 02:21:26 +02:00
Dominique Fuchs
46e0a05078
Renamed conversion function to make intention more clear. Also defaulted to 'controlled truncation' to not stupidly crash. TBD/TODO: Better handling for such things.
...
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2019-09-08 02:20:24 +02:00
Dominique Fuchs
b4dee67bf5
Implemented Utility::convert function to convert size_t -> uint safely and on the fly. Often necessary for Qt and WIN32 functions. Using this will not generate compiler warnings of possible truncation. First call implemented in ownsql.cpp
...
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2019-09-08 02:04:50 +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
Tomaz Canabrava
d24a1e542e
Merge branch 'master' into clientSideEncryptionV3
2018-01-29 14:06:12 +01: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
Daniel Nicoletti
a63d34f870
Prepend "nextcloud" for all logging categories
...
Thus making easier to exclude logging from kio, qt
and only enable "nextcloud.*"
2017-12-28 17:33:10 -02:00
Christian Kamm
dcf0baa9de
Journal: 64bit inodes, fix storing uint64s generally
...
In addition to using the right function when retrieving inodes this
*also* fixes a more general bug ownsql had with storing uint64 values
that didn't fit into an int64.
2017-12-12 10:30:54 +01:00
Christian Kamm
820ebf4b6e
Sql: db close() failing isn't fatal
...
The assert was made fatal when looking at asserts for #5429 #5518
without having a particular problem in mind. Recent reports weakly
suggest that this might lead to occasional crashes for users when
sqlite_close fails in ways that look ignorable.
2017-11-14 12:10:19 +01:00
Christian Kamm
3608114ec1
Journal: Fix low-disk space errors
...
Fixes a regression from 4dbe9d4113
,
low disk space can lead to IOERR not just CANTOPEN.
2017-11-03 10:44:47 +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
Olivier Goffart
278129b286
OwnSQL: don't parse the error message when we are done
2017-09-26 11:03:23 +02:00
Jocelyn Turcotte
a1f1775d15
Move SyncJournalDB to src/common
2017-09-18 14:00:52 +02:00