Modified comments as per review feedback

This commit is contained in:
Jenny Tam 2017-11-03 11:14:55 -07:00
parent e5a3767089
commit b44a5dd1fb
2 changed files with 7 additions and 5 deletions

View file

@ -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();
}

View file

@ -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 ));