Sqlite: Fix null handling

Most of it is only silencing a warning but one is fixing a faulty test. So
writing null values should now be working.

Change-Id: If702e1fc8176a9e0ae82a5589c719d567929202b
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2020-06-09 17:31:06 +02:00
committed by Tim Jenssen
parent e330cccbfe
commit acf5329422
5 changed files with 13 additions and 0 deletions

View File

@@ -320,6 +320,9 @@ std::ostream &operator<<(std::ostream &out, const Value &value)
case Sqlite::ValueType::String:
out << "\"" << value.toStringView() << "\"";
break;
case Sqlite::ValueType::Null:
out << "null";
break;
}
return out << ")";

View File

@@ -388,6 +388,7 @@ TEST_F(SqliteStatement, WritePointerValues)
TEST_F(SqliteStatement, WriteNullValues)
{
WriteStatement statement("UPDATE test SET name=?, number=? WHERE rowid=?", database);
statement.write(1, 1, 1);
statement.write(Sqlite::NullValue{}, Sqlite::Value{}, 1);