summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorWastack <btomi96@gmail.com>2016-12-15 12:19:59 +0100
committerJulien Nabet <serval2412@yahoo.fr>2016-12-20 18:18:03 +0000
commitef1aee0f80d34b75b0d406abc708a0e8316fe5e8 (patch)
treebdc98574fefbb70ee04cb46af4fd0424b52b16cb /connectivity
parent9abac96518125dddd29ef1e2b4b84429f8ca88a5 (diff)
tdf#70506 implement getColumnLabel function
which is responsible for aliasnames defined with the SQL 'AS' keyword. Change-Id: I6aaf1ba6969e2bd738941e41492338382168bc89 Reviewed-on: https://gerrit.libreoffice.org/32042 Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/firebird/ResultSetMetaData.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/connectivity/source/drivers/firebird/ResultSetMetaData.cxx b/connectivity/source/drivers/firebird/ResultSetMetaData.cxx
index 6b6d9849e6af..7d2dd2f392a5 100644
--- a/connectivity/source/drivers/firebird/ResultSetMetaData.cxx
+++ b/connectivity/source/drivers/firebird/ResultSetMetaData.cxx
@@ -128,8 +128,13 @@ OUString SAL_CALL OResultSetMetaData::getColumnTypeName(sal_Int32 column)
OUString SAL_CALL OResultSetMetaData::getColumnLabel(sal_Int32 column)
throw(SQLException, RuntimeException, std::exception)
{
- // TODO: clarify what this is -- probably not the alias
- return getColumnName(column);
+ // aliasname
+ verifyValidColumn(column);
+ OUString sRet(m_pSqlda->sqlvar[column-1].aliasname,
+ m_pSqlda->sqlvar[column-1].aliasname_length,
+ RTL_TEXTENCODING_UTF8);
+ sanitizeIdentifier(sRet);
+ return sRet;
}
OUString SAL_CALL OResultSetMetaData::getColumnServiceName(sal_Int32 column)