fixed Github #182, empty bound output parameters

This commit is contained in:
Hadis-Fard 2016-12-09 13:05:20 -08:00
parent d3b4e38aad
commit e7fd159435
2 changed files with 2 additions and 2 deletions

View file

@ -1990,7 +1990,7 @@ void finalize_output_parameters( sqlsrv_stmt* stmt TSRMLS_DC )
// adjust the length of the string to the value returned by SQLBindParameter in the ind_ptr parameter
char* str = Z_STRVAL_P( value_z );
SQLLEN str_len = stmt->param_ind_ptrs[ output_param->param_num ];
if( str_len == SQL_NULL_DATA ) {
if( str_len == SQL_NULL_DATA || str_len == 0 ) {
zend_string_release( Z_STR_P( value_z ));
ZVAL_NULL( value_z );
continue;

View file

@ -1990,7 +1990,7 @@ void finalize_output_parameters( sqlsrv_stmt* stmt TSRMLS_DC )
// adjust the length of the string to the value returned by SQLBindParameter in the ind_ptr parameter
char* str = Z_STRVAL_P( value_z );
SQLLEN str_len = stmt->param_ind_ptrs[ output_param->param_num ];
if( str_len == SQL_NULL_DATA ) {
if( str_len == SQL_NULL_DATA || str_len == 0) {
zend_string_release( Z_STR_P( value_z ));
ZVAL_NULL( value_z );
continue;