The error message is not exactly "Failed to open: $name", so just check
that it contains the expected backend file name, this is enough.
Note that this test still stays disabled, as it always was for not
really clear reasons.
There were multiple problems with calling unload_all() from the static
object destructor:
1. Under Windows, this is explicitly disallowed when the destructor is
executed under the global loader lock, which is the case when SOCI is
built as a shared library, so never do it there.
2. Under Unix, this could result in unloading the core library itself,
containing unload_all() code, if SOCI core was dynamically loaded
using dlopen() or was linked in a usual way into another shared
library which was loading with dlopen(), i.e. any kind of plugin.
Fix this by simply not trying to unload the backends automatically from
a global object destructor and document that unload_all() must be called
if it is really important to unload them.
Also mention unload(), which previously didn't appear in the
documentation at all, just like unload_all().
CI jobs always tested building SOCI with a single backend enabled, so we
would never detect any potential problems due to using multiple backends
at once. We also had a completely unused scripts/ci/build_all.sh which
was confusing.
Solve both problems at once by starting to use this script instead of
using "empty" backend for the job testing release packaging. This is
more realistic too.
Most of the changes here just move the release packaging fragment from
build_empty.sh to build_all.sh, so it is recommended to view this commit
with Git --color-moved option.
This test was checking for thread-safety but was itself using in a
MT-unsafe way as it used Catch assertion macro from a thread without any
locking.
This could corrupt Catch internal state and crash, as it did in recently
re-enable AppVeyor CI tests.
Fix this by just storing the error messages in the test threads and
using Catch macros from the main thread only.
This fixes a problem introduced in ec00b69a (Amendments to the parent
commit, changing SQLite timeout setting, 2025-05-17).
See #1254.
This makes this backend more consistent with the other ones and fixes an
error in unit tests when using SQL Server introduced by da494153 (Fix
behaviour of fetch() without any data with PostgreSQL, 2026-02-06) and
which went unnoticed for a long time due to the problem fixed in the
parent commit.
This was broken by 2890781e (Simplify CMake configuration command used
under AppVeyor, 2025-06-13) which didn't change the current directory to
the build directory any longer and went unnoticed for a long, long time.
Specify the build directory explicitly when running ctest to fix this.
SOCI uses `fmt::underlying` which seems to have been introduced via 0b2862a1e4 and the oldest tag containing this commit is `9.1.0`.
Without this SOCI will fail to build on Ubuntu 22.04 with `libfmt-dev` installed from the repositories (which is version 8.1) with this error message:
src/core/statement.cpp:815:35: error: ‘underlying’ is not a member of ‘fmt’
815 | fmt::underlying(dbtype)));
| ^~~~~~~~~~
This is significantly faster than sending queries one by one to a remote
server while preserving the same semantics from the caller point of
view.
This commit is best viewed ignoring whitespace-only changes and with Git
--color-moved option because collect_use_buffers() contains exactly the
same code that was inside execute() before: the only new code here is in
execute_bulk().
Oracle and PostgreSQL tests creating sequences failed if ran two times
in a row because they didn't clean up the sequence they created and
tried to recreate an already existing sequence during the next run.
Fix this by handling this in table_creator_base::drop() if the derived
class passes an optional sequence name to the base class ctor.
Replaces #1364.
This is extremely slow in GitHub Actions environment, resulting in the
"empty" backend test execution taking 814 seconds instead of 2 without
it, and all the other, non trivial, tests simply timing out.
We don't really need it anyhow an it got apparently enabled accidentally
due to DEBUGINFOD_URLS being set to https://debuginfod.ubuntu.com in the
latest GitHub runner Ubuntu images.
This was broken by c35b1b6a (Avoid disabling MSVC CRT security warnings
globally, 2025-06-08) which implicitly replaced std::strncpy() calls in
Oracle vector use type backend with the calls to soci::strncpy() which
doesn't behave in the same way as the standard function, e.g. it can't
be used with n==0 and it always NUL-terminates the destination buffer.
Restore the original strncpy() behaviour to fix this.
See #1268.
Don't redeclare the same variables or do redeclare it but reduce the
scope of a previously declared variable with the same name to avoid
shadowing.
No real changes.
This commit is best viewed ignoring whitespace-only changes.
The use of this function is discouraged but it may sometimes be
necessary and get_backend_name() is insufficient to determine the
database being used because ODBC backend can be used with any of them.
Set errno to 0 to avoid spurious errors if strto[u]ll() succeeded.
This corrects a regression introduced in 42c80b61 (Fix bug in
cstring_to_integer() for out of range inputs, 2026-04-28).
This operator needs to be defined to satisfy weakly_incrementable
concept required for input iterators, but it can be implemented to do
the same thing as pre-increment and, crucially, not return anything, as
doing this wouldn't make sense here because we can't preserve a copy of
the iterator before the increment.
See #1327.
Since private dependencies might also require propagating them to the
installed config file, we need to extend our dependency wrapper to deal
with it. It automatically checks whether propagation is required or not.
This avoids problems with dbgsym packages that regularly get out of sync
and should also be faster, as the debug symbols will only be retrieved
if necessary instead of being done every time the job runs.
This commit is best viewed ignoring whitespace-only changes.
See #1352.
This now avoids issues in case we search for a dependency more than once
and switches to creating imported targets instead of interface ones. The
former have the correct semantics when it comes to things like
installation etc. and also they will be scoped to the calling directory
or lower, avoiding clutter in unrelated (super) projects.
See #1351.
Use fmt::format() to build them directly instead, this is much simpler.
Also get rid of useless and trivial check_sqlite_err() function to
simplify the code a bit more.