tags 370805 +patch
thanks

Hello,

with the attached patch 'libodbc++' can be compiled on 64-bit architectures.

Regards
Andreas Jochens

diff -urN ../tmp-orig/libodbc++-0.2.3+0.2.4pre3/src/datastream.cpp 
./src/datastream.cpp
--- ../tmp-orig/libodbc++-0.2.3+0.2.4pre3/src/datastream.cpp    2005-09-28 
15:21:16.000000000 +0000
+++ ./src/datastream.cpp        2006-08-15 15:00:10.000000000 +0000
@@ -82,7 +82,7 @@
 
   //after the call, this is the number of bytes that were
   //available _before_ the call
-  SQLINTEGER bytes;
+  SQLLEN bytes;
 
   //the actual number of bytes that should end up in our buffer
   //we don't care about NULL termination
diff -urN ../tmp-orig/libodbc++-0.2.3+0.2.4pre3/src/preparedstatement.cpp 
./src/preparedstatement.cpp
--- ../tmp-orig/libodbc++-0.2.3+0.2.4pre3/src/preparedstatement.cpp     
2005-09-28 15:21:16.000000000 +0000
+++ ./src/preparedstatement.cpp 2006-08-15 14:57:38.000000000 +0000
@@ -161,7 +161,7 @@
   numParams_=np;
   
   SQLSMALLINT sqlType;
-  SQLUINTEGER prec;
+  SQLULEN prec;
   SQLSMALLINT scale;
   SQLSMALLINT nullable;
 
@@ -305,7 +305,7 @@
       r=SQLParamData(hstmt_,&currentCol);
       this->_checkStmtError(hstmt_,r,ODBCXX_STRING_CONST("SQLParamData 
failure"));
       if(r==SQL_NEED_DATA) {
-       DataHandler* dh=rowset_->getColumn((int)currentCol);
+       DataHandler* dh=rowset_->getColumn((long)currentCol);
 
        assert(dh->isStreamed_);
        
diff -urN ../tmp-orig/libodbc++-0.2.3+0.2.4pre3/src/resultset.cpp 
./src/resultset.cpp
--- ../tmp-orig/libodbc++-0.2.3+0.2.4pre3/src/resultset.cpp     2005-09-28 
15:21:16.000000000 +0000
+++ ./src/resultset.cpp 2006-08-15 15:07:36.000000000 +0000
@@ -531,7 +531,7 @@
       r=SQLParamData(hstmt_,&currentCol);
       this->_checkStmtError(hstmt_,r,ODBCXX_STRING_CONST("SQLParamData 
failure"));
       if(r==SQL_NEED_DATA) {
-        DataHandler* dh=rowset_->getColumn((int)currentCol);
+        DataHandler* dh=rowset_->getColumn((long)currentCol);
 
         assert(dh->isStreamed_);
 
@@ -1356,12 +1356,14 @@
   DataHandler* dh=rowset_->getColumn(idx);
   ODBCXX_STREAM* s=dh->getStream();
   if(s==NULL) {
+  SQLINTEGER Status=dh->dataStatus_[dh->currentRow_];
 #if defined(ODBCXX_HAVE_SQLUCODE_H)
     s=new DataStream(this,hstmt_,idx,SQL_C_TCHAR,
 #else
     s=new DataStream(this,hstmt_,idx,SQL_C_CHAR,
 #endif
-                     dh->dataStatus_[dh->currentRow_]);
+                     Status);
+    dh->dataStatus_[dh->currentRow_]=Status;
     dh->setStream(s);
   }
   lastWasNull_=dh->isNull();
@@ -1383,8 +1385,10 @@
   DataHandler* dh=rowset_->getColumn(idx);
   ODBCXX_STREAM* s=dh->getStream();
   if(s==NULL) {
+    SQLINTEGER Status=dh->dataStatus_[dh->currentRow_];
     s=new DataStream(this,hstmt_,idx,SQL_C_BINARY,
-                     dh->dataStatus_[dh->currentRow_]);
+                     Status);
+    dh->dataStatus_[dh->currentRow_]=Status;
     dh->setStream(s);
   }
   lastWasNull_=dh->isNull();
diff -urN ../tmp-orig/libodbc++-0.2.3+0.2.4pre3/src/resultsetmetadata.cpp 
./src/resultsetmetadata.cpp
--- ../tmp-orig/libodbc++-0.2.3+0.2.4pre3/src/resultsetmetadata.cpp     
2005-09-28 15:21:16.000000000 +0000
+++ ./src/resultsetmetadata.cpp 2006-08-15 15:01:21.000000000 +0000
@@ -39,7 +39,7 @@
 int ResultSetMetaData::_getNumericAttribute(unsigned int col,
                                           SQLUSMALLINT attr)
 {
-  SQLINTEGER res=0;
+  SQLLEN res=0;
   SQLRETURN r=
     ODBC3_C(SQLColAttribute,SQLColAttributes)(resultSet_->hstmt_,
                                              (SQLUSMALLINT)col,
@@ -63,7 +63,7 @@
   odbc::Deleter<ODBCXX_CHAR_TYPE> _buf(buf,true);
   buf[maxlen]=0;
 
-  SQLINTEGER res=0;
+  SQLLEN res=0;
   SQLSMALLINT len=0;
 
   SQLRETURN r=
diff -urN ../tmp-orig/libodbc++-0.2.3+0.2.4pre3/src/statement.cpp 
./src/statement.cpp
--- ../tmp-orig/libodbc++-0.2.3+0.2.4pre3/src/statement.cpp     2005-09-28 
15:21:16.000000000 +0000
+++ ./src/statement.cpp 2006-08-15 14:53:28.000000000 +0000
@@ -672,7 +672,7 @@
 
   if(lastExecute_!=ODBC3_C(SQL_NO_DATA,SQL_NO_DATA_FOUND)) {
 
-    SQLINTEGER res;
+    SQLLEN res;
     SQLRETURN r=SQLRowCount(hstmt_,&res);
     this->_checkStmtError(hstmt_,r,ODBCXX_STRING_CONST("Error fetching update 
count"));
     return res;
diff -urN ../tmp-orig/libodbc++-0.2.3+0.2.4pre3/src/datahandler.cpp 
./src/datahandler.cpp
--- ../tmp-orig/libodbc++-0.2.3+0.2.4pre3/src/datahandler.cpp   2005-09-28 
15:21:16.000000000 +0000
+++ ./src/datahandler.cpp       2006-08-15 15:01:56.000000000 +0000
@@ -280,7 +280,7 @@
   };
   this->setupBuffer(bs);
 
-  dataStatus_=new SQLINTEGER[rows_];
+  dataStatus_=new SQLLEN[rows_];
 
   //set everything to NULL
   for(unsigned int i=0; i<rows_; i++) {
diff -urN ../tmp-orig/libodbc++-0.2.3+0.2.4pre3/src/datahandler.h 
./src/datahandler.h
--- ../tmp-orig/libodbc++-0.2.3+0.2.4pre3/src/datahandler.h     2005-09-28 
15:21:16.000000000 +0000
+++ ./src/datahandler.h 2006-08-15 14:58:19.000000000 +0000
@@ -48,7 +48,7 @@
     size_t rows_;
     char* buffer_;
     size_t bufferSize_;
-    SQLINTEGER* dataStatus_;
+    SQLLEN* dataStatus_;
     bool isStreamed_;
     ODBCXX_STREAM* stream_;
     bool ownStream_;


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to