summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2001-10-01 10:24:29 +0000
committerOcke Janssen <oj@openoffice.org>2001-10-01 10:24:29 +0000
commitb75c8e2d989a250403c079d88b779119d87deba1 (patch)
tree8f68dcf33b48e8cd8fa8e79e4c8d03c2c7244743 /connectivity/source/drivers
parent28470b188ccd9e1ebfdc15cf08fed727fe7d8bbc (diff)
#92613# unbound evaluationrow fixed
Diffstat (limited to 'connectivity/source/drivers')
-rw-r--r--connectivity/source/drivers/file/FPreparedStatement.cxx23
-rw-r--r--connectivity/source/drivers/file/FStatement.cxx25
-rw-r--r--connectivity/source/drivers/file/fanalyzer.cxx6
3 files changed, 30 insertions, 24 deletions
diff --git a/connectivity/source/drivers/file/FPreparedStatement.cxx b/connectivity/source/drivers/file/FPreparedStatement.cxx
index 633eeb1a6e19..a471d777086f 100644
--- a/connectivity/source/drivers/file/FPreparedStatement.cxx
+++ b/connectivity/source/drivers/file/FPreparedStatement.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: FPreparedStatement.cxx,v $
*
- * $Revision: 1.23 $
+ * $Revision: 1.24 $
*
- * last change: $Author: oj $ $Date: 2001-08-24 06:08:38 $
+ * last change: $Author: oj $ $Date: 2001-10-01 11:24:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -118,7 +118,6 @@ IMPLEMENT_SERVICE_INFO(OPreparedStatement,"com.sun.star.sdbc.driver.file.Prepare
OPreparedStatement::OPreparedStatement( OConnection* _pConnection)
: OStatement_BASE2( _pConnection )
,m_pResultSet(NULL)
- ,m_pEvaluationKeySet(NULL)
{
}
// -------------------------------------------------------------------------
@@ -138,12 +137,7 @@ void OPreparedStatement::disposing()
m_aParameterRow->clear();
m_aParameterRow = NULL;
}
- if(m_aEvaluateRow.isValid())
- {
- m_aEvaluateRow->clear();
- m_aEvaluateRow = NULL;
- }
- delete m_pEvaluationKeySet;
+
m_xParamColumns = NULL;
}
// -------------------------------------------------------------------------
@@ -156,11 +150,6 @@ void OPreparedStatement::construct(const ::rtl::OUString& sql) throw(SQLExcepti
m_xParamColumns = new OSQLColumns();
Reference<XIndexAccess> xNames(m_xColNames,UNO_QUERY);
- // set the binding of the resultrow
- m_aEvaluateRow = new OValueVector(xNames->getCount());
-
- (*m_aEvaluateRow)[0].setBound(sal_True);
- ::std::for_each(m_aEvaluateRow->begin()+1,m_aEvaluateRow->end(),TSetBound(sal_False));
// describe all parameters need for the resultset
describeParameter();
@@ -856,10 +845,10 @@ void OPreparedStatement::describeParameter()
void OPreparedStatement::initializeResultSet(OResultSet* _pResult)
{
OStatement_Base::initializeResultSet(_pResult);
+
m_pResultSet->setParameterColumns(m_xParamColumns);
m_pResultSet->setParameterRow(m_aParameterRow);
m_pResultSet->setAssignValues(m_aAssignValues);
- m_pResultSet->setEvaluationRow(m_aEvaluateRow);
// Parameter substituieren (AssignValues und Kriterien):
if (!m_xParamColumns->empty())
@@ -887,8 +876,8 @@ void OPreparedStatement::initializeResultSet(OResultSet* _pResult)
}
}
- m_pEvaluationKeySet = m_pSQLAnalyzer->bindResultRow(m_aEvaluateRow); // Werte im Code des Compilers setzen
- m_pResultSet->setEvaluationKeySet(m_pEvaluationKeySet);
+// m_pEvaluationKeySet = m_pSQLAnalyzer->bindResultRow(m_aEvaluateRow); // Werte im Code des Compilers setzen
+// m_pResultSet->setEvaluationKeySet(m_pEvaluationKeySet);
}
// -----------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx
index 1c9bd36db25b..775a75c3eb01 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: FStatement.cxx,v $
*
- * $Revision: 1.21 $
+ * $Revision: 1.22 $
*
- * last change: $Author: oj $ $Date: 2001-08-29 12:15:31 $
+ * last change: $Author: oj $ $Date: 2001-10-01 11:24:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -136,6 +136,7 @@ OStatement_Base::OStatement_Base(OConnection* _pConnection ) : OStatement_BASE(
,m_pSQLAnalyzer(NULL)
,m_xDBMetaData(_pConnection->getMetaData())
,m_pTable(NULL)
+ ,m_pEvaluationKeySet(NULL)
{
m_pConnection->acquire();
@@ -195,6 +196,7 @@ void OStatement_BASE2::disposing()
if (m_pConnection)
m_pConnection->release();
+
dispose_ChildImpl();
OStatement_Base::disposing();
}
@@ -378,6 +380,12 @@ void SAL_CALL OStatement::release() throw(::com::sun::star::uno::RuntimeExceptio
// -----------------------------------------------------------------------------
void SAL_CALL OStatement_Base::disposing(void)
{
+ if(m_aEvaluateRow.isValid())
+ {
+ m_aEvaluateRow->clear();
+ m_aEvaluateRow = NULL;
+ }
+ delete m_pEvaluationKeySet;
OStatement_BASE::disposing();
}
// -----------------------------------------------------------------------------
@@ -492,7 +500,14 @@ void OStatement_Base::construct(const ::rtl::OUString& sql) throw(SQLException,
m_aRow = new OValueVector(xNames->getCount());
(*m_aRow)[0].setBound(sal_True);
::std::for_each(m_aRow->begin()+1,m_aRow->end(),TSetBound(sal_False));
- // create teh column mapping
+
+ // set the binding of the resultrow
+ m_aEvaluateRow = new OValueVector(xNames->getCount());
+
+ (*m_aEvaluateRow)[0].setBound(sal_True);
+ ::std::for_each(m_aEvaluateRow->begin()+1,m_aEvaluateRow->end(),TSetBound(sal_False));
+
+ // create the column mapping
createColumnMapping();
m_pSQLAnalyzer = createAnalyzer();
@@ -528,8 +543,10 @@ void OStatement_Base::initializeResultSet(OResultSet* _pResult)
_pResult->setOrderByAscending(m_aOrderbyAscending);
_pResult->setBindingRow(m_aRow);
_pResult->setColumnMapping(m_aColMapping);
- // _pResult->setTable(m_pTable);
+ _pResult->setEvaluationRow(m_aEvaluateRow);
+ m_pEvaluationKeySet = m_pSQLAnalyzer->bindResultRow(m_aEvaluateRow); // Werte im Code des Compilers setzen
+ _pResult->setEvaluationKeySet(m_pEvaluationKeySet);
}
}
}
diff --git a/connectivity/source/drivers/file/fanalyzer.cxx b/connectivity/source/drivers/file/fanalyzer.cxx
index 6abc44b3d1a1..86befa00e8fc 100644
--- a/connectivity/source/drivers/file/fanalyzer.cxx
+++ b/connectivity/source/drivers/file/fanalyzer.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fanalyzer.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: oj $ $Date: 2001-08-24 06:08:38 $
+ * last change: $Author: oj $ $Date: 2001-10-01 11:24:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -200,7 +200,7 @@ void OSQLAnalyzer::start(OSQLParseNode* pSQLParseNode)
}
// Keyset erzeugen mit kleinster Liste
- if(aEvaluateSetList.size())
+ if(!aEvaluateSetList.empty())
{
// welche Liste hat den kleinsten count ?
OEvaluateSetList::iterator i = aEvaluateSetList.begin();