Kaydet (Commit) 76d3e871 authored tarafından Lionel Elie Mamane's avatar Lionel Elie Mamane

ODBC SQLBindParameter nitpick: correct DecimalDigits for exact numeric values

The driver is supposed to ignore it as per the spec, but let's be
conservative and pass the value defined by the spec.

Leave it as invalid for approximate (floating-point) datatypes.

Change-Id: I542fdde5e711a335c708ad9e6f2abe2fd8632ef6
Reviewed-on: https://gerrit.libreoffice.org/20685Reviewed-by: 's avatarLionel Elie Mamane <lionel@mamane.lu>
Tested-by: 's avatarLionel Elie Mamane <lionel@mamane.lu>
üst 0df0ab1b
......@@ -415,7 +415,7 @@ void OPreparedStatement::setParameter(const sal_Int32 parameterIndex, const sal_
void SAL_CALL OPreparedStatement::setByte( const sal_Int32 parameterIndex, const sal_Int8 x ) throw(SQLException, RuntimeException, std::exception)
{
setScalarParameter(parameterIndex, DataType::TINYINT, 3, x);
setScalarParameter(parameterIndex, DataType::TINYINT, 3, 0, x);
}
void SAL_CALL OPreparedStatement::setDate( sal_Int32 parameterIndex, const Date& aData ) throw(SQLException, RuntimeException, std::exception)
......@@ -501,7 +501,7 @@ void SAL_CALL OPreparedStatement::setFloat( sal_Int32 parameterIndex, float x )
void SAL_CALL OPreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(SQLException, RuntimeException, std::exception)
{
setScalarParameter(parameterIndex, DataType::INTEGER, 10, x);
setScalarParameter(parameterIndex, DataType::INTEGER, 10, 0, x);
}
......@@ -509,7 +509,7 @@ void SAL_CALL OPreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 x
{
try
{
setScalarParameter(parameterIndex, DataType::BIGINT, 19, x);
setScalarParameter(parameterIndex, DataType::BIGINT, 19, 0, x);
}
catch(SQLException&)
{
......@@ -635,7 +635,7 @@ void SAL_CALL OPreparedStatement::setObject( sal_Int32 parameterIndex, const Any
void SAL_CALL OPreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 x ) throw(SQLException, RuntimeException, std::exception)
{
setScalarParameter(parameterIndex, DataType::SMALLINT, 5, x);
setScalarParameter(parameterIndex, DataType::SMALLINT, 5, 0, x);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment