connectivity/Library_firebird_sdbc.mk | 16 connectivity/source/drivers/firebird/Blob.cxx | 2 connectivity/source/drivers/firebird/Connection.cxx | 737 ++++ connectivity/source/drivers/firebird/Connection.hxx | 183 + connectivity/source/drivers/firebird/DatabaseMetaData.cxx | 1660 +++++++++++ connectivity/source/drivers/firebird/DatabaseMetaData.hxx | 205 + connectivity/source/drivers/firebird/Driver.cxx | 222 + connectivity/source/drivers/firebird/Driver.hxx | 79 connectivity/source/drivers/firebird/FConnection.cxx | 737 ---- connectivity/source/drivers/firebird/FConnection.hxx | 183 - connectivity/source/drivers/firebird/FDatabaseMetaData.cxx | 1588 ---------- connectivity/source/drivers/firebird/FDatabaseMetaData.hxx | 204 - connectivity/source/drivers/firebird/FDriver.cxx | 221 - connectivity/source/drivers/firebird/FDriver.hxx | 78 connectivity/source/drivers/firebird/FPreparedStatement.cxx | 570 --- connectivity/source/drivers/firebird/FPreparedStatement.hxx | 167 - connectivity/source/drivers/firebird/FResultSet.cxx | 1025 ------ connectivity/source/drivers/firebird/FResultSet.hxx | 307 -- connectivity/source/drivers/firebird/FResultSetMetaData.cxx | 210 - connectivity/source/drivers/firebird/FResultSetMetaData.hxx | 107 connectivity/source/drivers/firebird/FServices.cxx | 134 connectivity/source/drivers/firebird/FStatement.cxx | 213 - connectivity/source/drivers/firebird/FStatement.hxx | 86 connectivity/source/drivers/firebird/FSubComponent.hxx | 147 connectivity/source/drivers/firebird/PreparedStatement.cxx | 570 +++ connectivity/source/drivers/firebird/PreparedStatement.hxx | 167 + connectivity/source/drivers/firebird/ResultSet.cxx | 1024 ++++++ connectivity/source/drivers/firebird/ResultSet.hxx | 307 ++ connectivity/source/drivers/firebird/ResultSetMetaData.cxx | 210 + connectivity/source/drivers/firebird/ResultSetMetaData.hxx | 107 connectivity/source/drivers/firebird/Services.cxx | 135 connectivity/source/drivers/firebird/Statement.cxx | 213 + connectivity/source/drivers/firebird/Statement.hxx | 86 connectivity/source/drivers/firebird/StatementCommonBase.cxx | 4 connectivity/source/drivers/firebird/StatementCommonBase.hxx | 2 connectivity/source/drivers/firebird/SubComponent.hxx | 148 36 files changed, 6065 insertions(+), 5989 deletions(-)
New commits: commit da25756ba9a6b7ea51625dc5ca9291d209867068 Author: Andrzej J.R. Hunt <andr...@ahunt.org> Date: Wed Jul 31 16:03:29 2013 +0200 Remove unnecessary F- prefix for firebird-sdbc files. Change-Id: I6574ef7fd1c26770a74b2d1f2b0d997fcca97779 diff --git a/connectivity/Library_firebird_sdbc.mk b/connectivity/Library_firebird_sdbc.mk index 6030fec..1893718 100644 --- a/connectivity/Library_firebird_sdbc.mk +++ b/connectivity/Library_firebird_sdbc.mk @@ -38,14 +38,14 @@ $(eval $(call gb_Library_set_componentfile,firebird_sdbc,connectivity/source/dri $(eval $(call gb_Library_add_exception_objects,firebird_sdbc,\ connectivity/source/drivers/firebird/Blob \ - connectivity/source/drivers/firebird/FConnection \ - connectivity/source/drivers/firebird/FDatabaseMetaData \ - connectivity/source/drivers/firebird/FDriver \ - connectivity/source/drivers/firebird/FPreparedStatement \ - connectivity/source/drivers/firebird/FResultSet \ - connectivity/source/drivers/firebird/FResultSetMetaData \ - connectivity/source/drivers/firebird/FServices \ - connectivity/source/drivers/firebird/FStatement \ + connectivity/source/drivers/firebird/Connection \ + connectivity/source/drivers/firebird/DatabaseMetaData \ + connectivity/source/drivers/firebird/Driver \ + connectivity/source/drivers/firebird/PreparedStatement \ + connectivity/source/drivers/firebird/ResultSet \ + connectivity/source/drivers/firebird/ResultSetMetaData \ + connectivity/source/drivers/firebird/Services \ + connectivity/source/drivers/firebird/Statement \ connectivity/source/drivers/firebird/StatementCommonBase \ connectivity/source/drivers/firebird/Util \ )) diff --git a/connectivity/source/drivers/firebird/Blob.cxx b/connectivity/source/drivers/firebird/Blob.cxx index 8423b28..f27835d 100644 --- a/connectivity/source/drivers/firebird/Blob.cxx +++ b/connectivity/source/drivers/firebird/Blob.cxx @@ -8,7 +8,7 @@ */ #include "Blob.hxx" -#include "FConnection.hxx" +#include "Connection.hxx" #include "Util.hxx" #include "connectivity/dbexception.hxx" diff --git a/connectivity/source/drivers/firebird/FConnection.cxx b/connectivity/source/drivers/firebird/Connection.cxx similarity index 99% rename from connectivity/source/drivers/firebird/FConnection.cxx rename to connectivity/source/drivers/firebird/Connection.cxx index 6fb8578..96ed57c 100644 --- a/connectivity/source/drivers/firebird/FConnection.cxx +++ b/connectivity/source/drivers/firebird/Connection.cxx @@ -17,11 +17,11 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "FConnection.hxx" -#include "FDatabaseMetaData.hxx" -#include "FDriver.hxx" -#include "FPreparedStatement.hxx" -#include "FStatement.hxx" +#include "Connection.hxx" +#include "DatabaseMetaData.hxx" +#include "Driver.hxx" +#include "PreparedStatement.hxx" +#include "Statement.hxx" #include "Util.hxx" diff --git a/connectivity/source/drivers/firebird/FConnection.hxx b/connectivity/source/drivers/firebird/Connection.hxx similarity index 98% rename from connectivity/source/drivers/firebird/FConnection.hxx rename to connectivity/source/drivers/firebird/Connection.hxx index 96b97ec..559bba9 100644 --- a/connectivity/source/drivers/firebird/FConnection.hxx +++ b/connectivity/source/drivers/firebird/Connection.hxx @@ -21,27 +21,27 @@ #define CONNECTIVITY_FIREBIRD_CONNECTION_HXX #include "Blob.hxx" +#include "SubComponent.hxx" + +#include <ibase.h> + +#include <connectivity/CommonTools.hxx> +#include <connectivity/OSubComponent.hxx> +#include <cppuhelper/compbase4.hxx> +#include <cppuhelper/weakref.hxx> +#include <map> +#include <OTypeInfo.hxx> -#include <com/sun/star/sdbc/SQLWarning.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/document/DocumentEvent.hpp> #include <com/sun/star/document/XDocumentEventListener.hpp> #include <com/sun/star/embed/XStorage.hpp> -#include "connectivity/OSubComponent.hxx" -#include "connectivity/CommonTools.hxx" -#include "FSubComponent.hxx" - -#include "OTypeInfo.hxx" #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> -#include <com/sun/star/sdbc/XWarningsSupplier.hpp> +#include <com/sun/star/sdbc/SQLWarning.hpp> #include <com/sun/star/sdbc/XConnection.hpp> -#include <cppuhelper/compbase4.hxx> -#include <cppuhelper/weakref.hxx> -#include <map> - -#include <ibase.h> +#include <com/sun/star/sdbc/XWarningsSupplier.hpp> namespace connectivity { diff --git a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx similarity index 99% rename from connectivity/source/drivers/firebird/FDatabaseMetaData.cxx rename to connectivity/source/drivers/firebird/DatabaseMetaData.cxx index bf7fadc..943bb82 100644 --- a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx +++ b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx @@ -17,12 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "FDatabaseMetaData.hxx" -#include "FDatabaseMetaDataResultSet.hxx" +#include "DatabaseMetaData.hxx" #include "Util.hxx" #include <ibase.h> #include <rtl/ustrbuf.hxx> +#include <FDatabaseMetaDataResultSet.hxx> #include <com/sun/star/sdbc/ColumnValue.hpp> #include <com/sun/star/sdbc/DataType.hpp> diff --git a/connectivity/source/drivers/firebird/FDatabaseMetaData.hxx b/connectivity/source/drivers/firebird/DatabaseMetaData.hxx similarity index 99% rename from connectivity/source/drivers/firebird/FDatabaseMetaData.hxx rename to connectivity/source/drivers/firebird/DatabaseMetaData.hxx index 3b2da61..54ef0db 100644 --- a/connectivity/source/drivers/firebird/FDatabaseMetaData.hxx +++ b/connectivity/source/drivers/firebird/DatabaseMetaData.hxx @@ -20,7 +20,8 @@ #ifndef CONNECTIVITY_FIREBIRD_DATABASEMETADATA_HXX #define CONNECTIVITY_FIREBIRD_DATABASEMETADATA_HXX -#include "FConnection.hxx" +#include "Connection.hxx" + #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> #include <cppuhelper/implbase1.hxx> diff --git a/connectivity/source/drivers/firebird/FDriver.cxx b/connectivity/source/drivers/firebird/Driver.cxx similarity index 99% rename from connectivity/source/drivers/firebird/FDriver.cxx rename to connectivity/source/drivers/firebird/Driver.cxx index 4ddab75..21afe46 100644 --- a/connectivity/source/drivers/firebird/FDriver.cxx +++ b/connectivity/source/drivers/firebird/Driver.cxx @@ -17,8 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "FDriver.hxx" -#include "FConnection.hxx" +#include "Connection.hxx" +#include "Driver.hxx" + #include "connectivity/dbexception.hxx" #include "resource/common_res.hrc" #include "resource/hsqldb_res.hrc" diff --git a/connectivity/source/drivers/firebird/FDriver.hxx b/connectivity/source/drivers/firebird/Driver.hxx similarity index 99% rename from connectivity/source/drivers/firebird/FDriver.hxx rename to connectivity/source/drivers/firebird/Driver.hxx index 442d520..fcb0f57 100644 --- a/connectivity/source/drivers/firebird/FDriver.hxx +++ b/connectivity/source/drivers/firebird/Driver.hxx @@ -20,10 +20,11 @@ #ifndef CONNECTIVITY_FIREBIRD_DRIVER_HXX #define CONNECTIVITY_FIREBIRD_DRIVER_HXX +#include "Connection.hxx" + #include <com/sun/star/sdbc/XDriver.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <cppuhelper/compbase2.hxx> -#include "FConnection.hxx" namespace connectivity { diff --git a/connectivity/source/drivers/firebird/FPreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx similarity index 99% rename from connectivity/source/drivers/firebird/FPreparedStatement.cxx rename to connectivity/source/drivers/firebird/PreparedStatement.cxx index 441b86b..aeddb14 100644 --- a/connectivity/source/drivers/firebird/FPreparedStatement.cxx +++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx @@ -17,10 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "FConnection.hxx" -#include "FPreparedStatement.hxx" -#include "FResultSetMetaData.hxx" -#include "FResultSet.hxx" +#include "Connection.hxx" +#include "PreparedStatement.hxx" +#include "ResultSet.hxx" +#include "ResultSetMetaData.hxx" #include "Util.hxx" #include <comphelper/sequence.hxx> diff --git a/connectivity/source/drivers/firebird/FPreparedStatement.hxx b/connectivity/source/drivers/firebird/PreparedStatement.hxx similarity index 99% rename from connectivity/source/drivers/firebird/FPreparedStatement.hxx rename to connectivity/source/drivers/firebird/PreparedStatement.hxx index 0399d6a..60d5c66 100644 --- a/connectivity/source/drivers/firebird/FPreparedStatement.hxx +++ b/connectivity/source/drivers/firebird/PreparedStatement.hxx @@ -20,7 +20,7 @@ #ifndef CONNECTIVITY_FIREBIRD_PREPAREDSTATEMENT_HXX #define CONNECTIVITY_FIREBIRD_PREPAREDSTATEMENT_HXX -#include "FStatement.hxx" +#include "Statement.hxx" #include <cppuhelper/implbase5.hxx> diff --git a/connectivity/source/drivers/firebird/FResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx similarity index 99% rename from connectivity/source/drivers/firebird/FResultSet.cxx rename to connectivity/source/drivers/firebird/ResultSet.cxx index ca0ded1..36c59af 100644 --- a/connectivity/source/drivers/firebird/FResultSet.cxx +++ b/connectivity/source/drivers/firebird/ResultSet.cxx @@ -17,18 +17,17 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "FResultSet.hxx" -#include "FResultSetMetaData.hxx" +#include "ResultSet.hxx" +#include "ResultSetMetaData.hxx" #include "Util.hxx" -#include <propertyids.hxx> -#include <TConnection.hxx> - -#include <connectivity/dbexception.hxx> #include <comphelper/sequence.hxx> #include <cppuhelper/typeprovider.hxx> +#include <connectivity/dbexception.hxx> +#include <propertyids.hxx> #include <rtl/string.hxx> #include <rtl/ustrbuf.hxx> +#include <TConnection.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/lang/DisposedException.hpp> diff --git a/connectivity/source/drivers/firebird/FResultSet.hxx b/connectivity/source/drivers/firebird/ResultSet.hxx similarity index 99% rename from connectivity/source/drivers/firebird/FResultSet.hxx rename to connectivity/source/drivers/firebird/ResultSet.hxx index cd0ee5a..a741295 100644 --- a/connectivity/source/drivers/firebird/FResultSet.hxx +++ b/connectivity/source/drivers/firebird/ResultSet.hxx @@ -20,7 +20,7 @@ #ifndef CONNECTIVITY_FIREBIRD_RESULTSET_HXX #define CONNECTIVITY_FIREBIRD_RESULTSET_HXX -#include "FStatement.hxx" +#include "Statement.hxx" #include <ibase.h> diff --git a/connectivity/source/drivers/firebird/FResultSetMetaData.cxx b/connectivity/source/drivers/firebird/ResultSetMetaData.cxx similarity index 99% rename from connectivity/source/drivers/firebird/FResultSetMetaData.cxx rename to connectivity/source/drivers/firebird/ResultSetMetaData.cxx index f699b8f..9bcc6b3 100644 --- a/connectivity/source/drivers/firebird/FResultSetMetaData.cxx +++ b/connectivity/source/drivers/firebird/ResultSetMetaData.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "FResultSetMetaData.hxx" +#include "ResultSetMetaData.hxx" #include "Util.hxx" #include <com/sun/star/sdbc/ColumnValue.hpp> diff --git a/connectivity/source/drivers/firebird/FResultSetMetaData.hxx b/connectivity/source/drivers/firebird/ResultSetMetaData.hxx similarity index 99% rename from connectivity/source/drivers/firebird/FResultSetMetaData.hxx rename to connectivity/source/drivers/firebird/ResultSetMetaData.hxx index 4aa4f9a..23a7377 100644 --- a/connectivity/source/drivers/firebird/FResultSetMetaData.hxx +++ b/connectivity/source/drivers/firebird/ResultSetMetaData.hxx @@ -20,7 +20,7 @@ #ifndef CONNECTIVITY_FIREBIRD_RESULTSETMETADATA_HXX #define CONNECTIVITY_FIREBIRD_RESULTSETMETADATA_HXX -#include "FConnection.hxx" +#include "Connection.hxx" #include <ibase.h> diff --git a/connectivity/source/drivers/firebird/FServices.cxx b/connectivity/source/drivers/firebird/Services.cxx similarity index 99% rename from connectivity/source/drivers/firebird/FServices.cxx rename to connectivity/source/drivers/firebird/Services.cxx index 65068a7..a60aad0 100644 --- a/connectivity/source/drivers/firebird/FServices.cxx +++ b/connectivity/source/drivers/firebird/Services.cxx @@ -17,10 +17,11 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <sal/types.h> -#include "FDriver.hxx" +#include "Driver.hxx" + #include <cppuhelper/factory.hxx> #include <osl/diagnose.h> +#include <sal/types.h> using namespace connectivity::firebird; using ::rtl::OUString; diff --git a/connectivity/source/drivers/firebird/FStatement.cxx b/connectivity/source/drivers/firebird/Statement.cxx similarity index 98% rename from connectivity/source/drivers/firebird/FStatement.cxx rename to connectivity/source/drivers/firebird/Statement.cxx index 36d2704..7378e5c 100644 --- a/connectivity/source/drivers/firebird/FStatement.cxx +++ b/connectivity/source/drivers/firebird/Statement.cxx @@ -17,10 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "FDriver.hxx" -#include "FStatement.hxx" -#include "FConnection.hxx" -#include "FResultSet.hxx" +#include "Connection.hxx" +#include "Driver.hxx" +#include "ResultSet.hxx" +#include "Statement.hxx" #include "Util.hxx" #include <comphelper/sequence.hxx> @@ -28,10 +28,10 @@ #include <osl/thread.h> #include <rtl/ustrbuf.hxx> +#include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/sdbc/ResultSetConcurrency.hpp> #include <com/sun/star/sdbc/ResultSetType.hpp> #include <com/sun/star/sdbc/FetchDirection.hpp> -#include <com/sun/star/lang/DisposedException.hpp> using namespace connectivity::firebird; diff --git a/connectivity/source/drivers/firebird/FStatement.hxx b/connectivity/source/drivers/firebird/Statement.hxx similarity index 100% rename from connectivity/source/drivers/firebird/FStatement.hxx rename to connectivity/source/drivers/firebird/Statement.hxx diff --git a/connectivity/source/drivers/firebird/StatementCommonBase.cxx b/connectivity/source/drivers/firebird/StatementCommonBase.cxx index e562c87..eba79de 100644 --- a/connectivity/source/drivers/firebird/StatementCommonBase.cxx +++ b/connectivity/source/drivers/firebird/StatementCommonBase.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "FDriver.hxx" -#include "FResultSet.hxx" +#include "Driver.hxx" +#include "ResultSet.hxx" #include "StatementCommonBase.hxx" #include "Util.hxx" diff --git a/connectivity/source/drivers/firebird/StatementCommonBase.hxx b/connectivity/source/drivers/firebird/StatementCommonBase.hxx index 97c72c9..99f4563 100644 --- a/connectivity/source/drivers/firebird/StatementCommonBase.hxx +++ b/connectivity/source/drivers/firebird/StatementCommonBase.hxx @@ -20,7 +20,7 @@ #ifndef CONNECTIVITY_FIREBIRD_STATEMENT_BASE_HXX #define CONNECTIVITY_FIREBIRD_STATEMENT_BASE_HXX -#include "FConnection.hxx" +#include "Connection.hxx" #include <ibase.h> diff --git a/connectivity/source/drivers/firebird/FSubComponent.hxx b/connectivity/source/drivers/firebird/SubComponent.hxx similarity index 99% rename from connectivity/source/drivers/firebird/FSubComponent.hxx rename to connectivity/source/drivers/firebird/SubComponent.hxx index 929d318..2417427 100644 --- a/connectivity/source/drivers/firebird/FSubComponent.hxx +++ b/connectivity/source/drivers/firebird/SubComponent.hxx @@ -20,12 +20,13 @@ #ifndef CONNECTIVITY_FIREBIRD_SUBCOMPONENT_HXX #define CONNECTIVITY_FIREBIRD_SUBCOMPONENT_HXX -#include <cppuhelper/weak.hxx> #include <cppuhelper/interfacecontainer.h> -#include <com/sun/star/lang/DisposedException.hpp> #include <cppuhelper/propshlp.hxx> -#include <osl/mutex.hxx> +#include <cppuhelper/weak.hxx> #include <osl/diagnose.h> +#include <osl/mutex.hxx> + +#include <com/sun/star/lang/DisposedException.hpp> namespace cppu { class IPropertyArrayHelper; commit 289741da6d5f1e7130f27e62b7ec4819da849d22 Author: Andrzej J.R. Hunt <andr...@ahunt.org> Date: Wed Jul 31 15:40:39 2013 +0200 Optimise getPrimaryKeys a bit. (firebird-sdbc) Change-Id: I93d0a460b8c855596969a16fc33b31f9e0065624 diff --git a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx index d5478f7..bf7fadc 100644 --- a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx +++ b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx @@ -1492,7 +1492,10 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys( while(xRs->next()) { // 3. Table Name - aCurrentRow[3] = new ORowSetValueDecorator(xRow->getString(1)); + if (xRs->getRow() == 1) // Table name doesn't change, so only retrieve once + { + aCurrentRow[3] = new ORowSetValueDecorator(xRow->getString(1)); + } // 4. Column Name aCurrentRow[4] = new ORowSetValueDecorator(xRow->getString(2)); // 5. KEY_SEQ (which key in the sequence) commit a55178ee66d1920a9bd9e7dda3d599a4b86f328a Author: Andrzej J.R. Hunt <andr...@ahunt.org> Date: Wed Jul 31 15:20:32 2013 +0200 Implement getPrimaryKeys. (firebird-sdbc) Change-Id: I7ccd013eaaf1c06b5eecae4b51bf607561531200 diff --git a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx index 5df5323..d5478f7 100644 --- a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx +++ b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx @@ -1449,15 +1449,64 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys( (void) table; return NULL; } -// ------------------------------------------------------------------------- + uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys( - const Any& catalog, const OUString& schema, const OUString& table ) throw(SQLException, RuntimeException) + const Any& aCatalog, + const OUString& sSchema, + const OUString& sTable) + throw(SQLException, RuntimeException) { - SAL_WARN("connectivity.firebird", "Not yet implemented"); - (void) catalog; - (void) schema; - (void) table; - return NULL; + (void) aCatalog; + (void) sSchema; + SAL_INFO("connectivity.firebird", "getPrimaryKeys() with " + "Table: " << sTable); + + OUStringBuffer aQueryBuf("SELECT " + "constr.RDB$RELATION_NAME, " // 1. Table Name + "inds.RDB$FIELD_NAME, " // 2. Column Name + "inds.RDB$SORT_ORDER, " // 3. Sequence Number + "constr.RDB$CONSTRAINT_NAME, " // 4 Constraint name + "FROM RDB$RELATION_FIELDS constr " + "JOIN RDB$INDEX_SEGMENTS inds " + "on (constr.RDB$INDEX_NAME = inds.RDB$INDEX_NAME) "); + + OUString sAppend = "WHERE constr.RDB$RELATION_NAME = '%' "; + aQueryBuf.append(sAppend.replaceAll("%", sTable)); + + aQueryBuf.append("AND constr.RDB$CONSTRAINT_TYPE = 'PRIMARY KEY' " + "ORDER BY inds.RDB$FIELD_NAME"); + + OUString sQuery = aQueryBuf.makeStringAndClear(); + + uno::Reference< XStatement > xStatement = m_pConnection->createStatement(); + uno::Reference< XResultSet > xRs = xStatement->executeQuery(sQuery); + uno::Reference< XRow > xRow( xRs, UNO_QUERY_THROW ); + + ODatabaseMetaDataResultSet::ORows aResults; + ODatabaseMetaDataResultSet::ORow aCurrentRow(7); + + aCurrentRow[0] = new ORowSetValueDecorator(); // Unused -- numbering starts from 0 + aCurrentRow[1] = new ORowSetValueDecorator(); // Catalog - can be null + aCurrentRow[2] = new ORowSetValueDecorator(); // Schema - can be null + + while(xRs->next()) + { + // 3. Table Name + aCurrentRow[3] = new ORowSetValueDecorator(xRow->getString(1)); + // 4. Column Name + aCurrentRow[4] = new ORowSetValueDecorator(xRow->getString(2)); + // 5. KEY_SEQ (which key in the sequence) + aCurrentRow[5] = new ORowSetValueDecorator(xRow->getShort(3)); + // 6. Primary Key Name + aCurrentRow[6] = new ORowSetValueDecorator(xRow->getString(4)); + + aResults.push_back(aCurrentRow); + } + ODatabaseMetaDataResultSet* pResultSet = new ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTables); + uno::Reference< XResultSet > xResultSet = pResultSet; + pResultSet->setRows( aResults ); + + return xResultSet; } // ------------------------------------------------------------------------- uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getIndexInfo( commit 08c4c6327d0aebb991e190e3c149ad364af098fc Author: Andrzej J.R. Hunt <andr...@ahunt.org> Date: Wed Jul 31 12:53:33 2013 +0200 Fix getTablePrivileges, warn on unimplemented methods. (firebird-sdbc) Change-Id: Ibf32f31d8b78c632c947a8b7546464b0b457ee08 diff --git a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx index a4a0ef4..5df5323 100644 --- a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx +++ b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx @@ -1401,6 +1401,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedureColumns( const Any& catalog, const OUString& schemaPattern, const OUString& procedureNamePattern, const OUString& columnNamePattern ) throw(SQLException, RuntimeException) { + SAL_WARN("connectivity.firebird", "Not yet implemented"); (void) catalog; (void) schemaPattern; (void) procedureNamePattern; @@ -1412,6 +1413,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures( const Any& catalog, const OUString& schemaPattern, const OUString& procedureNamePattern ) throw(SQLException, RuntimeException) { + SAL_WARN("connectivity.firebird", "Not yet implemented"); (void) catalog; (void) schemaPattern; (void) procedureNamePattern; @@ -1421,6 +1423,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures( uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getVersionColumns( const Any& catalog, const OUString& schema, const OUString& table ) throw(SQLException, RuntimeException) { + SAL_WARN("connectivity.firebird", "Not yet implemented"); (void) catalog; (void) schema; (void) table; @@ -1430,6 +1433,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getVersionColumns( uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getExportedKeys( const Any& catalog, const OUString& schema, const OUString& table ) throw(SQLException, RuntimeException) { + SAL_WARN("connectivity.firebird", "Not yet implemented"); (void) catalog; (void) schema; (void) table; @@ -1439,6 +1443,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getExportedKeys( uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys( const Any& catalog, const OUString& schema, const OUString& table ) throw(SQLException, RuntimeException) { + SAL_WARN("connectivity.firebird", "Not yet implemented"); (void) catalog; (void) schema; (void) table; @@ -1448,6 +1453,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys( uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys( const Any& catalog, const OUString& schema, const OUString& table ) throw(SQLException, RuntimeException) { + SAL_WARN("connectivity.firebird", "Not yet implemented"); (void) catalog; (void) schema; (void) table; @@ -1529,7 +1535,9 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges( while( rs->next() ) { - ODatabaseMetaDataResultSet::ORow aCurrentRow(7); + // TODO: avoid reallocations + ODatabaseMetaDataResultSet::ORow aCurrentRow; + aCurrentRow.reserve(7); // 1. TABLE_CAT aCurrentRow.push_back(new ORowSetValueDecorator()); commit 6523504d5bedad19ce8ca6a28916045ad17d6263 Author: Andrzej J.R. Hunt <andr...@ahunt.org> Date: Wed Jul 31 12:32:11 2013 +0200 Some more DatabaseMetaData (firebird-sdbc). Change-Id: I9ac7043878acc5738582ecf6091230cdd7b63152 diff --git a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx index 4dece2d..a4a0ef4 100644 --- a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx +++ b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx @@ -242,16 +242,76 @@ sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseIdentifiers() return sal_True; } -// ------------------------------------------------------------------------- -sal_Bool SAL_CALL ODatabaseMetaData::supportsAlterTableWithAddColumn( ) throw(SQLException, RuntimeException) +// ---- SQL Feature Support --------------------------------------------------- +sal_Bool SAL_CALL ODatabaseMetaData::supportsAlterTableWithAddColumn() + throw(SQLException, RuntimeException) +{ + return sal_True; +} + +sal_Bool SAL_CALL ODatabaseMetaData::supportsAlterTableWithDropColumn() + throw(SQLException, RuntimeException) +{ + return sal_True; +} + +sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedDelete() + throw(SQLException, RuntimeException) { + return sal_True; +} + +sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedUpdate() + throw(SQLException, RuntimeException) +{ + return sal_True; +} + +sal_Bool SAL_CALL ODatabaseMetaData::supportsOuterJoins() + throw(SQLException, RuntimeException) +{ + return sal_True; +} + +sal_Bool SAL_CALL ODatabaseMetaData::supportsSelectForUpdate() + throw(SQLException, RuntimeException) +{ + return sal_True; +} + +sal_Bool SAL_CALL ODatabaseMetaData::allTablesAreSelectable() + throw(SQLException, RuntimeException) +{ + // TODO: true if embedded, but unsure about remote server + return sal_True; +} + +sal_Bool SAL_CALL ODatabaseMetaData::supportsConvert(sal_Int32 fromType, + sal_Int32 toType) + throw(SQLException, RuntimeException) +{ + (void) fromType; + (void) toType; return sal_False; } -// ------------------------------------------------------------------------- -sal_Bool SAL_CALL ODatabaseMetaData::supportsAlterTableWithDropColumn( ) throw(SQLException, RuntimeException) + +sal_Bool SAL_CALL ODatabaseMetaData::supportsTypeConversion() + throw(SQLException, RuntimeException) { return sal_False; } + +sal_Bool SAL_CALL ODatabaseMetaData::supportsColumnAliasing() + throw(SQLException, RuntimeException) +{ + return sal_True; +} + +sal_Bool SAL_CALL ODatabaseMetaData::supportsTableCorrelationNames() + throw(SQLException, RuntimeException) +{ + return sal_True; +} // ------------------------------------------------------------------------- sal_Int32 SAL_CALL ODatabaseMetaData::getMaxIndexLength( ) throw(SQLException, RuntimeException) { @@ -295,16 +355,6 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsDataDefinitionAndDataManipulationTr return sal_True; } // ------------------------------------------------------------------------- -sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedDelete( ) throw(SQLException, RuntimeException) -{ - return sal_False; -} -// ------------------------------------------------------------------------- -sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedUpdate( ) throw(SQLException, RuntimeException) -{ - return sal_False; -} -// ------------------------------------------------------------------------- sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossRollback( ) throw(SQLException, RuntimeException) { return sal_False; @@ -361,11 +411,6 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInTableDefinitions( ) throw return sal_False; } // ------------------------------------------------------------------------- -sal_Bool SAL_CALL ODatabaseMetaData::supportsOuterJoins( ) throw(SQLException, RuntimeException) -{ - return sal_False; -} -// ------------------------------------------------------------------------- sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatements( ) throw(SQLException, RuntimeException) { sal_Int32 nValue = 0; // 0 means no limit @@ -399,16 +444,6 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsStoredProcedures( ) throw(SQLExcep return sal_True; } // ------------------------------------------------------------------------- -sal_Bool SAL_CALL ODatabaseMetaData::supportsSelectForUpdate( ) throw(SQLException, RuntimeException) -{ - return sal_False; -} -// ------------------------------------------------------------------------- -sal_Bool SAL_CALL ODatabaseMetaData::allTablesAreSelectable( ) throw(SQLException, RuntimeException) -{ - return sal_False; -} -// ------------------------------------------------------------------------- sal_Bool SAL_CALL ODatabaseMetaData::isReadOnly( ) throw(SQLException, RuntimeException) { return m_pConnection->isReadOnly(); @@ -424,33 +459,11 @@ sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFilePerTable( ) throw(SQLExceptio return sal_False; } // ------------------------------------------------------------------------- -sal_Bool SAL_CALL ODatabaseMetaData::supportsTypeConversion( ) throw(SQLException, RuntimeException) -{ - return sal_False; -} -// ------------------------------------------------------------------------- sal_Bool SAL_CALL ODatabaseMetaData::nullPlusNonNullIsNull( ) throw(SQLException, RuntimeException) { return sal_False; } // ------------------------------------------------------------------------- -sal_Bool SAL_CALL ODatabaseMetaData::supportsColumnAliasing( ) throw(SQLException, RuntimeException) -{ - return sal_False; -} -// ------------------------------------------------------------------------- -sal_Bool SAL_CALL ODatabaseMetaData::supportsTableCorrelationNames( ) throw(SQLException, RuntimeException) -{ - return sal_False; -} -// ------------------------------------------------------------------------- -sal_Bool SAL_CALL ODatabaseMetaData::supportsConvert( sal_Int32 fromType, sal_Int32 toType ) throw(SQLException, RuntimeException) -{ - (void) fromType; - (void) toType; - return sal_False; -} -// ------------------------------------------------------------------------- sal_Bool SAL_CALL ODatabaseMetaData::supportsExpressionsInOrderBy( ) throw(SQLException, RuntimeException) { return sal_False; commit 9f2c95533df5205953db54926f3d953ea2ac5b3f Author: Andrzej J.R. Hunt <andr...@ahunt.org> Date: Wed Jul 31 12:06:22 2013 +0200 Avoid repeated allocations in getColumns. (firebird-sdbc) Change-Id: I3d519815c42899f7cd60c6f06887cac7341e192b diff --git a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx index 99880ac..4dece2d 100644 --- a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx +++ b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx @@ -1040,6 +1040,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumnPrivileges( while( rs->next() ) { + // TODO: avoid reallocations here. ODatabaseMetaDataResultSet::ORow aCurrentRow; aCurrentRow.reserve(9); @@ -1152,34 +1153,34 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns( uno::Reference< XRow > xRow( rs, UNO_QUERY_THROW ); ODatabaseMetaDataResultSet::ORows aResults; + ODatabaseMetaDataResultSet::ORow aCurrentRow(19); + + aCurrentRow[0] = new ORowSetValueDecorator(); // Unused -- numbering starts from 0 + aCurrentRow[1] = new ORowSetValueDecorator(); // Catalog - can be null + aCurrentRow[2] = new ORowSetValueDecorator(); // Schema - can be null + aCurrentRow[8] = new ORowSetValueDecorator(); // Unused + aCurrentRow[10] = new ORowSetValueDecorator(sal_Int32(10)); // Radix: fixed in FB + aCurrentRow[14] = new ORowSetValueDecorator(); // Unused + aCurrentRow[15] = new ORowSetValueDecorator(); // Unused while( rs->next() ) { - ODatabaseMetaDataResultSet::ORow aCurrentRow; - aCurrentRow.reserve(19); - - // 0. EMPTY - aCurrentRow.push_back(new ORowSetValueDecorator()); - // 1. TABLE_CAT (catalog) may be null - aCurrentRow.push_back(new ORowSetValueDecorator()); - // 2. TABLE_SCHEM (schema) may be null - aCurrentRow.push_back(new ORowSetValueDecorator()); // 3. TABLE_NAME { OUString aTableName = xRow->getString(1); - aCurrentRow.push_back(new ORowSetValueDecorator(aTableName)); + aCurrentRow[3] = new ORowSetValueDecorator(aTableName); } // 4. Column Name { OUString aColumnName = xRow->getString(2); - aCurrentRow.push_back(new ORowSetValueDecorator(aColumnName)); + aCurrentRow[4] = new ORowSetValueDecorator(aColumnName); } // 5. Datatype short aType = getFBTypeFromBlrType(xRow->getShort(6)); - aCurrentRow.push_back(new ORowSetValueDecorator(getColumnTypeFromFBType(aType))); + aCurrentRow[5] = new ORowSetValueDecorator(getColumnTypeFromFBType(aType)); // 6. Typename (SQL_*) - aCurrentRow.push_back(new ORowSetValueDecorator(getColumnTypeNameFromFBType(aType))); + aCurrentRow[6] = new ORowSetValueDecorator(getColumnTypeNameFromFBType(aType)); // 7. Column Sizes { @@ -1208,23 +1209,21 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns( // TODO: implement. break; } - aCurrentRow.push_back(new ORowSetValueDecorator(aColumnSize)); + aCurrentRow[7] = new ORowSetValueDecorator(aColumnSize); } - // 8. Unused - aCurrentRow.push_back(new ORowSetValueDecorator()); + // 9. Decimal Digits // TODO: implement - aCurrentRow.push_back(new ORowSetValueDecorator(sal_Int32(0))); - // 10. Radix - aCurrentRow.push_back(new ORowSetValueDecorator(sal_Int32(10))); + aCurrentRow[9] = new ORowSetValueDecorator(sal_Int32(0)); + // 11. Nullable if (xRow->getShort(9)) { - aCurrentRow.push_back(new ORowSetValueDecorator(ColumnValue::NO_NULLS)); + aCurrentRow[11] = new ORowSetValueDecorator(ColumnValue::NO_NULLS); } else { - aCurrentRow.push_back(new ORowSetValueDecorator(ColumnValue::NULLABLE)); + aCurrentRow[11] = new ORowSetValueDecorator(ColumnValue::NULLABLE); } // 12. Comments -- may be omitted { @@ -1237,7 +1236,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns( aBlobLength, RTL_TEXTENCODING_UTF8); } - aCurrentRow.push_back(new ORowSetValueDecorator(aDescription)); + aCurrentRow[12] = new ORowSetValueDecorator(aDescription); } // 13. Default -- may be omitted. { @@ -1246,40 +1245,37 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns( { // TODO: Implement } - aCurrentRow.push_back(new ORowSetValueDecorator()); + aCurrentRow[13] = new ORowSetValueDecorator(); } - // 14. Unused - aCurrentRow.push_back(new ORowSetValueDecorator()); - // 15. Unused - aCurrentRow.push_back(new ORowSetValueDecorator()); + // 16. Bytes in Column for char if (aType == SQL_TEXT) { - aCurrentRow.push_back(new ORowSetValueDecorator(xRow->getShort(7))); + aCurrentRow[16] = new ORowSetValueDecorator(xRow->getShort(7)); } else if (aType == SQL_VARYING) { - aCurrentRow.push_back(new ORowSetValueDecorator(sal_Int32(32767))); + aCurrentRow[16] = new ORowSetValueDecorator(sal_Int32(32767)); } else { - aCurrentRow.push_back(new ORowSetValueDecorator(sal_Int32(0))); + aCurrentRow[16] = new ORowSetValueDecorator(sal_Int32(0)); } // 17. Index of column { - short aColumnNumber = xRow->getShort(5); + short nColumnNumber = xRow->getShort(5); // Firebird stores column numbers beginning with 0 internally // SDBC expects column numbering to begin with 1. - aCurrentRow.push_back(new ORowSetValueDecorator(sal_Int32(aColumnNumber + 1))); + aCurrentRow[17] = new ORowSetValueDecorator(sal_Int32(nColumnNumber + 1)); } // 18. Is nullable if (xRow->getShort(9)) { - aCurrentRow.push_back(new ORowSetValueDecorator(OUString("NO"))); + aCurrentRow[18] = new ORowSetValueDecorator(OUString("NO")); } else { - aCurrentRow.push_back(new ORowSetValueDecorator(OUString("YES"))); + aCurrentRow[18] = new ORowSetValueDecorator(OUString("YES")); } aResults.push_back(aCurrentRow); commit 080555a321e82331ff3531c9066a7282506a1882 Author: Andrzej J.R. Hunt <andr...@ahunt.org> Date: Wed Jul 31 11:48:34 2013 +0200 Some vector cleanup (firebird-sdbc). This also fixes showing of column properties when editing them in base. (Initial size of vector isn't the same as reserving capacity.) Change-Id: Id1406ddde0c68af20d712bc99ed070e6354158a6 diff --git a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx index 52f44ca..99880ac 100644 --- a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx +++ b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx @@ -819,7 +819,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() // Common data aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue(); // Literal quote marks - aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue(); // Literal quote marks // Create Params + aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue(); // Literal quote marks aRow[7] = new ORowSetValueDecorator(sal_Bool(true)); // Nullable aRow[8] = new ORowSetValueDecorator(sal_Bool(true)); // Case sensitive aRow[10] = new ORowSetValueDecorator(sal_Bool(false)); // Is unsigned @@ -835,7 +835,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() aRow[1] = new ORowSetValueDecorator(OUString("CHAR")); aRow[2] = new ORowSetValueDecorator(getColumnTypeFromFBType(SQL_TEXT)); aRow[3] = new ORowSetValueDecorator(sal_Int16(32767)); // Prevision = max length - aRow[6] = new ORowSetValueDecorator(OUString("length")); + aRow[6] = new ORowSetValueDecorator(OUString("length")); // Create Params aRow[9] = new ORowSetValueDecorator( sal_Int16(ColumnSearch::FULL)); // Searchable aRow[11] = new ORowSetValueDecorator(sal_Bool(true)); // Can be money value @@ -848,7 +848,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() aRow[1] = new ORowSetValueDecorator(OUString("VARCHAR")); aRow[2] = new ORowSetValueDecorator(getColumnTypeFromFBType(SQL_VARYING)); aRow[3] = new ORowSetValueDecorator(sal_Int16(32767)); // Prevision = max length - aRow[6] = new ORowSetValueDecorator(OUString("length")); + aRow[6] = new ORowSetValueDecorator(OUString("length")); // Create Params aRow[9] = new ORowSetValueDecorator( sal_Int16(ColumnSearch::FULL)); // Searchable aRow[11] = new ORowSetValueDecorator(sal_Bool(true)); // Can be money value @@ -859,7 +859,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() // Integer Types common { - aRow[6] = new ORowSetValueDecorator(); + aRow[6] = new ORowSetValueDecorator(); // Create Params aRow[9] = new ORowSetValueDecorator( sal_Int16(ColumnSearch::FULL)); // Searchable aRow[11] = new ORowSetValueDecorator(sal_Bool(true)); // Can be money value @@ -885,7 +885,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() // Decimal Types common { - aRow[6] = new ORowSetValueDecorator(); + aRow[6] = new ORowSetValueDecorator(); // Create Params aRow[9] = new ORowSetValueDecorator( sal_Int16(ColumnSearch::FULL)); // Searchable aRow[11] = new ORowSetValueDecorator(sal_Bool(true)); // Can be money value @@ -919,7 +919,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() aRow[1] = new ORowSetValueDecorator(OUString("timestamp")); aRow[2] = new ORowSetValueDecorator(getColumnTypeFromFBType(SQL_TIMESTAMP)); aRow[3] = new ORowSetValueDecorator(sal_Int32(8)); // Prevision = max length - aRow[6] = new ORowSetValueDecorator(); + aRow[6] = new ORowSetValueDecorator(); // Create Params aRow[9] = new ORowSetValueDecorator( sal_Int16(ColumnSearch::FULL)); // Searchable aRow[11] = new ORowSetValueDecorator(sal_Bool(false)); // Can be money value @@ -933,7 +933,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() aRow[1] = new ORowSetValueDecorator(OUString("TIME")); aRow[2] = new ORowSetValueDecorator(getColumnTypeFromFBType(SQL_TYPE_TIME)); aRow[3] = new ORowSetValueDecorator(sal_Int32(8)); // Prevision = max length - aRow[6] = new ORowSetValueDecorator(); + aRow[6] = new ORowSetValueDecorator(); // Create Params aRow[9] = new ORowSetValueDecorator( sal_Int16(ColumnSearch::FULL)); // Searchable aRow[11] = new ORowSetValueDecorator(sal_Bool(false)); // Can be money value @@ -947,7 +947,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() aRow[1] = new ORowSetValueDecorator(OUString("DATE")); aRow[2] = new ORowSetValueDecorator(getColumnTypeFromFBType(SQL_TYPE_DATE)); aRow[3] = new ORowSetValueDecorator(sal_Int32(8)); // Prevision = max length - aRow[6] = new ORowSetValueDecorator(); + aRow[6] = new ORowSetValueDecorator(); // Create Params aRow[9] = new ORowSetValueDecorator( sal_Int16(ColumnSearch::FULL)); // Searchable aRow[11] = new ORowSetValueDecorator(sal_Bool(false)); // Can be money value @@ -961,7 +961,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() aRow[1] = new ORowSetValueDecorator(OUString("BLOB")); aRow[2] = new ORowSetValueDecorator(getColumnTypeFromFBType(SQL_BLOB)); aRow[3] = new ORowSetValueDecorator(sal_Int32(0)); // Prevision = max length - aRow[6] = new ORowSetValueDecorator(); + aRow[6] = new ORowSetValueDecorator(); // Create Params aRow[9] = new ORowSetValueDecorator( sal_Int16(ColumnSearch::NONE)); // Searchable aRow[11] = new ORowSetValueDecorator(sal_Bool(false)); // Can be money value @@ -1040,8 +1040,11 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumnPrivileges( while( rs->next() ) { - ODatabaseMetaDataResultSet::ORow aCurrentRow(8); + ODatabaseMetaDataResultSet::ORow aCurrentRow; + aCurrentRow.reserve(9); + // 0. Empty + aCurrentRow.push_back(new ORowSetValueDecorator()); // 1. TABLE_CAT aCurrentRow.push_back(new ORowSetValueDecorator()); // 2. TABLE_SCHEM @@ -1144,9 +1147,6 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns( OUString query = queryBuf.makeStringAndClear(); - SAL_INFO("connectivity.firebird", "Retrieving columns with " << - OUStringToOString(query,RTL_TEXTENCODING_UTF8).getStr()); - uno::Reference< XStatement > statement = m_pConnection->createStatement(); uno::Reference< XResultSet > rs = statement->executeQuery(query.getStr()); uno::Reference< XRow > xRow( rs, UNO_QUERY_THROW ); @@ -1155,8 +1155,11 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns( while( rs->next() ) { - ODatabaseMetaDataResultSet::ORow aCurrentRow(18); + ODatabaseMetaDataResultSet::ORow aCurrentRow; + aCurrentRow.reserve(19); + // 0. EMPTY + aCurrentRow.push_back(new ORowSetValueDecorator()); // 1. TABLE_CAT (catalog) may be null aCurrentRow.push_back(new ORowSetValueDecorator()); // 2. TABLE_SCHEM (schema) may be null _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits