[sqlapi-announce] SQLAPI++ library 4.0.1 bugfix (SQLServer: Fixed IssNCliCursor::ConvertString and IssOleDbCursor::ConvertString virtual methods)

  • From: Sergey Chumakov <support@xxxxxxxxxx>
  • To: sqlapi-announce@xxxxxxxxxxxxx
  • Date: Sun, 24 Jun 2012 18:54:04 +0300

2012-06-24

-- SQLServer: Fixed IssNCliCursor::ConvertString and IssOleDbCursor::ConvertString virtual methods(thanks Petr Liska).
-- Sybase: Fixed IsybCursor::ConvertString virtual method.
-- InterBase: Fixed IibCursor::ConvertString virtual method.

Use attached diff files for 4.0.1 sources patching.

--
Best regards,
Sergey Chumakov, SQLAPI++ development team

















*** D:/yas/Local Settings/Temp/TCV55557.tmp/ibClient.1.34.cpp   Wed May 30 
21:58:52 2012
--- D:/src/SQLAPI/SQLAPI/src/ibClient.cpp       Fri Jun 22 17:34:40 2012
***************
*** 733,743 ****
  
  #ifdef SA_UNICODE_WITH_UTF8
        virtual void ConvertString(
                SAString &String,
                const void *pData,
!               unsigned int nRealSize);
  #endif
  };
  
  
  //////////////////////////////////////////////////////////////////////
--- 733,743 ----
  
  #ifdef SA_UNICODE_WITH_UTF8
        virtual void ConvertString(
                SAString &String,
                const void *pData,
!               size_t nRealSize);
  #endif
  };
  
  
  //////////////////////////////////////////////////////////////////////
***************
*** 1947,1957 ****
        m_bResultSet = false;
  }
  
  #ifdef SA_UNICODE_WITH_UTF8
  /*virtual */
! void IibCursor::ConvertString(SAString &String, const void *pData, unsigned 
int nRealSize)
  {
        String.SetUTF8Chars((const char*)pData, nRealSize);
  }
  #endif
  
--- 1947,1957 ----
        m_bResultSet = false;
  }
  
  #ifdef SA_UNICODE_WITH_UTF8
  /*virtual */
! void IibCursor::ConvertString(SAString &String, const void *pData, size_t 
nRealSize)
  {
        String.SetUTF8Chars((const char*)pData, nRealSize);
  }
  #endif
  
*** D:/yas/Local Settings/Temp/TCV53011.tmp/sybClient.1.68.cpp  Wed May 30 
21:58:53 2012
--- D:/src/SQLAPI/SQLAPI/src/sybClient.cpp      Fri Jun 22 17:36:20 2012
***************
*** 1318,1328 ****
  
  #ifdef SA_UNICODE_WITH_UTF8
        virtual void ConvertString(
                SAString &String,
                const void *pData,
!               unsigned int nRealSize);
  #endif
  };
  
  //////////////////////////////////////////////////////////////////////
  // Construction/Destruction
--- 1318,1328 ----
  
  #ifdef SA_UNICODE_WITH_UTF8
        virtual void ConvertString(
                SAString &String,
                const void *pData,
!               size_t nRealSize);
  #endif
  };
  
  //////////////////////////////////////////////////////////////////////
  // Construction/Destruction
***************
*** 2614,2624 ****
        return true;    // converted
  }
  
  #ifdef SA_UNICODE_WITH_UTF8
  /*virtual */
! void IsybCursor::ConvertString(SAString &String, const void *pData, unsigned 
int nRealSize)
  {
        String.SetUTF8Chars((const char*)pData, nRealSize);
  }
  #endif
  
--- 2614,2624 ----
        return true;    // converted
  }
  
  #ifdef SA_UNICODE_WITH_UTF8
  /*virtual */
! void IsybCursor::ConvertString(SAString &String, const void *pData, size_t 
nRealSize)
  {
        String.SetUTF8Chars((const char*)pData, nRealSize);
  }
  #endif
  
*** D:/yas/Local Settings/Temp/TCV8549.tmp/ssNcliClient.1.20.cpp        Wed May 
30 21:58:53 2012
--- D:/src/SQLAPI/SQLAPI/src/ssNcliClient.cpp   Fri Jun 22 17:35:44 2012
***************
*** 697,707 ****
        virtual saCommandHandles *NativeHandles();
  
        virtual void ConvertString(
                SAString &String,
                const void *pData,
!               unsigned int nRealSize);
  };
  
  //////////////////////////////////////////////////////////////////////
  // Construction/Destruction
  //////////////////////////////////////////////////////////////////////
