diff options
author | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2013-07-21 18:07:35 +0200 |
---|---|---|
committer | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2013-07-21 18:47:13 +0200 |
commit | 51a42da0c6d60a95ca35c90e2a8a4dc27efdf40f (patch) | |
tree | 7562708a3002be7953035e047114ea3119eb9ccf | |
parent | 229a9c1ca024958808d7f6decad6213b20862abd (diff) |
Add theoretical support for table descriptions (firebird-sdbc).
Untestable as we currently can't write blobs and therefore
don't have any way of reading blobs.
Change-Id: I7226bf89ec014c796279ce8075f1b82f36c3b7b1
-rw-r--r-- | connectivity/source/drivers/firebird/FDatabaseMetaData.cxx | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx index 0997e64588a6..6745046b93ed 100644 --- a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx +++ b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx @@ -872,11 +872,6 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables( (void) schemaPattern; (void) types; // TODO: implement types - // TODO: RDB$DESCRIPTION is a BLOB column with user defined data. - // Blobs cannot be retrieved with DSQL queries so we need to define - // all the data we will be using at compile time instead -- i.e. we need - // to specifically do the whole isc_* stuff here with the datatypes - // compiled in. SAL_INFO("connectivity.firebird", "getTables() with " "TableNamePattern: " << tableNamePattern); @@ -888,7 +883,8 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables( // TODO: OUStringBuf OUStringBuffer queryBuf( "SELECT " - "RDB$RELATION_NAME, RDB$SYSTEM_FLAG, RDB$RELATION_TYPE " //, RDB$DESCRIPTION + "RDB$RELATION_NAME, RDB$SYSTEM_FLAG, RDB$RELATION_TYPE, " + "RDB$DESCRIPTION " "FROM RDB$RELATIONS " "WHERE (RDB$RELATION_TYPE = 0 OR RDB$RELATION_TYPE = 1)"); @@ -914,10 +910,19 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables( { ODatabaseMetaDataResultSet::ORow aCurrentRow(3); - OUString aTableName = xRow->getString(1); - sal_Int16 systemFlag = xRow->getShort(2); - sal_Int16 tableType = xRow->getShort(3); - OUString aDescription; // xRow->getString(4); + OUString aTableName = xRow->getString(1); + sal_Int16 systemFlag = xRow->getShort(2); + sal_Int16 tableType = xRow->getShort(3); + uno::Reference< XBlob > xBlob = xRow->getBlob(4); + + OUString aDescription; + if (xBlob.is()) + { + sal_Int32 aBlobLength = (sal_Int32) xBlob->length(); + aDescription = OUString((char*) xBlob->getBytes(0, aBlobLength).getArray(), + aBlobLength, + RTL_TEXTENCODING_UTF8); + } OUString aTableType; if( 1 == systemFlag ) |