summaryrefslogtreecommitdiff
path: root/connectivity/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-10-17 15:14:02 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-17 18:16:28 +0200
commit3ebbb150242cf049a9ddab7f498c63f3a44aa034 (patch)
tree3bdf235f490b173919369e7062570322effa795d /connectivity/source
parent73df133143daaff14c364468598bb250db6aecb1 (diff)
loplugin:buffereadd find stuff involving adding *StringBuffer
and create conversion methods on *StringBuffer to make this work Change-Id: I3cf5ee3e139826168894b46eff8ee4bcde00cb7e Reviewed-on: https://gerrit.libreoffice.org/80949 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source')
-rw-r--r--connectivity/source/drivers/firebird/DatabaseMetaData.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
index b0344b5f8b8f..c152694a5963 100644
--- a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
+++ b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
@@ -1566,22 +1566,18 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys(
SAL_INFO("connectivity.firebird", "getPrimaryKeys() with "
"Table: " << sTable);
- OUStringBuffer aQueryBuf("SELECT "
+ OUString sAppend = "WHERE constr.RDB$RELATION_NAME = '%' ";
+ OUString sQuery = "SELECT "
"constr.RDB$RELATION_NAME, " // 1. Table Name
"inds.RDB$FIELD_NAME, " // 2. Column Name
"inds.RDB$FIELD_POSITION, " // 3. Sequence Number
"constr.RDB$CONSTRAINT_NAME " // 4 Constraint name
"FROM RDB$RELATION_CONSTRAINTS 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();
+ "on (constr.RDB$INDEX_NAME = inds.RDB$INDEX_NAME) " +
+ sAppend.replaceAll("%", sTable) +
+ "AND constr.RDB$CONSTRAINT_TYPE = 'PRIMARY KEY' "
+ "ORDER BY inds.RDB$FIELD_NAME";
uno::Reference< XStatement > xStatement = m_pConnection->createStatement();
uno::Reference< XResultSet > xRs = xStatement->executeQuery(sQuery);