aboutsummaryrefslogtreecommitdiff
path: root/mssql
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-09-11 13:55:48 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-09-11 13:55:48 +0200
commitd87a78e24d5988cfa3556707b7beffd1b0c15901 (patch)
tree32115e06a1bdade66efea1e304ba5863feaa5a21 /mssql
parent32fcd732e2535090174142dd15b8b74fc444a9c2 (diff)
Add support for mapping std::array to BLOB and char[16] to UUID types
Diffstat (limited to 'mssql')
-rw-r--r--mssql/types/driver.cxx2
-rw-r--r--mssql/types/test.hxx5
2 files changed, 6 insertions, 1 deletions
diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx
index 2d32429..3f5577f 100644
--- a/mssql/types/driver.cxx
+++ b/mssql/types/driver.cxx
@@ -97,6 +97,8 @@ main (int argc, char* argv[])
o.guid_.Data3 = 0x4E4D;
memcpy (&o.guid_.Data4, "\xB2\x2F\x56\x44\x3C\xFA\x54\x3F", 8);
#endif
+ memcpy (o.uuid_, "\x6F\x84\x6D\x41\xC8\x9A\x4E\x4D\xB2\x2F"
+ "\x56\x44\x3C\xFA\x54\x3F", 16);
// Persist.
//
diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx
index b89a621..d735acf 100644
--- a/mssql/types/test.hxx
+++ b/mssql/types/test.hxx
@@ -241,6 +241,9 @@ struct object
GUID guid_;
#endif
+ #pragma db type ("UNIQUEIDENTIFIER")
+ char uuid_[16];
+
bool
operator== (const object& y) const
{
@@ -301,7 +304,7 @@ struct object
#ifdef _WIN32
&& std::memcmp (&guid_, &y.guid_, sizeof (guid_)) == 0
#endif
- ;
+ && std::memcmp (uuid_, y.uuid_, sizeof (uuid_)) == 0;
}
};