Summary
Fix unsigned 64-bit parameter binding so values greater than INT64_MAX are not silently converted to negative signed values.
The public overload accepting std::uint64_t must remain available.
Current behavior
Statement::bind(std::size_t, std::uint64_t) converts the value to std::int64_t before forwarding it.
DbValue already contains a std::uint64_t alternative, but the current driver implementations do not consistently handle it.
Expected behavior
Unsigned 64-bit values must either:
- be bound losslessly when supported by the backend; or
- fail clearly when a backend cannot represent the value safely.
Silent narrowing must not occur.
Scope
Suggested files
modules/db/include/vix/db/core/Drivers.hpp
modules/db/src/sqlite/SQLiteDriver.cpp
modules/db/src/mysql/MySQLDriver.cpp
modules/db/tests/sqlite_driver_test.cpp
modules/db/tests/mysql_driver_test.cpp
Acceptance criteria
Non-goals
This issue does not include:
- arbitrary-precision integers;
- decimal numeric types;
- schema type changes;
- ORM numeric conversion.
Suggested labels
scope:db
type:bug
tests
help wanted
status:ready
Summary
Fix unsigned 64-bit parameter binding so values greater than
INT64_MAXare not silently converted to negative signed values.The public overload accepting
std::uint64_tmust remain available.Current behavior
Statement::bind(std::size_t, std::uint64_t)converts the value tostd::int64_tbefore forwarding it.DbValuealready contains astd::uint64_talternative, but the current driver implementations do not consistently handle it.Expected behavior
Unsigned 64-bit values must either:
Silent narrowing must not occur.
Scope
std::uint64_thandling to SQLite.std::uint64_thandling to MySQL.Suggested files
modules/db/include/vix/db/core/Drivers.hppmodules/db/src/sqlite/SQLiteDriver.cppmodules/db/src/mysql/MySQLDriver.cppmodules/db/tests/sqlite_driver_test.cppmodules/db/tests/mysql_driver_test.cppAcceptance criteria
0,INT64_MAX,INT64_MAX + 1, andUINT64_MAXare tested.DBError.Non-goals
This issue does not include:
Suggested labels
scope:dbtype:bugtestshelp wantedstatus:ready