aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-01-13 12:04:52 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-01-13 12:04:52 +0200
commit9844c8efeaa64f62e4bfbd739088d93df97d8fc8 (patch)
treeb3fc17c02036d08368d91b856c07d756ae21255b
parent11f7315a1edc27f56b095fe399e285197329b714 (diff)
Implement set_image() for id_rowversion
-rw-r--r--odb/mssql/traits.hxx19
1 files changed, 17 insertions, 2 deletions
diff --git a/odb/mssql/traits.hxx b/odb/mssql/traits.hxx
index d1399aa..a74b002 100644
--- a/odb/mssql/traits.hxx
+++ b/odb/mssql/traits.hxx
@@ -1494,8 +1494,23 @@ namespace odb
v = 0;
}
- // There is no set_image() since it is impossible to insert an
- // explicit value into a rowversion column.
+ static void
+ set_image (unsigned char* i, bool& is_null, unsigned long long v)
+ {
+ is_null = false;
+
+ // The value is in the big-endian format.
+ //
+ const unsigned char* p (reinterpret_cast<const unsigned char*> (&v));
+ i[0] = p[7];
+ i[1] = p[6];
+ i[2] = p[5];
+ i[3] = p[4];
+ i[4] = p[3];
+ i[5] = p[2];
+ i[6] = p[1];
+ i[7] = p[0];
+ }
};
//