summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2019-09-21 15:22:16 +0200
committerJulien Nabet <serval2412@yahoo.fr>2019-09-23 08:49:55 +0200
commitf23e19cd15f14566832befba73fb6bbc1cffb0d7 (patch)
treecb379364627e2b5479d4fa7d25d8d19f60849bbd /connectivity
parent3fbccd6820855123a11009f963cfe37cf133e678 (diff)
tdf#127657: FIREBIRD error in query input param when referred field is integer
Change-Id: I626c8a8869570986d0293cd9070a1ee40ec585dc Reviewed-on: https://gerrit.libreoffice.org/79314 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/firebird/PreparedStatement.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index 71a43454f315..4586cc4a3ba4 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -229,6 +229,20 @@ void SAL_CALL OPreparedStatement::setString(sal_Int32 nParameterIndex,
assert( pVar->sqlsubtype == static_cast<short>(BlobSubtype::Clob) );
setClob(nParameterIndex, sInput );
break;
+ case SQL_SHORT:
+ {
+ sal_Int32 int32Value = sInput.toInt32();
+ if ( (int32Value < std::numeric_limits<sal_Int16>::min()) ||
+ (int32Value > std::numeric_limits<sal_Int16>::max()) )
+ {
+ ::dbtools::throwSQLException(
+ "Value out of range for SQL_SHORT type",
+ ::dbtools::StandardSQLState::INVALID_SQL_DATA_TYPE,
+ *this);
+ }
+ setShort(nParameterIndex, int32Value);
+ break;
+ }
default:
::dbtools::throwSQLException(
"Incorrect type for setString",