diff --git a/source/shared/core_sqlsrv.h b/source/shared/core_sqlsrv.h index 128ae11c8..b623c1b4a 100644 --- a/source/shared/core_sqlsrv.h +++ b/source/shared/core_sqlsrv.h @@ -1429,7 +1429,7 @@ struct sqlsrv_stmt : public sqlsrv_context { std::vector param_descriptions; // meta data for current result set - std::vector > current_meta_data; + std::vector> current_meta_data; sqlsrv_stmt( _In_ sqlsrv_conn* c, _In_ SQLHANDLE handle, _In_ error_callback e, _In_opt_ void* drv TSRMLS_DC ); virtual ~sqlsrv_stmt( void ); diff --git a/source/sqlsrv/stmt.cpp b/source/sqlsrv/stmt.cpp index 50ed4ca56..3da4ebcc7 100644 --- a/source/sqlsrv/stmt.cpp +++ b/source/sqlsrv/stmt.cpp @@ -471,7 +471,7 @@ PHP_FUNCTION( sqlsrv_field_metadata ) try { - // get the number of fields in the resultset + // get the number of fields in the resultset and its metadata if not exists SQLSMALLINT num_cols = get_resultset_meta_data(stmt); zval result_meta_data; @@ -490,8 +490,6 @@ PHP_FUNCTION( sqlsrv_field_metadata ) core::sqlsrv_add_assoc_string(*stmt, &field_array, FieldMetaData::NAME, reinterpret_cast(core_meta_data->field_name.get()), 1 TSRMLS_CC); - // core_meta_data->field_name.transferred(); - core::sqlsrv_add_assoc_long( *stmt, &field_array, FieldMetaData::TYPE, core_meta_data->field_type TSRMLS_CC ); switch( core_meta_data->field_type ) { @@ -530,9 +528,6 @@ PHP_FUNCTION( sqlsrv_field_metadata ) // add this field's meta data to the result set meta data core::sqlsrv_add_next_index_zval( *stmt, &result_meta_data, &field_array TSRMLS_CC ); - - // always good to call destructor for allocations done through placement new operator. - // core_meta_data->~field_meta_data(); } // return our built collection and transfer ownership @@ -1823,7 +1818,7 @@ void fetch_fields_common( _Inout_ ss_sqlsrv_stmt* stmt, _In_ zend_long fetch_typ throw ss::SSException(); } - // get the numer of columns in the result set + // get the numer of columns in the result set and its metadata if not exists SQLSMALLINT num_cols = get_resultset_meta_data(stmt); // if this is the first fetch in a new result set, then get the field names and