Skip to content

Commit

Permalink
Fixed a minor issue with a test
Browse files Browse the repository at this point in the history
  • Loading branch information
yitam committed Aug 20, 2018
1 parent 5d1153d commit 2685f0a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/shared/core_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ bool core_sqlsrv_get_odbc_error( _Inout_ sqlsrv_context& ctx, _In_ int record_nu
wnative_message_str = reinterpret_cast<SQLWCHAR*>(sqlsrv_malloc(expected_len));
memset(wnative_message_str, '\0', expected_len);

SQLRETURN rtemp = ::SQLGetDiagFieldW(h_type, h, record_number, SQL_DIAG_MESSAGE_TEXT, wnative_message_str, wmessage_len + 1, &returned_len);
SQLRETURN rtemp = ::SQLGetDiagFieldW(h_type, h, record_number, SQL_DIAG_MESSAGE_TEXT, wnative_message_str, wmessage_len, &returned_len);
if (!SQL_SUCCEEDED(rtemp) || returned_len != expected_len) {
// something went wrong
return false;
Expand Down
10 changes: 7 additions & 3 deletions test/functional/sqlsrv/sqlsrv_ae_type_conversion_select.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ function checkErrors(&$convError)
$convError[0][1] != '8114' and
$convError[0][1] != '8169') {
print_r($convError);
fatalError("Conversion failed with unexpected error message. i=$i, j=$j, v=$v\n");
}
return false;
}

return true;
}

// Build the select queries. We want every combination of types for conversion
Expand Down Expand Up @@ -202,7 +204,9 @@ for ($v = 0; $v < sizeof($values); ++$v) {
if ($stmt == false) {
$convError = sqlsrv_errors();

checkErrors($convError);
if (!checkErrors($convError)) {
fatalError("Conversion failed with unexpected error message. i=$i, j=$j, v=$v\n");
}

if (AE\isDataEncrypted()) {
$stmtAE = sqlsrv_query($conn, $selectQueryAE[$i][$j]);
Expand Down

0 comments on commit 2685f0a

Please sign in to comment.