aboutsummaryrefslogtreecommitdiff
path: root/odb/option-types.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-01-20 10:30:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-01-20 15:43:46 +0200
commit64cc9e9f0ed1ac6742ce9d5b370bf7de7b1cb461 (patch)
treeade429bd15d070efc66386d455745cb64ce8af22 /odb/option-types.hxx
parent89c06fb9ce3470c7a1b55cc906f2165791917957 (diff)
Work around SQL Server 2005 bug with long data and OUTPUT clause
Diffstat (limited to 'odb/option-types.hxx')
-rw-r--r--odb/option-types.hxx74
1 files changed, 72 insertions, 2 deletions
diff --git a/odb/option-types.hxx b/odb/option-types.hxx
index 2b96941..b674eae 100644
--- a/odb/option-types.hxx
+++ b/odb/option-types.hxx
@@ -69,8 +69,6 @@ operator<< (std::ostream&, schema_format);
//
struct oracle_version
{
- oracle_version (): major_ (0), minor_ (0) {}
-
oracle_version (unsigned short major, unsigned short minor)
: major_ (major), minor_ (minor)
{
@@ -139,4 +137,76 @@ operator>> (std::istream&, oracle_version&);
std::ostream&
operator<< (std::ostream&, oracle_version);
+//
+//
+struct mssql_version
+{
+ mssql_version (unsigned short major, unsigned short minor)
+ : major_ (major), minor_ (minor)
+ {
+ }
+
+ unsigned short
+ ver_major () const
+ {
+ return major_;
+ }
+
+ unsigned short
+ ver_minor () const
+ {
+ return minor_;
+ }
+
+private:
+ unsigned short major_;
+ unsigned short minor_;
+};
+
+inline bool
+operator== (const mssql_version& x, const mssql_version& y)
+{
+ return x.ver_major () == y.ver_major ();
+}
+
+inline bool
+operator!= (const mssql_version& x, const mssql_version& y)
+{
+ return !(x == y);
+}
+
+inline bool
+operator< (const mssql_version& x, const mssql_version& y)
+{
+ return x.ver_major () < y.ver_major () ||
+ (x.ver_major () == y.ver_major () &&
+ x.ver_minor () < y.ver_minor ());
+}
+
+inline bool
+operator> (const mssql_version& x, const mssql_version& y)
+{
+ return x.ver_major () > y.ver_major () ||
+ (x.ver_major () == y.ver_major () &&
+ x.ver_minor () > y.ver_minor ());
+}
+
+inline bool
+operator<= (const mssql_version& x, const mssql_version& y)
+{
+ return !(x > y);
+}
+
+inline bool
+operator>= (const mssql_version& x, const mssql_version& y)
+{
+ return !(x < y);
+}
+
+std::istream&
+operator>> (std::istream&, mssql_version&);
+
+std::ostream&
+operator<< (std::ostream&, mssql_version);
+
#endif // ODB_OPTION_TYPES_HXX