@@ -471,7 +471,7 @@ PHP_FUNCTION( sqlsrv_field_metadata )
471
471
472
472
try {
473
473
474
- // get the number of fields in the resultset
474
+ // get the number of fields in the resultset and its metadata if not exists
475
475
SQLSMALLINT num_cols = get_resultset_meta_data (stmt);
476
476
477
477
zval result_meta_data;
@@ -490,8 +490,6 @@ PHP_FUNCTION( sqlsrv_field_metadata )
490
490
core::sqlsrv_add_assoc_string (*stmt, &field_array, FieldMetaData::NAME,
491
491
reinterpret_cast <char *>(core_meta_data->field_name .get ()), 1 TSRMLS_CC);
492
492
493
- // core_meta_data->field_name.transferred();
494
-
495
493
core::sqlsrv_add_assoc_long ( *stmt, &field_array, FieldMetaData::TYPE, core_meta_data->field_type TSRMLS_CC );
496
494
497
495
switch ( core_meta_data->field_type ) {
@@ -530,9 +528,6 @@ PHP_FUNCTION( sqlsrv_field_metadata )
530
528
531
529
// add this field's meta data to the result set meta data
532
530
core::sqlsrv_add_next_index_zval ( *stmt, &result_meta_data, &field_array TSRMLS_CC );
533
-
534
- // always good to call destructor for allocations done through placement new operator.
535
- // core_meta_data->~field_meta_data();
536
531
}
537
532
538
533
// 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
1823
1818
throw ss::SSException ();
1824
1819
}
1825
1820
1826
- // get the numer of columns in the result set
1821
+ // get the numer of columns in the result set and its metadata if not exists
1827
1822
SQLSMALLINT num_cols = get_resultset_meta_data (stmt);
1828
1823
1829
1824
// if this is the first fetch in a new result set, then get the field names and
0 commit comments