diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-07-20 04:25:34 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-07-20 07:55:03 +0200 |
commit | 1b796287df8b3dc40ddd905c6f4822c53b36f9b1 (patch) | |
tree | 423a60a976989e8c67887956d6b14cac79adb44d /connectivity/source/drivers/firebird/ResultSetMetaData.cxx | |
parent | 553c128e3fdc4b9612c1150b30d7b89df2ae6fdd (diff) |
tdf#162111: promote integer types automatically
The problem was, that importing an HTML table into Firebird, and creating
a primary key, called OParameterUpdateHelper::updateInt for each record's
primary key field. Since commit c07548447a564b2d142cc439a124b76e6a71dfbd
(Related: tdf#108057 Use autoincrement for automatically added primary key,
2024-03-20), the type of autocreated primary key in Firebird databases is
SQL_INT64, and before this change, OPreparedStatement::setInt failed when
the real field's type wasn't strictly SQL_LONG.
This allows Firebird SDBC's integral OPreparedStatement::set* methods to
promote to larger numeric types capable to represent the values.
Change-Id: I7615c8e9ffa29271d04cf264bb950cb76946dfd6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170787
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'connectivity/source/drivers/firebird/ResultSetMetaData.cxx')
-rw-r--r-- | connectivity/source/drivers/firebird/ResultSetMetaData.cxx | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/connectivity/source/drivers/firebird/ResultSetMetaData.cxx b/connectivity/source/drivers/firebird/ResultSetMetaData.cxx index 4efabc4ab3cc..0a80c851a980 100644 --- a/connectivity/source/drivers/firebird/ResultSetMetaData.cxx +++ b/connectivity/source/drivers/firebird/ResultSetMetaData.cxx @@ -102,10 +102,7 @@ sal_Int32 SAL_CALL OResultSetMetaData::getColumnType(sal_Int32 column) sCharset = getCharacterSet(column); } - ColumnTypeInfo aInfo( m_pSqlda->sqlvar[column-1].sqltype, - m_pSqlda->sqlvar[column-1].sqlsubtype, - -(m_pSqlda->sqlvar[column-1].sqlscale), - sCharset ); + ColumnTypeInfo aInfo(m_pSqlda, column, sCharset); return aInfo.getSdbcType(); } @@ -158,9 +155,7 @@ OUString SAL_CALL OResultSetMetaData::getColumnTypeName(sal_Int32 column) { verifyValidColumn(column); - ColumnTypeInfo aInfo( m_pSqlda->sqlvar[column-1].sqltype, - m_pSqlda->sqlvar[column-1].sqlsubtype, - -(m_pSqlda->sqlvar[column-1].sqlscale) ); + ColumnTypeInfo aInfo(m_pSqlda, column); return aInfo.getColumnTypeName(); } |