summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dbaccess/source/filter/hsqldb/hsqlbinarynode.cxx6
-rw-r--r--dbaccess/source/filter/hsqldb/hsqlbinarynode.hxx3
-rw-r--r--dbaccess/source/filter/hsqldb/hsqlimport.cxx16
-rw-r--r--dbaccess/source/filter/hsqldb/hsqlimport.hxx3
4 files changed, 17 insertions, 11 deletions
diff --git a/dbaccess/source/filter/hsqldb/hsqlbinarynode.cxx b/dbaccess/source/filter/hsqldb/hsqlbinarynode.cxx
index c7e07ec90b83..89371c735c44 100644
--- a/dbaccess/source/filter/hsqldb/hsqlbinarynode.cxx
+++ b/dbaccess/source/filter/hsqldb/hsqlbinarynode.cxx
@@ -48,9 +48,11 @@ void HsqlBinaryNode::readChildren(HsqlRowInputStream const& input)
}
std::vector<css::uno::Any> HsqlBinaryNode::readRow(HsqlRowInputStream& input,
- const ColumnTypeVector& aColTypes)
+ const ColumnTypeVector& aColTypes,
+ sal_Int32 nIndexCount)
{
- input.seek(m_nPos + 20); // go to data
+ // skip first 4 bytes (size), and index nodes, 16 bytes each
+ input.seek(m_nPos + 4 + nIndexCount * 16);
return input.readOneRow(aColTypes);
}
diff --git a/dbaccess/source/filter/hsqldb/hsqlbinarynode.hxx b/dbaccess/source/filter/hsqldb/hsqlbinarynode.hxx
index 0f9271b8eef1..e03a88a72de8 100644
--- a/dbaccess/source/filter/hsqldb/hsqlbinarynode.hxx
+++ b/dbaccess/source/filter/hsqldb/hsqlbinarynode.hxx
@@ -57,7 +57,8 @@ public:
* @param rInput input stream where the row should be read from.
*/
std::vector<css::uno::Any> readRow(HsqlRowInputStream& rInput,
- const std::vector<ColumnDefinition>& aColTypes);
+ const std::vector<ColumnDefinition>& aColTypes,
+ sal_Int32 nIndexCount);
};
}
diff --git a/dbaccess/source/filter/hsqldb/hsqlimport.cxx b/dbaccess/source/filter/hsqldb/hsqlimport.cxx
index 409ad54447d1..707e34eaaa6c 100644
--- a/dbaccess/source/filter/hsqldb/hsqlimport.cxx
+++ b/dbaccess/source/filter/hsqldb/hsqlimport.cxx
@@ -229,23 +229,24 @@ void HsqlImporter::insertRow(const RowVector& xRows, const OUString& sTableName,
}
void HsqlImporter::processTree(HsqlBinaryNode& rNode, HsqlRowInputStream& rStream,
- const ColumnTypeVector& rColTypes, const OUString& sTableName)
+ const ColumnTypeVector& rColTypes, const OUString& sTableName,
+ sal_Int32 nIndexCount)
{
rNode.readChildren(rStream);
sal_Int32 nNext = rNode.getLeft();
if (nNext > 0)
{
HsqlBinaryNode aLeft{ nNext };
- processTree(aLeft, rStream, rColTypes, sTableName);
+ processTree(aLeft, rStream, rColTypes, sTableName, nIndexCount);
}
- std::vector<Any> row = rNode.readRow(rStream, rColTypes);
+ std::vector<Any> row = rNode.readRow(rStream, rColTypes, nIndexCount);
insertRow(row, sTableName, rColTypes);
nNext = rNode.getRight();
if (nNext > 0)
{
HsqlBinaryNode aRight{ nNext };
- processTree(aRight, rStream, rColTypes, sTableName);
+ processTree(aRight, rStream, rColTypes, sTableName, nIndexCount);
}
}
@@ -278,11 +279,12 @@ void HsqlImporter::parseTableRows(const IndexVector& rIndexes,
Reference<XInputStream> xInput = xStream->getInputStream();
rowInput.setInputStream(xInput);
- for (const auto& rIndex : rIndexes)
+ if (rIndexes.size() > 0)
{
- HsqlBinaryNode aNode{ rIndex };
- processTree(aNode, rowInput, rColTypes, sTableName);
+ HsqlBinaryNode aPrimaryNode{ rIndexes.at(0) };
+ processTree(aPrimaryNode, rowInput, rColTypes, sTableName, rIndexes.size());
}
+
xInput->closeInput();
}
diff --git a/dbaccess/source/filter/hsqldb/hsqlimport.hxx b/dbaccess/source/filter/hsqldb/hsqlimport.hxx
index 1df9ddbc3a10..12d0489cb852 100644
--- a/dbaccess/source/filter/hsqldb/hsqlimport.hxx
+++ b/dbaccess/source/filter/hsqldb/hsqlimport.hxx
@@ -29,7 +29,8 @@ protected:
void insertRow(const std::vector<css::uno::Any>& xRows, const OUString& sTable,
const std::vector<ColumnDefinition>& rColTypes);
void processTree(HsqlBinaryNode& rNode, HsqlRowInputStream& rStream,
- const std::vector<ColumnDefinition>& rColTypes, const OUString& sTableName);
+ const std::vector<ColumnDefinition>& rColTypes, const OUString& sTableName,
+ sal_Int32 nIndexCount);
void parseTableRows(const std::vector<sal_Int32>& rIndexes,
const std::vector<ColumnDefinition>& rColTypes, const OUString& sTableName);