Hello again,

 Here is another relatively trivial patch to the ODBC backend adding
support for 64 bit types:
----------------------------------------------------------------------------

Support x_long_long and x_unsigned_long_long input and output parameters.

Signed-off-by: Vadim Zeitlin <[email protected]>
---
 src/backends/odbc/standard-into-type.cpp |    8 ++++++++
 src/backends/odbc/standard-use-type.cpp  |   12 ++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/backends/odbc/standard-into-type.cpp 
b/src/backends/odbc/standard-into-type.cpp
index d9baeee..fbdde26 100644
--- a/src/backends/odbc/standard-into-type.cpp
+++ b/src/backends/odbc/standard-into-type.cpp
@@ -52,6 +52,14 @@ void odbc_standard_into_type_backend::define_by_pos(
         odbcType_ = SQL_C_ULONG;
         size = sizeof(unsigned long);
         break;
+    case x_long_long:
+        odbcType_ = SQL_C_SBIGINT;
+        size = sizeof(long long);
+        break;
+    case x_unsigned_long_long:
+        odbcType_ = SQL_C_UBIGINT;
+        size = sizeof(unsigned long long);
+        break;
     case x_double:
         odbcType_ = SQL_C_DOUBLE;
         size = sizeof(double);
diff --git a/src/backends/odbc/standard-use-type.cpp 
b/src/backends/odbc/standard-use-type.cpp
index 8c572ce..d746b53 100644
--- a/src/backends/odbc/standard-use-type.cpp
+++ b/src/backends/odbc/standard-use-type.cpp
@@ -35,6 +35,16 @@ void odbc_standard_use_type_backend::prepare_for_bind(
         cType = SQL_C_ULONG;
         size = sizeof(unsigned long);
         break;
+    case x_long_long:
+        sqlType = SQL_BIGINT;
+        cType = SQL_C_SBIGINT;
+        size = sizeof(long long);
+        break;
+    case x_unsigned_long_long:
+        sqlType = SQL_BIGINT;
+        cType = SQL_C_UBIGINT;
+        size = sizeof(unsigned long long);
+        break;
     case x_double:
         sqlType = SQL_DOUBLE;
         cType = SQL_C_DOUBLE;
@@ -97,8 +107,6 @@ void odbc_standard_use_type_backend::prepare_for_bind(
     case x_statement:
     case x_rowid:
         break;
-       case x_long_long: break; // TODO: verify if can be supported
-       case x_unsigned_long_long: break; // TODO: verify if can be supported
        }
 }

-- 
1.7.10

Attachment: pgpnvy6P4e2hN.pgp
Description: PGP signature

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to