Updated to handle non-encrypted data (#724)

updated to handle non-encrypted data
This commit is contained in:
v-susanh 2018-03-17 00:22:50 -07:00 committed by GitHub
parent af54c9eaeb
commit b5821b28f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 27 deletions

View file

@ -80,17 +80,19 @@ foreach ($dataTypes as $dataType) {
}
sqlsrv_execute($stmt);
$errors = sqlsrv_errors();
if (empty($errors)) {
if (empty($errors) && AE\IsDataEncrypted()) {
// SQLSRV_PHPTYPE_DATETIME not supported
echo "$dataType should not be compatible with any datetime type.\n";
$success = false;
}
}
}
}
}
// cleanup
sqlsrv_free_stmt($stmt);
}
}
}
sqlsrv_query($conn, "TRUNCATE TABLE $tbname");
if ($success) {
echo "Test successfully done.\n";

View file

@ -104,6 +104,7 @@ foreach ($dataTypes as $dataType) {
}
}
else {
if (AE\IsDataEncrypted() || stripos("SQLSRV_SQLTYPE_" . $dataType, $sqlType) !== false) {
if ($dataType == "float" || $dataType == "real") {
if (abs($c_detOut - $inputValues[0]) > $epsilon || abs($c_randOut - $inputValues[1]) > $epsilon) {
echo "Incorrect output retrieved for datatype $dataType and sqlType $sqlType:\n";
@ -120,6 +121,7 @@ foreach ($dataTypes as $dataType) {
}
}
}
}
sqlsrv_free_stmt($stmt);
}
@ -134,6 +136,7 @@ foreach ($dataTypes as $dataType) {
if ($success) {
echo "Test successfully done.\n";
}
dropTable($conn, $tbname);
}

View file

@ -89,6 +89,7 @@ foreach ($dataTypes as $dataType) {
}
else
{
if (AE\IsDataEncrypted() || stripos("SQLSRV_SQLTYPE_" . $dataType, $sqlType) !== false) {
if ($c_detOut != $inputValues[0] || $c_randOut != $inputValues[1]) {
echo "Incorrect output retrieved for datatype $dataType and sqlType $sqlType:\n";
print(" c_det: " . $c_detOut . "\n");
@ -96,6 +97,7 @@ foreach ($dataTypes as $dataType) {
$success = false;
}
}
}
sqlsrv_free_stmt($stmt);
}