diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-12-22 11:50:32 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-01-20 15:45:46 +0200 |
commit | 2a8f6db525ba7f400c170cdd6321dcb20c2d24e3 (patch) | |
tree | df9dcde0d665caf464cdbb41b3458ff16a945d11 /mssql/types/test.hxx | |
parent | 089a36ee4a3c7bf6d7288f021f135b8c4ffce8a0 (diff) |
Test SQL Server long data in container
Diffstat (limited to 'mssql/types/test.hxx')
-rw-r--r-- | mssql/types/test.hxx | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index 8cd689b..a0d261e 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -298,7 +298,6 @@ struct object } }; - // Test long NULL data. // #pragma db object @@ -322,4 +321,42 @@ struct long_null } }; +// Test long data in containers, in particular column re-arrangement. +// +#pragma db value +struct long_comp +{ + long_comp () {} + long_comp (std::string s, unsigned int n): str (s), num (n) {} + + #pragma db type ("VARCHAR(max)") + std::string str; + + unsigned int num; + + bool + operator== (const long_comp& y) const + { + return str == y.str && num == y.num; + } +}; + +#pragma db object +struct long_cont +{ + long_cont () {} + long_cont (unsigned int id): id_ (id) {} + + #pragma db id + unsigned int id_; + + std::vector<long_comp> v; + + bool + operator== (const long_cont& y) const + { + return id_ == y.id_ && v == y.v; + } +}; + #endif // TEST_HXX |