Modified pdo tests to work with column encryption (#1051)
This commit is contained in:
parent
051328782d
commit
e30752fc6c
|
@ -101,7 +101,18 @@ try {
|
|||
|
||||
echo "Done\n";
|
||||
} catch (PdoException $e) {
|
||||
echo $e->getMessage() . PHP_EOL;
|
||||
if (isAEConnected()) {
|
||||
// The Always Encrypted feature does not support emulate prepare for binding parameters
|
||||
$expected = '*Parameterized statement with attribute PDO::ATTR_EMULATE_PREPARES is not supported in a Column Encryption enabled Connection.';
|
||||
if (!fnmatch($expected, $e->getMessage())) {
|
||||
echo "Unexpected exception caught when connecting with Column Encryption enabled:\n";
|
||||
echo $e->getMessage() . PHP_EOL;
|
||||
} else {
|
||||
echo "Done\n";
|
||||
}
|
||||
} else {
|
||||
echo $e->getMessage() . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -22,7 +22,7 @@ function insertRead($conn, $pdoStrParam, $value, $testCase, $id, $encoding = fal
|
|||
{
|
||||
global $p, $tableName;
|
||||
|
||||
$sql = "INSERT INTO $tableName VALUES (:value)";
|
||||
$sql = "INSERT INTO $tableName (Col1) VALUES (:value)";
|
||||
$options = array(PDO::ATTR_EMULATE_PREPARES => false); // it's false by default anyway
|
||||
$stmt = $conn->prepare($sql, $options);
|
||||
|
||||
|
|
Loading…
Reference in a new issue