Skip to content

Commit

Permalink
update AEData.inc and MsCommon_mid-refactor.inc for the ae related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yukiwongky committed Nov 7, 2017
1 parent 1e69c86 commit 8ea405b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions test/functional/pdo_sqlsrv/AEData.inc
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ $pdoParamTypes = array(

// Checks if the current error is the incompatible types error
// if so, state which sql type is incompatible with which data type
function is_incompatible_types_error( $stmt, $dataType, $pdoParamType ) {
if ( $stmt->errorInfo()[0] == "22018" )
function isIncompatibleTypesError($stmt, $dataType, $pdoParamType)
{
if ($stmt->errorInfo()[0] == "22018") {
echo "PDO param type $pdoParamType is incompatible with encrypted $dataType\n";
else
var_dump( $stmt->errorInfo() );
} else {
var_dump($stmt->errorInfo());
}
}

?>
8 changes: 4 additions & 4 deletions test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class ColumnMeta
public function __construct($dataType, $colName = null, $options = null, $encType = "deterministic")
{
if (is_null($colName)) {
$this->colName = get_default_colname($dataType);
$this->colName = getDefaultColName($dataType);
} else {
$this->colName = $colName;
}
Expand Down Expand Up @@ -232,22 +232,22 @@ class BindParamOp
$this->variable = $variable;

$pdoParams = array("PDO::PARAM_BOOL", "PDO::PARAM_NULL", "PDO::PARAM_INT", "PDO::PARAM_STR", "PDO::PARAM_LOB");
if (in_array($pdoType, $pdoParams)) {
if (in_array($pdoType, $pdoParams) || is_null($pdoType)) {
$this->pdoType = $pdoType;
} else {
printf("BindParamOp construct: The pdoType provided must be one of PDO::PARAM_BOOL, PDO::PARAM_NULL, PDO::PARAM_INT, PDO::PARAM_STR, or PDO::PARAM_LOB.\n");
exit;
}

if ($length >= 0) {
if ($length >= 0 || is_null($length)) {
$this->length = $length;
} else {
printf("BindParamOp construct: The length provided must be greater or equal to 0.\n");
exit;
}

$encodingAttrs = array("PDO::SQLSRV_ENCODING_BINARY", "PDO::SQLSRV_ENCODING_SYSTEM", "PDO::SQLSRV_ENCODING_UTF8", "PDO::SQLSRV_ENCODING_DEFAULT");
if (in_array($options, $encodingAttrs)) {
if (in_array($options, $encodingAttrs) || is_null($options)) {
$this->options = $options;
} else {
printf("BindParamOp construct: The option provided must be one of PDO::SQLSRV_ENCODING_BINARY, PDO::SQLSRV_ENCODING_SYSTEM, PDO::SQLSRV_ENCODING_UTF8, PDO::SQLSRV_ENCODING_DEFAULT");
Expand Down

0 comments on commit 8ea405b

Please sign in to comment.