diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2012-11-01 14:19:14 +0100 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2012-11-02 10:54:12 +0100 |
commit | 10359585eb1fa338b686c288c1d3b3e0fe9fca66 (patch) | |
tree | 2ef2c81441026c718c258d19451f1d453e00eab3 /connectivity/source/drivers | |
parent | 20380f26b47faffe0cf541f46b8706439a5d4219 (diff) |
Columns should know their table
For example dbaccess::OSingleSelectQueryComposer::appendOrderByColumn expects it
(via impl_getColumnName_throw via getTableAlias)
There is some vagueness:
Should the TableName property contain just the table name,
or the *composed* table name
(that is with catalog and/or schema if used by this DB)?
In the case of a query, should it contain the table name (alias)
*in* *the* *query* or of the original table?
In the former case, what meaning do SchemaName and CatalogName have?
They should be empty?
For now, commit as such and deal with the fallout, if any,
when it hits the fan.
If we really need to store these *different* values,
(that is, some code validly needs them)
it would be easier / cleaner / ...
to define *different* properties
for these *different* notions.
Change-Id: I032e619a60e7563cd51478db16cb5e0e5452bfde
Diffstat (limited to 'connectivity/source/drivers')
-rw-r--r-- | connectivity/source/drivers/calc/CTable.cxx | 3 | ||||
-rw-r--r-- | connectivity/source/drivers/dbase/DIndexColumns.cxx | 5 | ||||
-rw-r--r-- | connectivity/source/drivers/dbase/DTable.cxx | 3 | ||||
-rw-r--r-- | connectivity/source/drivers/evoab2/NColumns.cxx | 15 | ||||
-rw-r--r-- | connectivity/source/drivers/file/FColumns.cxx | 12 | ||||
-rw-r--r-- | connectivity/source/drivers/file/FPreparedStatement.cxx | 5 | ||||
-rw-r--r-- | connectivity/source/drivers/flat/ETable.cxx | 3 | ||||
-rw-r--r-- | connectivity/source/drivers/mozab/MColumns.cxx | 13 | ||||
-rw-r--r-- | connectivity/source/drivers/mozab/MPreparedStatement.cxx | 5 |
9 files changed, 48 insertions, 16 deletions
diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx index da8cbe573657..ff3c33319a48 100644 --- a/connectivity/source/drivers/calc/CTable.cxx +++ b/connectivity/source/drivers/calc/CTable.cxx @@ -514,7 +514,8 @@ void OCalcTable::fillColumns() sdbcx::OColumn* pColumn = new sdbcx::OColumn( aAlias, aTypeName, ::rtl::OUString(),::rtl::OUString(), ColumnValue::NULLABLE, nPrecision, nDecimals, eType, sal_False, sal_False, bCurrency, - bStoresMixedCaseQuotedIdentifiers); + bStoresMixedCaseQuotedIdentifiers, + m_CatalogName, getSchema(), getName()); Reference< XPropertySet> xCol = pColumn; m_aColumns->get().push_back(xCol); m_aTypes.push_back(eType); diff --git a/connectivity/source/drivers/dbase/DIndexColumns.cxx b/connectivity/source/drivers/dbase/DIndexColumns.cxx index 1fbff248ee24..73aa3d525cda 100644 --- a/connectivity/source/drivers/dbase/DIndexColumns.cxx +++ b/connectivity/source/drivers/dbase/DIndexColumns.cxx @@ -59,7 +59,10 @@ sdbcx::ObjectType ODbaseIndexColumns::createObject(const ::rtl::OUString& _rName ,sal_False ,sal_False ,sal_False - ,pTable->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers()); + ,pTable->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers() + ,getString(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_CATALOGNAME))) + ,getString(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCHEMANAME))) + ,getString(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TABLENAME)))); return xRet; } diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index f1bdb3237a94..499b238284cf 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -436,7 +436,8 @@ OSL_TRACE("column type: %c",aDBFColumn.db_typ); sal_False, bIsRowVersion, bIsCurrency, - bCase); + bCase, + m_CatalogName, getSchema(), getName()); m_aColumns->get().push_back(xCol); } // for (; i < nFieldCount; i++) OSL_ENSURE(i,"No columns in table!"); diff --git a/connectivity/source/drivers/evoab2/NColumns.cxx b/connectivity/source/drivers/evoab2/NColumns.cxx index c4cae93cfcfe..b131bc36bb95 100644 --- a/connectivity/source/drivers/evoab2/NColumns.cxx +++ b/connectivity/source/drivers/evoab2/NColumns.cxx @@ -37,10 +37,14 @@ using namespace connectivity::evoab; // ------------------------------------------------------------------------- sdbcx::ObjectType OEvoabColumns::createObject(const ::rtl::OUString& _rName) { + const Any aCatalog; + const ::rtl::OUString sCatalogName; + const ::rtl::OUString sSchemaName(m_pTable->getSchema()); + const ::rtl::OUString sTableName(m_pTable->getTableName()); Reference< XResultSet > xResult = m_pTable->getConnection()->getMetaData()->getColumns( - Any(), - m_pTable->getSchema(), - m_pTable->getTableName(), + aCatalog, + sSchemaName, + sTableName, _rName); sdbcx::ObjectType xRet = NULL; @@ -64,7 +68,10 @@ sdbcx::ObjectType OEvoabColumns::createObject(const ::rtl::OUString& _rName) sal_False, sal_False, sal_False, - sal_True); + sal_True, + sCatalogName, + sSchemaName, + sTableName); xRet = pRet; break; } diff --git a/connectivity/source/drivers/file/FColumns.cxx b/connectivity/source/drivers/file/FColumns.cxx index f916b2ddd7bc..199c0acda4d3 100644 --- a/connectivity/source/drivers/file/FColumns.cxx +++ b/connectivity/source/drivers/file/FColumns.cxx @@ -37,9 +37,12 @@ using namespace ::com::sun::star::lang; sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName) { - + const Any aCatalog; + const ::rtl::OUString sCatalogName; + const ::rtl::OUString sSchemaName(m_pTable->getSchema()); + const ::rtl::OUString sTableName(m_pTable->getName()); Reference< XResultSet > xResult = m_pTable->getConnection()->getMetaData()->getColumns(Any(), - m_pTable->getSchema(),m_pTable->getName(),_rName); + sSchemaName, sTableName, _rName); sdbcx::ObjectType xRet = NULL; if(xResult.is()) @@ -60,7 +63,10 @@ sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName) sal_False, sal_False, sal_False, - m_pTable->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers()); + m_pTable->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers(), + sCatalogName, + sSchemaName, + sTableName); xRet = pRet; break; } diff --git a/connectivity/source/drivers/file/FPreparedStatement.cxx b/connectivity/source/drivers/file/FPreparedStatement.cxx index 0d810fcc2b32..f99cf3c959b6 100644 --- a/connectivity/source/drivers/file/FPreparedStatement.cxx +++ b/connectivity/source/drivers/file/FPreparedStatement.cxx @@ -506,7 +506,10 @@ sal_uInt32 OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Re ,eType ,sal_False ,sal_False - ,m_aSQLIterator.isCaseSensitive()); + ,m_aSQLIterator.isCaseSensitive() + ,::rtl::OUString() + ,::rtl::OUString() + ,::rtl::OUString()); m_xParamColumns->get().push_back(xParaColumn); return m_xParamColumns->get().size(); } diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index 14732280c6af..110f40195be4 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -171,7 +171,8 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) sal_False, sal_False, sal_False, - bCase); + bCase, + m_CatalogName, getSchema(), getName()); Reference< XPropertySet> xCol = pColumn; m_aColumns->get().push_back(xCol); } diff --git a/connectivity/source/drivers/mozab/MColumns.cxx b/connectivity/source/drivers/mozab/MColumns.cxx index f6fb6e217942..786280cbbe5e 100644 --- a/connectivity/source/drivers/mozab/MColumns.cxx +++ b/connectivity/source/drivers/mozab/MColumns.cxx @@ -43,8 +43,12 @@ using namespace ::com::sun::star::lang; sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName) { - Reference< XResultSet > xResult = m_pTable->getConnection()->getMetaData()->getColumns(Any(), - m_pTable->getSchema(),m_pTable->getTableName(),_rName); + const Any aCatalog; + const ::rtl::OUString sCatalogName; + const ::rtl::OUString sSchemaName(m_pTable->getSchema()); + const ::rtl::OUString sTableName(m_pTable->getTableName()); + Reference< XResultSet > xResult = m_pTable->getConnection()->getMetaData()->getColumns( + aCatalog, sSchemaName, sTableName, _rName); sdbcx::ObjectType xRet = NULL; if(xResult.is()) @@ -66,7 +70,10 @@ sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName) nPrec, xRow->getInt(9), nType, - sal_False,sal_False,sal_False,sal_True); + sal_False,sal_False,sal_False,sal_True, + sCatalogName, + sSchemaName, + sTableName); xRet = pRet; break; } diff --git a/connectivity/source/drivers/mozab/MPreparedStatement.cxx b/connectivity/source/drivers/mozab/MPreparedStatement.cxx index 9a650effd215..971749d03cc0 100644 --- a/connectivity/source/drivers/mozab/MPreparedStatement.cxx +++ b/connectivity/source/drivers/mozab/MPreparedStatement.cxx @@ -443,7 +443,10 @@ size_t OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Refere ,sal_False ,sal_False ,sal_False - ,m_pSQLIterator->isCaseSensitive()); + ,m_pSQLIterator->isCaseSensitive() + ,::rtl::OUString() + ,::rtl::OUString() + ,::rtl::OUString()); m_xParamColumns->get().push_back(xParaColumn); return nParameter; } |