Tag: cws_src680_dba24b
User: oj      
Date: 2007-08-31 06:09:29+0000
Modified:
   dba/connectivity/source/drivers/odbc/OPreparedStatement.cxx
   dba/connectivity/source/inc/odbc/OPreparedStatement.hxx
   dba/connectivity/source/inc/odbc/OBoundParam.hxx

Log:
 #145282# not initialized var

File Changes:

Directory: /dba/connectivity/source/drivers/odbc/
=================================================

File [changed]: OPreparedStatement.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/odbc/OPreparedStatement.cxx?r1=1.43&r2=1.43.88.1
Delta lines:  +9 -8
-------------------
--- OPreparedStatement.cxx      2006-12-13 16:22:16+0000        1.43
+++ OPreparedStatement.cxx      2007-08-31 06:09:26+0000        1.43.88.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: OPreparedStatement.cxx,v $
  *
- *  $Revision: 1.43 $
+ *  $Revision: 1.43.88.1 $
  *
- *  last change: $Author: kz $ $Date: 2006/12/13 16:22:16 $
+ *  last change: $Author: oj $ $Date: 2007/08/31 06:09:26 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -103,9 +103,9 @@
 OPreparedStatement::OPreparedStatement( OConnection* _pConnection,const 
TTypeInfoVector& _TypeInfo,const ::rtl::OUString& sql)
        :OStatement_BASE2(_pConnection)
        ,m_aTypeInfo(_TypeInfo)
+    ,numParams(0)
        ,boundParams(NULL)
        ,m_bPrepared(sal_False)
-
 {
        m_sSqlStatement = sql;
        try
@@ -660,7 +660,7 @@
        OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
        // Get the number of parameters
        numParams = 0;
-       N3SQLNumParams (m_aStatementHandle,(short*)&numParams);
+       N3SQLNumParams (m_aStatementHandle,&numParams);
 
        // There are parameter markers, allocate the bound
        // parameter objects
@@ -695,7 +695,7 @@
        // Sanity check the parameter number
 
        if ((index >= 1) &&
-               (index <= numParams))
+               (index <= numParams) && bufLen > 0 )
        {
                b = boundParams[index - 1].allocBindDataBuffer(bufLen);
        }
@@ -978,6 +978,7 @@
 
 void OPreparedStatement::FreeParams()
 {
+    numParams = 0;
        delete [] boundParams;
        boundParams = NULL;
 }
@@ -1018,11 +1019,11 @@
 {
        if(!isPrepared())
        {
-               m_bPrepared = sal_True;
                OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
                ::rtl::OString 
aSql(::rtl::OUStringToOString(m_sSqlStatement,getOwnConnection()->getTextEncoding()));
                SQLRETURN nReturn = 
N3SQLPrepare(m_aStatementHandle,(SDB_ODBC_CHAR *) 
aSql.getStr(),aSql.getLength());
                
OTools::ThrowException(m_pConnection,nReturn,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+        m_bPrepared = sal_True;
                initBoundParam();
        }
 }

Directory: /dba/connectivity/source/inc/odbc/
=============================================

File [changed]: OPreparedStatement.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/inc/odbc/OPreparedStatement.hxx?r1=1.11&r2=1.11.184.1
Delta lines:  +4 -4
-------------------
--- OPreparedStatement.hxx      2006-06-20 02:06:07+0000        1.11
+++ OPreparedStatement.hxx      2007-08-31 06:09:27+0000        1.11.184.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: OPreparedStatement.hxx,v $
  *
- *  $Revision: 1.11 $
+ *  $Revision: 1.11.184.1 $
  *
- *  last change: $Author: hr $ $Date: 2006/06/20 02:06:07 $
+ *  last change: $Author: oj $ $Date: 2007/08/31 06:09:27 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -97,7 +97,7 @@
                                                                                
                                                                //  for each 
row returned by
                                                                                
                                                                //  
DatabaseMetaData.getTypeInfo.
 
-                       int                             numParams;              
// Number of parameter markers
+                       SQLSMALLINT     numParams;              // Number of 
parameter markers
                                                                                
        //  for the prepared statement
 
                        OBoundParam*    boundParams;

File [changed]: OBoundParam.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/inc/odbc/OBoundParam.hxx?r1=1.3&r2=1.3.282.1
Delta lines:  +5 -3
-------------------
--- OBoundParam.hxx     2005-09-08 07:34:29+0000        1.3
+++ OBoundParam.hxx     2007-08-31 06:09:27+0000        1.3.282.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: OBoundParam.hxx,v $
  *
- *  $Revision: 1.3 $
+ *  $Revision: 1.3.282.1 $
  *
- *  last change: $Author: rt $ $Date: 2005/09/08 07:34:29 $
+ *  last change: $Author: oj $ $Date: 2007/08/31 06:09:27 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -86,6 +86,8 @@
                        
//--------------------------------------------------------------------
                        sal_Int8* allocBindDataBuffer (sal_Int32 bufLen)
                        {
+                if ( binaryData )
+                    delete binaryData;
                                binaryData = new sal_Int8[bufLen];
 
                                // Reset the input stream, we are doing a new 
bind




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to