aboutsummaryrefslogtreecommitdiff
path: root/odb/qt/basic/sqlite
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-07-22 10:02:42 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-07-22 10:02:42 +0200
commit32d382ddfbfac28316a9048e22f8493f66c51805 (patch)
tree692d24fae45d9e9a4767c80c967c599b3dcb4844 /odb/qt/basic/sqlite
parentcf212c1ed64956b745a077e1a8f3d92be396e27d (diff)
Correct QString null semantics in MySQL and SQLite profiles
Diffstat (limited to 'odb/qt/basic/sqlite')
-rw-r--r--odb/qt/basic/sqlite/qstring-traits.hxx17
1 files changed, 11 insertions, 6 deletions
diff --git a/odb/qt/basic/sqlite/qstring-traits.hxx b/odb/qt/basic/sqlite/qstring-traits.hxx
index 5014aaf..fdcbbfe 100644
--- a/odb/qt/basic/sqlite/qstring-traits.hxx
+++ b/odb/qt/basic/sqlite/qstring-traits.hxx
@@ -46,15 +46,20 @@ namespace odb
bool& is_null,
const QString& v)
{
- is_null = false;
+ if (v.isNull ())
+ is_null = true;
+ else
+ {
+ is_null = false;
- const QByteArray& a (v.toUtf8 ());
- n = static_cast<std::size_t> (a.size ());
+ const QByteArray& a (v.toUtf8 ());
+ n = static_cast<std::size_t> (a.size ());
- if (n > b.capacity ())
- b.capacity (n);
+ if (n > b.capacity ())
+ b.capacity (n);
- std::memcpy (b.data (), a.data (), n);
+ std::memcpy (b.data (), a.data (), n);
+ }
}
};