It move the magic number of column results to the sql statement
and improves the mock a little bit.
Change-Id: I101067444cf27ec5dea0c72de7fd484a7e8710f0
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Session are captured by hooking in the sqlite changes. They are saved in
blobs and containing inserts, update and deletes. Because the are
semantically coupled to translactions we add a
Change-Id: Ie095558ebc50601fcaae32958ebeeb98b72d73b9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This can be always happen for write statements. It fixes the wrong behavior
of the transaction that it tried to rollback if begin fails. If begin fails
the transaction never started so there is nothing to rollback.
Change-Id: I8a03162257fa22a0bb66ccb844f90c6afbc7db64
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Fixes coverity warning. We want to throw an exception in the destructor
in this case, which is save because it is a RAII pattern and holds
only trivial values. Actually this is the only way to communicate that
rollback was failing. It is quite rare that it will be happen without an
exception is already thrown.
There is a non throwing variant too if you want to use it as a class
member.
Change-Id: Ie71ead19678619465c6ad9334d36ee666225dce7
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This patch has grown in a quite big change set and it is really hard to
divide it in different parts.
V2::ProjectPartContainer is now using FileIds instead of file paths. This
cleans code up because it is a big step in the direction that internally
only file ids are used. But it is depending on the file cache, so the
file cache has to be provided as an argument. There is now an interface for
transactions too which are ease the testing of them and enables the support
of preprocessor. It adds macros as symbols and is saving used macros. The
used macro support is enabling update improvements because only if a
changed macro is used it needs to be recompiled. This is still in flux
and can be changed in later patches.
Change-Id: I492a2c9af1201d40fdd9f46a0045f7878bbbaa3d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
If you use the database in a multi-threaded environment, you must always
your statements in transactions.
For read-only statements, you use DeferredTransaction and write statements
you use ImmediateTransaction. If you mix read and write statements you have
to use ImmediateTransaction. Don't use DeferredTransaction because it leads
to undefined behavior.
Change-Id: Ida298a20f33423c8da09e768a7b658dd8e918f46
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>