aboutsummaryrefslogtreecommitdiff
path: root/odb/option-types.cxx
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.cxx
parent89c06fb9ce3470c7a1b55cc906f2165791917957 (diff)
Work around SQL Server 2005 bug with long data and OUTPUT clause
Diffstat (limited to 'odb/option-types.cxx')
-rw-r--r--odb/option-types.cxx48
1 files changed, 48 insertions, 0 deletions
diff --git a/odb/option-types.cxx b/odb/option-types.cxx
index 715577d..fcd7b88 100644
--- a/odb/option-types.cxx
+++ b/odb/option-types.cxx
@@ -12,8 +12,10 @@
using namespace std;
+//
// database
//
+
static const char* database_[] =
{
"mssql",
@@ -55,8 +57,10 @@ operator<< (ostream& os, database db)
return os << db.string ();
}
+//
// schema_format
//
+
static const char* schema_format_[] =
{
"embedded",
@@ -95,8 +99,10 @@ operator<< (ostream& os, schema_format sf)
return os << sf.string ();
}
+//
// oracle_version
//
+
istream&
operator>> (istream& is, oracle_version& v)
{
@@ -134,3 +140,45 @@ operator<< (ostream& os, oracle_version v)
{
return os << v.ver_major () << '.' << v.ver_minor ();
}
+
+//
+// mssql_version
+//
+
+istream&
+operator>> (istream& is, mssql_version& v)
+{
+ unsigned short major, minor;
+
+ // Extract the major version.
+ //
+ is >> major;
+
+ if (!is.fail ())
+ {
+ // Extract the decimal point.
+ //
+ char p;
+ is >> p;
+
+ if (!is.fail () && p == '.')
+ {
+ // Extract the minor version.
+ //
+ is >> minor;
+
+ if (!is.fail ())
+ v = mssql_version (major, minor);
+ }
+ else
+ is.setstate (istream::failbit);
+ }
+
+ return is;
+}
+
+ostream&
+operator<< (ostream& os, mssql_version v)
+{
+ return os << v.ver_major () << '.' << v.ver_minor ();
+}