--- 697,707 ----
        virtual saCommandHandles *NativeHandles();
  
        virtual void ConvertString(
                SAString &String,
                const void *pData,
!               size_t nRealSize);
  };
  
  //////////////////////////////////////////////////////////////////////
  // Construction/Destruction
  //////////////////////////////////////////////////////////////////////
***************
*** 1993,2003 ****
  // (in both Unicode and multi-byte builds)
  // it also assumes that nRealSize is always in bytes not characters
  // We overload this because our buffer is multi-byte
  // under multi-byte build, but Unicode under Unicode build
  /*virtual */
! void IssNCliCursor::ConvertString(SAString &String, const void *pData, 
unsigned int nRealSize)
  {
        // nRealSize is in bytes but we need in characters,
        // so nRealSize should be a multiply of character size
        assert(nRealSize % sizeof(SAChar) == 0);
        String = SAString((const SAChar*)pData, nRealSize/sizeof(SAChar));
--- 1993,2003 ----
  // (in both Unicode and multi-byte builds)
  // it also assumes that nRealSize is always in bytes not characters
  // We overload this because our buffer is multi-byte
  // under multi-byte build, but Unicode under Unicode build
  /*virtual */
! void IssNCliCursor::ConvertString(SAString &String, const void *pData, size_t 
nRealSize)
  {
        // nRealSize is in bytes but we need in characters,
        // so nRealSize should be a multiply of character size
        assert(nRealSize % sizeof(SAChar) == 0);
        String = SAString((const SAChar*)pData, nRealSize/sizeof(SAChar));
*** D:/yas/Local Settings/Temp/TCV2055.tmp/ssOleDbClient.1.108.cpp      Wed May 
30 21:58:53 2012
--- D:/src/SQLAPI/SQLAPI/src/ssOleDbClient.cpp  Fri Jun 22 17:36:03 2012
***************
*** 795,805 ****
                size_t &nRealSize,
                int nBulkReadingBufPos) const;
        virtual void ConvertString(
                SAString &String,
                const void *pData,
!               unsigned int nRealSize);
        // should return false if client binds output/return parameters
        // according to value type (coersing)
        // should return true if client binds output/return parameters
        // according to parameter type
        // defaults to false, so we overload it in SQLOLEDB client
--- 795,805 ----
                size_t &nRealSize,
                int nBulkReadingBufPos) const;
        virtual void ConvertString(
                SAString &String,
                const void *pData,
!               size_t nRealSize);
        // should return false if client binds output/return parameters
        // according to value type (coersing)
        // should return true if client binds output/return parameters
        // according to parameter type
        // defaults to false, so we overload it in SQLOLEDB client
***************
*** 3298,3308 ****
  // (in both Unicode and multi-byte builds)
  // it also assumes that nRealSize is always in bytes not characters
  // We overload this because our buffer is multi-byte
  // under multi-byte build, but Unicode under Unicode build
  /*virtual */
! void IssOleDbCursor::ConvertString(SAString &String, const void *pData, 
unsigned int nRealSize)
  {
        // nRealSize is in bytes but we need in characters,
        // so nRealSize should be a multiply of character size
        assert(nRealSize % sizeof(SAChar) == 0);
        String = SAString((const SAChar*)pData, nRealSize/sizeof(SAChar));
--- 3298,3308 ----
  // (in both Unicode and multi-byte builds)
  // it also assumes that nRealSize is always in bytes not characters
  // We overload this because our buffer is multi-byte
  // under multi-byte build, but Unicode under Unicode build
  /*virtual */
! void IssOleDbCursor::ConvertString(SAString &String, const void *pData, 
size_t nRealSize)
  {
        // nRealSize is in bytes but we need in characters,
        // so nRealSize should be a multiply of character size
        assert(nRealSize % sizeof(SAChar) == 0);
        String = SAString((const SAChar*)pData, nRealSize/sizeof(SAChar));

Other related posts:

  • » [sqlapi-announce] SQLAPI++ library 4.0.1 bugfix (SQLServer: Fixed IssNCliCursor::ConvertString and IssOleDbCursor::ConvertString virtual methods) - Sergey Chumakov