diff --git a/source/shared/core_stmt.cpp b/source/shared/core_stmt.cpp index 1dc1dff3..a871e01a 100644 --- a/source/shared/core_stmt.cpp +++ b/source/shared/core_stmt.cpp @@ -420,10 +420,11 @@ void core_sqlsrv_bind_param( _Inout_ sqlsrv_stmt* stmt, _In_ SQLUSMALLINT param_ } } - // if it's an output parameter and the user asks for a certain type, we have to convert the zval to that type so - // when the buffer is filled, the type is correct - CHECK_CUSTOM_ERROR( direction != SQL_PARAM_INPUT && (sql_type == SQL_LONGVARCHAR - || sql_type == SQL_WLONGVARCHAR || sql_type == SQL_LONGVARBINARY), + // If the user specifies a certain type for an output parameter, we have to convert the zval + // to that type so that when the buffer is filled, the type is correct. But first, + // should check that if a LOB type is specified. + CHECK_CUSTOM_ERROR( direction != SQL_PARAM_INPUT && ( sql_type == SQL_LONGVARCHAR + || sql_type == SQL_WLONGVARCHAR || sql_type == SQL_LONGVARBINARY ), stmt, SQLSRV_ERROR_OUTPUT_PARAM_TYPES_NOT_SUPPORTED ){ throw core::CoreException(); } diff --git a/test/functional/sqlsrv/srv_231_string_truncation_text.phpt b/test/functional/sqlsrv/srv_231_string_truncation_text.phpt index 51c5e84b..2e2107c2 100644 --- a/test/functional/sqlsrv/srv_231_string_truncation_text.phpt +++ b/test/functional/sqlsrv/srv_231_string_truncation_text.phpt @@ -76,7 +76,8 @@ function invokeProc($conn, $procName, $k, $direction, $data) $initData = "ShortString"; $callResult = $initData; - // Make sure not to specify the PHP type + // No need to specify the SQLSRV PHP type but must specify SQLSRV SQL Type + // when AE is enabled $intType = AE\isColEncrypted()? SQLSRV_SQLTYPE_INT : null; $params = array( array( $k, SQLSRV_PARAM_IN, null, $intType ), array( &$callResult, $direction, null, $sqlsrvSQLType ));