Skip to content

Commit cd89b7d

Browse files
committed
Apply review
1 parent f183b2e commit cd89b7d

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

source/shared/core_sqlsrv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,7 @@ struct sqlsrv_stmt : public sqlsrv_context {
14291429
std::vector<param_meta_data> param_descriptions;
14301430

14311431
// meta data for current result set
1432-
std::vector<field_meta_data*, sqlsrv_allocator< field_meta_data* > > current_meta_data;
1432+
std::vector<field_meta_data*, sqlsrv_allocator<field_meta_data*>> current_meta_data;
14331433

14341434
sqlsrv_stmt( _In_ sqlsrv_conn* c, _In_ SQLHANDLE handle, _In_ error_callback e, _In_opt_ void* drv TSRMLS_DC );
14351435
virtual ~sqlsrv_stmt( void );

source/sqlsrv/stmt.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ PHP_FUNCTION( sqlsrv_field_metadata )
471471

472472
try {
473473

474-
// get the number of fields in the resultset
474+
// get the number of fields in the resultset and its metadata if not exists
475475
SQLSMALLINT num_cols = get_resultset_meta_data(stmt);
476476

477477
zval result_meta_data;
@@ -490,8 +490,6 @@ PHP_FUNCTION( sqlsrv_field_metadata )
490490
core::sqlsrv_add_assoc_string(*stmt, &field_array, FieldMetaData::NAME,
491491
reinterpret_cast<char*>(core_meta_data->field_name.get()), 1 TSRMLS_CC);
492492

493-
// core_meta_data->field_name.transferred();
494-
495493
core::sqlsrv_add_assoc_long( *stmt, &field_array, FieldMetaData::TYPE, core_meta_data->field_type TSRMLS_CC );
496494

497495
switch( core_meta_data->field_type ) {
@@ -530,9 +528,6 @@ PHP_FUNCTION( sqlsrv_field_metadata )
530528

531529
// add this field's meta data to the result set meta data
532530
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();
536531
}
537532

538533
// 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
18231818
throw ss::SSException();
18241819
}
18251820

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
18271822
SQLSMALLINT num_cols = get_resultset_meta_data(stmt);
18281823

18291824
// if this is the first fetch in a new result set, then get the field names and

0 commit comments

Comments
 (0)